Thread
#multiplatform
    r

    robstoll

    1 year ago
    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 questions1. ✔️ 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?
    ilya.gorbunov

    ilya.gorbunov

    1 year ago
    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

    robstoll

    1 year ago
    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
    ilya.gorbunov

    ilya.gorbunov

    1 year ago
    2. Try to declare the plugin dependency, but do not apply it in the root project:
    kotlin("multiplatform") version ... apply false
    r

    robstoll

    1 year ago
    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
    ilya.gorbunov

    ilya.gorbunov

    1 year ago
    You can use
    the<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>().apply {
        ...
    }
    instead of
    kotlin { }
    in the
    subprojects { }
    block.
    r

    robstoll

    1 year ago
    perfect, thanks
    In case there are others which want to see the build fail and not continue if tests are still up-to-date but failed previously:https://gist.github.com/robstoll/dde7adb7a06e420f87a5eb9390b37ce4