Class KotlinSourceSetTree
-
- All Implemented Interfaces:
public final class KotlinSourceSetTreeWhen 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
maintree withcommonMainas its root SourceSetThe
testtree withcommonTestas 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 iosArm64TestUsually, 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 classKotlinSourceSetTree.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Stringnamepublic final static KotlinSourceSetTree.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description KotlinSourceSetTree(String name)
-