updating to the new MPP plugin/Kotlin 1.4.21 is su...
# multiplatform
r
updating to the new MPP plugin/Kotlin 1.4.21 is such a pain point, I really hoped it would be smoother 😞 I hope someone can answer me the following questions 1. ✔️ Is it considered normal that a
gr build
which fails due to failing test succeeds when I re-run it (without changing anything) -> jvmTest is skipped
as it is up-to-date
(allTest is executed but does nothing besides generating a html report). How can I change this behaviour? => seems like it: https://blog.gradle.org/stop-rerunning-tests 2. ✔️How can I disable the
Please initialize at least one Kotlin target in...
check? It was not there in 1.3.72 but is in 1.4.21. I have a root project which does not contain any source but several MPP sub-projects 3. ✔️ After the update to 1.4.21 I cannot longer run tests (via gradle), I get
The root cause java.lang.UnsupportedOperationException was thrown at: org.jetbrains.kotlin.load.kotlin.TypeSignatureMappingKt.mapType(typeSignatureMapping.kt:99)
during
compileTestKotlinJvm
is this a known problem? 4. ✔️ not really a problem as there is an easy workaround but out of curiosity why do
js
targets need the extra definition of the dependency to kotlin-stdlib-js?
👀 1
i
2. Do you apply kotlin-multiplatform plugin to the root project? 3. Looks similar to https://youtrack.jetbrains.com/issue/KT-43802. Is it your case? 4. Shouldn't be needed in 1.4.x (since 1.4.0) because stdlib dependency is added by default.
r
2. yes, I am in a setup where almost all code of the sub-project is of a generative nature, therefore I would like to configure it in the root via
subprojects{ ... }
3. Looks like the same problem 4. good to know, thanks
i
2. Try to declare the plugin dependency, but do not apply it in the root project:
kotlin("multiplatform") version ... apply false
r
not ideal as I cannot longer use Kotlin in this case but need to fallback to the untyped api
for now (as workaround) I declare
jvm()
as target and will disable all tasks involved with it
i
You can use
Copy code
the<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>().apply {
    ...
}
instead of
kotlin { }
in the
subprojects { }
block.
r
perfect, thanks