sourceSetTrees
Defines the KotlinSourceSetTrees that the described hierarchy is applied to.
Examples of DSL:
Only apply a hierarchy for the "main" and "test" KotlinSourceSetTree:
applyHierarchyTemplate {
sourceSetTrees(KotlinSourceSetTree.main, KotlinSourceSetTree.test)
common {
withJvm()
group("ios") {
withIos()
}
}
}
Content copied to clipboard
When given the iosX64()
, iosArm64()
, and jvm()
targets, this DSL creates the following trees:
"main" "test"
commonMain commonTest
| |
+----+-----+ +----+-----+
| | | |
iosMain jvmMain iosTest jvmTest
| |
+---+----+ +---+----+
| | | |
iosX64Main iosArm64Main iosX64Test iosArm64Test
Content copied to clipboard
Use a different hierarchy for "main" and "test" KotlinSourceSetTree:
applyHierarchyTemplate {
sourceSetTrees(SourceSetTree.main) // ! <- only applied to the "main" tree
common {
withJvm()
group("ios") {
withIos()
}
}
}
applyHierarchyTemplate {
sourceSetTrees(SourceSetTree.test) // ! <- only applied to the "test" tree
common {
withJvm()
withIos()
}
}
Content copied to clipboard
When given the iosX64()
, iosArm64()
, and jvm()
targets, this DSL creates the following trees:
"main" "test"
commonMain commonTest
| |
+----+-----+ +-----------+-----------+
| | | | |
iosMain jvmMain iosX64Test iosArm64Test jvmTest
|
+---+----+
| |
iosX64Main iosArm64Main
Content copied to clipboard