kevin.cianfarini

    kevin.cianfarini

    2 years ago
    follow up question...is it possible to write a module in completely common kotlin and add it to any project? Or do I have to explicitly declare jvm/js/linux/ios/etc
    Dominaezzz

    Dominaezzz

    2 years ago
    You have to be explicit for now.
    1.4
    should improve things.
    kevin.cianfarini

    kevin.cianfarini

    2 years ago
    so, would implementation modules just be...empty?
    Dominaezzz

    Dominaezzz

    2 years ago
    Yes. (Here's the relevant YouTrack issue https://youtrack.jetbrains.com/issue/KT-30088)
    kevin.cianfarini

    kevin.cianfarini

    2 years ago
    cool, thanks!
    russhwolf

    russhwolf

    2 years ago
    For now, you can just iterate through all presets and build each one. I do it like this in Multiplatform Settings:
    kotlin {
        ...
        presets.forEach {
            if (it.name == "jvmWithJava") return@forEach // Probably don't need this, and it chokes on Android plugin
            if (targets.findByName(it.name) == null) {
                targetFromPreset(it)
            }
        }
    }