Stay organized with collections
Save and categorize content based on your preferences.
@Incubating interface KotlinMultiplatformAndroidCompilationBuilder
Options to build a KotlinMultiplatformAndroidCompilation
object.
Summary
Public properties |
String |
The name of the compilation object.
|
String |
The name of the sourceSet that is used in the compilation as the default sourceSet to compile.
|
String? |
The name of the sourceSet tree that would be used to infer the dependencies between sourceSets.
|
Public properties
compilationName
var compilationName: String
The name of the compilation object. The name can be used later to access the compilation object using
kotlin {
androidLibrary {
compilations.getByName("main") {
// configure compilation
}
}
}
defaultSourceSetName
var defaultSourceSetName: String
The name of the sourceSet that is used in the compilation as the default sourceSet to compile. The sourceSet created will be located at $projectDir/src/$sourceSetName
.
The sourceSet name can be used later to access the sourceSet object using
kotlin {
sourceSets.getByName("androidMain") {
// configure sourceSet
}
}
sourceSetTreeName
var sourceSetTreeName: String?
The name of the sourceSet tree that would be used to infer the dependencies between sourceSets. For example, setting the sourceSetTreeName to test
means that compilation will include the commonTest
sourceSet, and setting it to integrationTest
means that the compilation will include the commonIntegrationTest
sourceSet if exists.
Setting this value to null
means that this compilation is not part of any sourceSet trees and the kotlin plugin will not include any common test sourceSets in this compilation.
See also |
org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.targetHierarchy |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# KotlinMultiplatformAndroidCompilationBuilder\n============================================\n\n\n```\n@Incubating interface KotlinMultiplatformAndroidCompilationBuilder\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nOptions to build a [KotlinMultiplatformAndroidCompilation](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilation) object.\n\nSummary\n-------\n\n| ### Public properties ||\n|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [compilationName](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#compilationName()) The name of the compilation object. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [defaultSourceSetName](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#defaultSourceSetName()) The name of the sourceSet that is used in the compilation as the default sourceSet to compile. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [sourceSetTreeName](/reference/tools/gradle-api/8.2/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#sourceSetTreeName()) The name of the sourceSet tree that would be used to infer the dependencies between sourceSets. |\n\nPublic properties\n-----------------\n\n### compilationName\n\n```\nvar compilationName: String\n```\n\nThe name of the compilation object. The name can be used later to access the compilation object using \n\n```kotlin\nkotlin {\n androidLibrary {\n compilations.getByName(\"main\") {\n // configure compilation\n }\n }\n}\n``` \n\n| See also ||\n|-----------------------------------------------------------------------------------------------------------|---|\n| [KotlinCompilation](/reference/tools/gradle-api/8.2/org/jetbrains/kotlin/gradle/plugin/KotlinCompilation) | |\n\n### defaultSourceSetName\n\n```\nvar defaultSourceSetName: String\n```\n\nThe name of the sourceSet that is used in the compilation as the default sourceSet to compile. The sourceSet created will be located at `$projectDir/src/$sourceSetName`.\n\nThe sourceSet name can be used later to access the sourceSet object using \n\n```kotlin\nkotlin {\n sourceSets.getByName(\"androidMain\") {\n // configure sourceSet\n }\n}\n``` \n\n| See also ||\n|-------------------------------------------------------------------------------------------------------|---|\n| [KotlinSourceSet](/reference/tools/gradle-api/8.2/org/jetbrains/kotlin/gradle/plugin/KotlinSourceSet) | |\n\n### sourceSetTreeName\n\n```\nvar sourceSetTreeName: String?\n```\n\nThe name of the sourceSet tree that would be used to infer the dependencies between sourceSets. For example, setting the sourceSetTreeName to `test` means that compilation will include the `commonTest` sourceSet, and setting it to `integrationTest` means that the compilation will include the `commonIntegrationTest` sourceSet if exists.\n\nSetting this value to `null` means that this compilation is not part of any sourceSet trees and the kotlin plugin will not include any common test sourceSets in this compilation. \n\n| See also ||\n|--------------------------------------------------------------------------------|---|\n| `org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.targetHierarchy` | |"]]