KotlinHierarchyBuilder

Provides a DSL to define the structure of KotlinSourceSets inside the KotlinSourceSetTree.

For example, to build a custom KotlinSourceSetTree using a DSL call to kotlin.applyHierarchyTemplate { .. } in a multiplatform project.

Inheritors

Types

Link copied to clipboard

The root node in the hierarchy DSL structure.

Functions

Link copied to clipboard
open fun common(build: KotlinHierarchyBuilder.() -> Unit)

Creates a group with the name "common". It's a shortcut for group("common") { }.

Link copied to clipboard
abstract fun excludeCompilations(predicate: (KotlinCompilation<*>) -> Boolean)

Allows including only those KotlinCompilations for which the predicate returns true.

Link copied to clipboard
abstract fun group(name: String, build: KotlinHierarchyBuilder.() -> Unit = {})

Creates a group of KotlinSourceSets with the given name and structure provided via the build block.

Link copied to clipboard
abstract fun withAndroidNative()

Only includes Kotlin's Android/Native targets in this group.

Link copied to clipboard
abstract fun withAndroidNativeArm32()

Only includes Kotlin's Android/androidNativeArm32 target in this group.

Link copied to clipboard
abstract fun withAndroidNativeArm64()

Only includes Kotlin's Android/androidNativeArm64 target in this group.

Link copied to clipboard
abstract fun withAndroidNativeX64()

Only includes Kotlin's Android/androidNativeX64 target in this group.

Link copied to clipboard
abstract fun withAndroidNativeX86()

Only includes Kotlin's Android/androidNativeX86 target in this group.

Link copied to clipboard
abstract fun withAndroidTarget()

Only includes Kotlin's Android targets in this group.

Link copied to clipboard
abstract fun withApple()

Only includes Kotlin's Apple targets in this group.

Link copied to clipboard
abstract fun withCompilations(predicate: (KotlinCompilation<*>) -> Boolean)

Allows including only those KotlinCompilations for which the predicate returns true.

Link copied to clipboard
abstract fun withIos()

Only includes Kotlin's Apple/iOS targets in this group.

Link copied to clipboard
abstract fun withIosArm64()

Only includes Kotlin's Apple/iosArm64 target in this group.

Link copied to clipboard
abstract fun withIosSimulatorArm64()

Only includes Kotlin's Apple/iosSimulatorArm64 target in this group.

Link copied to clipboard
abstract fun withIosX64()

Only includes Kotlin's Apple/iosX64 target in this group.

Link copied to clipboard
abstract fun withJs()

Only includes targets for Kotlin/JS in this group.

Link copied to clipboard
abstract fun withJvm()

Only includes targets for Kotlin/JVM in this group.

Link copied to clipboard
abstract fun withLinux()

Only includes Kotlin's Linux targets in this group.

Link copied to clipboard
abstract fun withLinuxArm64()

Only includes Kotlin's linuxArm64 target in this group.

Link copied to clipboard
abstract fun withLinuxX64()

Only includes Kotlin's linuxX64 target in this group.

Link copied to clipboard
abstract fun withMacos()

Only includes Kotlin's Apple/macOS targets in this group.

Link copied to clipboard
abstract fun withMacosArm64()

Only includes Kotlin's Apple/macosArm64 target in this group.

Link copied to clipboard
abstract fun withMacosX64()

Only includes Kotlin's Apple/macosX64 target in this group.

Link copied to clipboard
abstract fun withMingw()

Only includes Kotlin's MinGW targets in this group.

Link copied to clipboard
abstract fun withMingwX64()

Only includes Kotlin's mingwX64 target in this group.

Link copied to clipboard
abstract fun withNative()

Only includes targets for Kotlin/Native in this group.

Link copied to clipboard
abstract fun withTvos()

Only includes Kotlin's Apple/tvOS targets in this group.

Link copied to clipboard
abstract fun withTvosArm64()

Only includes Kotlin's Apple/tvosArm64 target in this group.

Link copied to clipboard
abstract fun withTvosSimulatorArm64()

Only includes Kotlin's Apple/tvosSimulatorArm64 target in this group.

Link copied to clipboard
abstract fun withTvosX64()

Only includes Kotlin's Apple/tvosX64 target in this group.

Link copied to clipboard
abstract fun withWasmJs()

Only includes Kotlin's Wasm/JS targets in this group.

Link copied to clipboard
abstract fun withWasmWasi()

Only includes Kotlin's Wasm/WASI targets in this group.

Link copied to clipboard
abstract fun withWatchos()

Only includes Kotlin's Apple/watchOS targets in this group.

Link copied to clipboard
abstract fun withWatchosArm32()

Only includes Kotlin's Apple/watchosArm32 target in this group.

Link copied to clipboard
abstract fun withWatchosArm64()

Only includes Kotlin's Apple/watchosArm64 target in this group.

Link copied to clipboard
abstract fun withWatchosDeviceArm64()

Only includes Kotlin's Apple/watchosDeviceArm64 target in this group.

Link copied to clipboard

Only includes Kotlin's Apple/watchosSimulatorArm64 target in this group.

Link copied to clipboard
abstract fun withWatchosX64()

Only includes Kotlin's Apple/watchosX64 target in this group.