With 2.1.20-RC2 and MPP plugin, a jvm target and t...
# eap
h
With 2.1.20-RC2 and MPP plugin, a jvm target and the Gradle
java-test-fixtures
plugin, I need to switch from
testFixturesImplementation
to
jvmTestFixturesImplementation
. While it makes sense, shouldn't be there a migration path? And what about to extending the default
testFixturesImplementation
?
1
youtrack 1
a
Do you mean when you migrate from JVM project to KMP with JVM?
j
@hfhbd is text fixtures fixed on KMP? Or only for JVM
h
No, my project uses 2.1.10 with MPP and JVM target (and also linux). And I applied the
java-test-fixtures
plugin to provide Java only test fixtures.
👍 1
Copy code
plugins {
    kotlin("multiplatform")
    id("java-test-fixtures")
}

kotlin {
    jvm()
    linuxArm64()
}

dependencies {
    jvmTestFixturesApi(libs.sapci.script.api) // was previously testFixturesApi
    jvmTestFixturesApi(libs.sapci.adapter.api)
    jvmTestFixturesApi(libs.apache.camel)
    jvmTestFixturesApi(libs.sapci.javax.activation)
}
The default testFixturesApi configuration is created by the Gradle core plugin, so AFAIK the MPP plugin should extend them: jvmTestFixturesApi.extendsFrom(testFixturesApi), otherwise it is a little bit confusing to have two configurations, while the core config does not affect the Kotlin compile classpath and results into broken builds.
t
just to be sure - in
2.1.10
you haven't used
withJava()
?
h
With 2.1.10 I did use withJava
t
you could still use
withJava()
in
2.1.20
if you have Gradle version <9.0 - then old test-fixtures configurations should work fine We will add a section in What's new regarding this migration path.
h
Okay. I am fine with the change, but I think a migration or a hint in the docs about this changes would be helpful.
👍 1
After testing again, when I remove the
withJava
function call, it does not work with the textFixtue dependency modifier: https://youtrack.jetbrains.com/issue/KT-75808/KGP-MPP-with-jvm-target-and-Gradle-java-test-fixtures-is-broken
t
I will investigate
thank you color 1
Indeed a regression. As workarounds are available - will fix in 2.1.21
Thank you for reporting it!