# KotlinMultiplatformAndroidCompilationBuilder

# KotlinMultiplatformAndroidCompilationBuilder

<br />

```
@Incubating
public interface KotlinMultiplatformAndroidCompilationBuilder
```

<br />

*** ** * ** ***

Options to build a[KotlinMultiplatformAndroidCompilation](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilation)object.

## Summary

|                                                                                                 ### Public methods                                                                                                  |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract @`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html) | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [getCompilationName](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#getCompilationName())`()` The name of the compilation object.                                                                                                                                                                                                                                                                                                                  |
| `abstract @`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html) | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [getDefaultSourceSetName](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#getDefaultSourceSetName())`()` The name of the sourceSet that is used in the compilation as the default sourceSet to compile.                                                                                                                                                                                                                                             |
| `abstract `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)                                                                                                             | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [getSourceSetTreeName](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#getSourceSetTreeName())`()` The name of the sourceSet tree that would be used to infer the dependencies between sourceSets.                                                                                                                                                                                                                                                  |
| `abstract void`                                                                                                                                                                                                     | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [setCompilationName](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#setCompilationName(kotlin.String))`(@`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)` compilationName)` The name of the compilation object.                                                                           |
| `abstract void`                                                                                                                                                                                                     | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [setDefaultSourceSetName](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#setDefaultSourceSetName(kotlin.String))`(@`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)` defaultSourceSetName)` The name of the sourceSet that is used in the compilation as the default sourceSet to compile. |
| `abstract void`                                                                                                                                                                                                     | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [setSourceSetTreeName](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder#setSourceSetTreeName(kotlin.String))`(`[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)` sourceSetTreeName)` The name of the sourceSet tree that would be used to infer the dependencies between sourceSets.                                                                                                                     |

## Public methods

### getCompilationName

```
@Incubating
abstract @NonNull String getCompilationName()
```

The name of the compilation object. The name can be used later to access the compilation object using  

```kotlin
kotlin {
  androidLibrary {
    compilations.getByName("main") {
      // configure compilation
    }
  }
}
```  

|                                                                  See also                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------|---|
| [KotlinCompilation](https://developer.android.com/reference/tools/gradle-api/8.3/null/org/jetbrains/kotlin/gradle/plugin/KotlinCompilation) |   |

### getDefaultSourceSetName

```
@Incubating
abstract @NonNull String getDefaultSourceSetName()
```

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
kotlin {
  sourceSets.getByName("androidMain") {
    // configure sourceSet
  }
}
```  

|                                                                See also                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [KotlinSourceSet](https://developer.android.com/reference/tools/gradle-api/8.3/null/org/jetbrains/kotlin/gradle/plugin/KotlinSourceSet) |   |

### getSourceSetTreeName

```
@Incubating
abstract String getSourceSetTreeName()
```

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` |   |

### setCompilationName

```
@Incubating
abstract void setCompilationName(@NonNull String compilationName)
```

The name of the compilation object. The name can be used later to access the compilation object using  

```kotlin
kotlin {
  androidLibrary {
    compilations.getByName("main") {
      // configure compilation
    }
  }
}
```  

|                                                                  See also                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------|---|
| [KotlinCompilation](https://developer.android.com/reference/tools/gradle-api/8.3/null/org/jetbrains/kotlin/gradle/plugin/KotlinCompilation) |   |

### setDefaultSourceSetName

```
@Incubating
abstract void setDefaultSourceSetName(@NonNull String defaultSourceSetName)
```

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
kotlin {
  sourceSets.getByName("androidMain") {
    // configure sourceSet
  }
}
```  

|                                                                See also                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [KotlinSourceSet](https://developer.android.com/reference/tools/gradle-api/8.3/null/org/jetbrains/kotlin/gradle/plugin/KotlinSourceSet) |   |

### setSourceSetTreeName

```
@Incubating
abstract void setSourceSetTreeName(String sourceSetTreeName)
```

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` |   |