dwursteisen
03/03/2020, 3:14 PMandroid("android").compilations["release"].defaultSourceSet { ... }
I end up with this solution: iterate over all compilations and if the name match the one I expect, change dependencies.
Is anyone already encounter this kind of issues? How did you fix it?
``````plugins {
id("com.android.application")
kotlin("multiplatform") version "1.3.61"
}
kotlin {
// I need to put a name to the target otherwise
// I got a conflict with the KotlinOptions extension already declared.
android("android") {}
jvm { }
}
sourceSets {
// …
jvm().compilations["test"].defaultSourceSet {
dependencies {
// specific JVM dependencies
}
}
android("android").compilations.all {
if (this.name.endsWith("Test")) {
this.defaultSourceSet.dependencies {
// specify Android Dependencies
}
}
}
}
Kris Wong
03/03/2020, 3:17 PMsourceSets
scope, but then you're calling the target functions and having to drill all the way back innamed("androidMain")
for instancedwursteisen
03/03/2020, 3:34 PMjvm()
… was part of the sourceSets
scope.
👍 thanksKris Wong
03/03/2020, 3:37 PM