[Gradle][MPP] KotlinTargetHierarchyBuilder: implement w/ include & exclude predicates

^KT-53570 Verification Pending
This commit is contained in:
Sebastian Sellmair
2022-10-06 18:26:09 +02:00
committed by Space Team
parent c5d6162578
commit a8a861e1ce
10 changed files with 321 additions and 81 deletions
@@ -52,7 +52,7 @@ interface KotlinTargetHierarchyDsl {
* +----------------------+--------------------+-----------------------+
* | | | |
*
* apple linux windows androidNative
* apple linux mingw androidNative
*
* |
* +-----------+------------+------------+
@@ -67,11 +67,10 @@ interface KotlinTargetHierarchyDsl {
* ```kotlin
* kotlin {
* targets.hierarchy.default { target ->
* if(target.isNative) {
* group("native") { // <- we can re-declare already existing groups and connect children to it!
* if(target.isLinux || target.isApple) {
* group("unixLike")
* }
* group("native") { // <- we can re-declare already existing groups and connect children to it!
* group("unixLike") {
* anyLinux()
* anyApple()
* }
* }
* }
@@ -1,7 +1,4 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
// DO NOT EDIT MANUALLY! Generated by org.jetbrains.kotlin.generators.gradle.dsl.MppKotlinTargetHierarchyBuilderCodegenKt
package org.jetbrains.kotlin.gradle.plugin
@@ -9,24 +6,54 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
@ExperimentalKotlinGradlePluginApi
interface KotlinTargetHierarchyBuilder {
val target: KotlinTarget
val compilation: KotlinCompilation<*>
val isNative: Boolean
val isApple: Boolean
val isIos: Boolean
val isWatchos: Boolean
val isMacos: Boolean
val isTvos: Boolean
val isWindows: Boolean
val isLinux: Boolean
val isAndroidNative: Boolean
val isJvm: Boolean
val isAndroidJvm: Boolean
val isJsLegacy: Boolean
val isJsIr: Boolean
val isJs: Boolean
/* Declaring groups */
fun common(build: KotlinTargetHierarchyBuilder.() -> Unit) = group("common", build)
fun group(name: String, build: KotlinTargetHierarchyBuilder.() -> Unit = {})
/* low-level APIs */
fun includeCompilation(predicate: (KotlinCompilation<*>) -> Boolean)
fun excludeCompilation(predicate: (KotlinCompilation<*>) -> Boolean)
/* Convenient groups */
fun anyNative()
fun anyApple()
fun anyIos()
fun anyWatchos()
fun anyMacos()
fun anyTvos()
fun anyMingw()
fun anyLinux()
fun anyAndroidNative()
fun anyJs()
/* Actual targets */
fun jvm()
fun android()
fun androidNativeX64()
fun androidNativeX86()
fun androidNativeArm32()
fun androidNativeArm64()
fun iosArm32()
fun iosArm64()
fun iosX64()
fun iosSimulatorArm64()
fun watchosArm32()
fun watchosArm64()
fun watchosX86()
fun watchosX64()
fun watchosSimulatorArm64()
fun watchosDeviceArm64()
fun tvosArm64()
fun tvosX64()
fun tvosSimulatorArm64()
fun linuxX64()
fun mingwX86()
fun mingwX64()
fun macosX64()
fun macosArm64()
fun linuxArm64()
fun linuxArm32Hfp()
fun linuxMips32()
fun linuxMipsel32()
fun wasm32()
}
@@ -18,4 +18,4 @@ interface KotlinTargetsContainerWithPresets : KotlinTargetsContainer {
interface KotlinSourceSetContainer {
val sourceSets: NamedDomainObjectContainer<KotlinSourceSet>
}
}