eygraber
08/04/2022, 11:52 PMephemient
08/04/2022, 11:57 PMeygraber
08/05/2022, 12:02 AMSebastian Sellmair [JB]
08/05/2022, 7:48 AMMichael Paus
08/05/2022, 8:56 AMSebastian Sellmair [JB]
08/05/2022, 12:06 PMjvmMain.dependsOn(jvmAndAndroidMain)
and you should be able to work inside this SourceSet with IDE support.eygraber
08/05/2022, 12:47 PMSebastian Sellmair [JB]
08/05/2022, 1:43 PMjvmAndAndroidMain
source set will analyse with jvm only dependencies. This should be fine IMHO, since Android devs are kind-of used to this siutation.eygraber
08/05/2022, 1:56 PMjvmAndAndroidMain
would it correctly resolve to the Jetpack Compose artifacts in the Android source set?Oliver.O
08/05/2022, 2:56 PMsourceSets {
val frontendCommonMain by creating {
dependsOn(commonMain)
// ...
}
val frontendJsMain by getting {
dependsOn(frontendCommonMain)
// ...
}
val commonJvmMain by creating {
dependsOn(commonMain)
// ...
}
val frontendJvmMain by getting {
dependsOn(frontendCommonMain)
dependsOn(commonJvmMain)
// ...
}
val backendJvmMain by getting {
dependsOn(commonJvmMain)
// ...
}
}
As I have two executable JVM targets, I'm not using the application
plugin, which can accommmodate only one. Instead, I'm using use this task configuration:
val backendJvmArgs: MutableList<String> = mutableListOf(/* ... */)
tasks {
val runBackendJvm by creating(JavaExec::class) {
group = "application"
mainClass.set("MainKt")
jvmArgs = backendJvmArgs
with(kotlin.targets["backendJvm"].compilations["main"] as KotlinJvmCompilation) {
classpath = output.allOutputs + runtimeDependencyFiles
}
}
val runFrontendJvm by creating(JavaExec::class) {
group = "application"
mainClass.set("MainKt")
with(kotlin.targets["frontendJvm"].compilations["main"] as KotlinJvmCompilation) {
classpath = output.allOutputs + runtimeDependencyFiles
}
}
}
Works like a charm for quite a while now. What problems should I expect?Sebastian Sellmair [JB]
08/05/2022, 3:12 PMWorks like a charm for quite a while nowHehe, happy to hear this 🎉 I can explain this in the next multiplatform meetup in detail on how stuff like this works rn under the hood and what issues might arise from there!
Michael Paus
08/05/2022, 3:31 PMIntelliJ IDEA 2022.2.1 Preview (Community Edition)
Build #IC-222.3739.24, built on August 4, 2022
here, right?Oliver.O
08/05/2022, 3:49 PMMichael Paus
08/05/2022, 4:44 PM