Andrew Reed
06/14/2023, 2:53 PMAndrew Reed
06/14/2023, 2:55 PMkevin.cianfarini
06/14/2023, 4:40 PMcommonTest
in that?Andrew Reed
06/14/2023, 4:55 PMAndrew Reed
06/14/2023, 4:56 PMkevin.cianfarini
06/14/2023, 4:58 PMcommonTest
. I’m not quite sure why you want them to live in separate sourcesetsAndrew Reed
06/14/2023, 5:00 PMAndrew Reed
06/14/2023, 5:01 PMkevin.cianfarini
06/14/2023, 5:10 PMunit
and integration
. Then I would invoke them separately based on package name from the CLIAndrew Reed
06/14/2023, 5:12 PMkevin.cianfarini
06/14/2023, 5:12 PM./gradlew :shared:cleanIosSimulatorArm64Test :shared:iosSimulatorArm64Test --tests "my.package.integration.*"
Andrew Reed
06/14/2023, 5:14 PMJeff Lockhart
06/14/2023, 5:50 PM@OptIn(ExperimentalKotlinGradlePluginApi::class)
kotlin {
// or targetHierarchy.custom if you want to manually define intermediate source sets
targetHierarchy.default {
// create commonIntegrationTest source set tree as well as the default commonMain and commonTest
sourceSetTrees(SourceSetTree.main, SourceSetTree.test, SourceSetTree.integrationTest)
}
androidTarget {
publishAllLibraryVariants()
// androidInstrumentedTest will be part of the commonIntegrationTest source set tree
instrumentedTestVariant.sourceSetTree.set(SourceSetTree.integrationTest)
// androidUnitTest will be part of the commonUnitTest source set tree
unitTestVariant.sourceSetTree.set(SourceSetTree.test)
}
jvm()
iosArm64()
iosX64()
// ... other supported targets
}
Andrew Reed
06/14/2023, 5:53 PMJeff Lockhart
06/14/2023, 6:08 PMAndrew Reed
06/19/2023, 7:46 AMJeff Lockhart
06/19/2023, 4:08 PMKirill Zhukov
08/29/2023, 7:06 PMintegrationTest
? I’m specifically interested in having jvmIntegrationTest
(depends on jvmMain
but not jvmTest
).Bart
03/09/2025, 5:48 PMandroidTarget
?
The documentation only mentions example for jvm
target, but when I try to create in similar way new compilation for androidTarget
it fails with:
> Could not create an instance of type org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation.
> Unable to determine constructor argument #1: value 'integrationTest' is not assignable to type KotlinCompilationImpl, or no service of type KotlinCompilationImpl.
for the following (analogous to what we have in docs for jvm
target) code:
androidTarget {
compilations {
val integrationTest by compilations.creating {
}
}
}
I'm using v2.1.10
of Kotlin Multiplatform Plugin.
Maybe @Jeff Lockhart or @Andrew Reed, do you have some ideas?Andrew Reed
03/09/2025, 7:58 PMandroidTarget {
compilations {
val integrationTest by creating {
}
}
}
does that not work?Bart
03/09/2025, 8:41 PMephemient
03/10/2025, 12:52 AMephemient
03/10/2025, 12:52 AMBart
03/13/2025, 4:09 PM