czuckie
10/24/2022, 11:54 PMczuckie
10/24/2022, 11:54 PMephemient
10/25/2022, 12:03 AMephemient
10/25/2022, 12:05 AMJeff Lockhart
10/25/2022, 12:17 AMJeff Lockhart
10/25/2022, 12:37 AMkotlin {
android()
jvm()
sourceSets {
val commonMain by getting
// this is "Generic JVM Module" (really a source set, not module)
val jvmCommonMain by creating {
dependsOn(commonMain)
dependencies {
// this is "Java lib that totally works on JVM and Android"
implementation("java.lib:1.0")
}
}
val androidMain by getting {
dependsOn(jvmCommonMain)
}
val jvmMain by getting {
dependsOn(jvmCommonMain)
}
}
}
Jeff Lockhart
10/25/2022, 12:52 AMkotlin {
android()
jvm()
sourceSets {
val commonMain by getting
val jvmCommonMain by creating {
dependsOn(commonMain)
dependencies {
// this is compileOnly to resolve dependency in IDE
// replaced in Android and JVM source sets
compileOnly("java.lib-jvm:1.0")
}
}
val androidMain by getting {
dependsOn(jvmCommonMain)
dependencies {
// Android-specific lib artifact
implementation("java.lib-android:1.0")
}
}
val jvmMain by getting {
dependsOn(jvmCommonMain)
dependencies {
// JVM-specific lib artifact
implementation("java.lib-jvm:1.0")
}
}
}
}
ephemient
10/25/2022, 1:26 AMJeff Lockhart
10/25/2022, 2:02 AMcompileOnly
dependency in the jvmCommon source set, also avoiding the API that's not common with the Android artifact.andylamax
10/25/2022, 6:58 AMephemient
10/25/2022, 7:33 AMandylamax
10/25/2022, 7:49 AMczuckie
10/25/2022, 8:06 AMdependsOn(jvmCommonMain)
I'll have a play with this later!czuckie
10/25/2022, 3:22 PMczuckie
10/25/2022, 3:25 PMczuckie
10/25/2022, 3:37 PMactual
implementations in my jvmCommon module, so I've been able to just stuff my semi interesting service layer stuff in there and it's all working well!
thanks for the help peeps!czuckie
10/25/2022, 3:37 PM