Class KotlinSourceSetTree
-
- All Implemented Interfaces:
public final class KotlinSourceSetTree
When applying any KotlinHierarchyTemplate (e.g. by calling
applyDefaultHierarchyTemplate()
), the descriptor will be applied on individual compilations, creating multiple trees of shared SourceSets.The name of given shared source set within the target hierarchy will be built by
lowerCamelCase(nameOfGroup, nameOfSourceSetTree)
So for the 'common' group within the 'main' tree the shared SourceSet name will be 'commonMain'The most default case will create two well known SourceSetTrees:
The
main
tree withcommonMain
as its root SourceSetThe
test
tree withcommonTest
as its root SourceSet
e.g.
kotlin { applyDefaultHierarchyTemplate() jvm() iosX64() iosArm64() }
will create two SourceSetTrees: "main" and "test"
"main" "test" commonMain commonTest | | | | +----------+----------+ +----------+----------+ | | | | ... jvmMain ... jvmTest | | | | iosMain iosTest | | +----+-----+ +----+-----+ | | | | iosX64Main iosArm64Main iosX64Test iosArm64Test
Usually, the name of the compilation correlates to the name of the SourceSetTree: As seen in the previous example, the "main" tree under the "commonMain" root contains all 'main' compilations of the projects targets. The "test" tree under the "commonTest" root contains all 'test' compilations of the projects targets.
There are some exceptions, where the name of the compilations cannot be chosen by the user directly (Android) In this case, the name of the SourceSet can be configured outside the target hierarchy DSL.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
KotlinSourceSetTree.Companion
-
Field Summary
Fields Modifier and Type Field Description private final String
name
public final static KotlinSourceSetTree.Companion
Companion
-
Constructor Summary
Constructors Constructor Description KotlinSourceSetTree(String name)
-