https://kotlinlang.org logo
k

kevin.cianfarini

01/18/2020, 11:38 PM
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
d

Dominaezzz

01/18/2020, 11:42 PM
You have to be explicit for now.
1.4
should improve things.
k

kevin.cianfarini

01/18/2020, 11:42 PM
so, would implementation modules just be...empty?
d

Dominaezzz

01/18/2020, 11:44 PM
Yes. (Here's the relevant YouTrack issue https://youtrack.jetbrains.com/issue/KT-30088)
k

kevin.cianfarini

01/18/2020, 11:44 PM
cool, thanks!
r

russhwolf

01/19/2020, 12:48 AM
For now, you can just iterate through all presets and build each one. I do it like this in Multiplatform Settings:
Copy code
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)
        }
    }
}