kpgalligan
11/26/2018, 2:42 PMilya.matveev
11/27/2018, 1:36 PM1.3.20
will support Gradle 4.10/5.x metadata.kpgalligan
11/27/2018, 3:30 PMilya.matveev
11/28/2018, 7:22 AMtargets {
fromPreset(presets.iosX64, 'ios')
fromPreset(presets.macosX64, 'macos')
fromPreset(presets.iosArm64, 'iosSim')
configure([ios, macos, iosSim]){
compilations.main {
def attributes = project.configurations.getByName(compileDependencyConfigurationName).attributes
def targetAttribute = attributes.keySet().find {
it.name == "org.jetbrains.kotlin.native.target"
}
def target = attributes.getAttribute(targetAttribute)
dependencies {
implementation "org.jetbrains.kotlinx:atomicfu-native_debug_$target:0.11.10-eap13"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native_debug_$target:0.30.2-eap13"
}
}
}
}
But there is a problem with transitive dependencies in this case. E.g. platform artifacts of coroutines have dependencies on a "root" maven artifact of atomicfu (org.jetbrains.kotlinx:atomicfu-native
) in their pom-files. But we cannot resolve a platform variant for such a "root "dependency because metadata is disabled. So we have to declare all transitive dependencies manually as well as in your example.kpgalligan
11/28/2018, 3:05 PM