pardom
06/24/2019, 8:48 PMpresets.withType<KotlinNativeTargetPreset>().forEach { preset ->
targetFromPreset(preset) {
val main by compilations.getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.2.2")
}
}
}
}
Benjamin Charais
06/24/2019, 8:52 PMpardom
06/24/2019, 8:53 PMBenjamin Charais
06/24/2019, 8:55 PMpardom
06/24/2019, 8:58 PMcommonMain
. I just want to allow it to be consumed by anything.pardom
06/24/2019, 8:58 PMpardom
06/24/2019, 8:59 PMBenjamin Charais
06/24/2019, 8:59 PMallprojects {
dependencies {
}
}
pardom
06/24/2019, 9:02 PMpardom
06/24/2019, 9:03 PMcommonMain
which means itās not restricted to any particular target. As such, I would like to allow library consumers to add this library as a dependency to any target they wish.pardom
06/24/2019, 9:04 PMBenjamin Charais
06/24/2019, 9:05 PMjs {
compilations.forEach {
it.kotlinOptions {
moduleKind = "umd"
sourceMap = true
}
}
}
jvm()
iosX64("ios") {
binaries {
framework("Oolong")
}
}
linuxX64("linux")
macosX64("macOS")
mingwX64("windows")
cocoapods {
summary = "MVU for Kotlin Multiplatform"
homepage = "<http://oolong-kt.org>"
}
have it programatically define targets rather than how it currently is?Benjamin Charais
06/24/2019, 9:05 PMBenjamin Charais
06/24/2019, 9:12 PMkotlin {
presets.withType<KotlinNativeTargetPreset>().forEach {
targetFromPreset(it) {
/* Configure each of the created targets */
}
}
}
I found this in the documentation at:
https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targetsBenjamin Charais
06/24/2019, 9:13 PMBenjamin Charais
06/24/2019, 9:14 PMtargets.all {
compilations["main"].defaultSourceSet { /* ... */ }
}
That would then provide access to all āmainā portions of each target and allow you to add a dependency