From 85f4b72c8b3947f2d9771b2276167f87b8515ed7 Mon Sep 17 00:00:00 2001 From: Sebastian Sellmair Date: Thu, 22 Jun 2023 09:23:11 +0200 Subject: [PATCH] [Gradle] Remove deprecation from deprecated KotlinTargetHierarchy entities ^KT-58676 Verification Pending --- .../gradle/plugin/KotlinTargetHierarchy.kt | 23 --------- .../SourceSetTreeClassifier.kt | 49 +------------------ 2 files changed, 2 insertions(+), 70 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetHierarchy.kt b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetHierarchy.kt index d342e9323ad..ff3ddd177b3 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetHierarchy.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetHierarchy.kt @@ -23,33 +23,10 @@ interface KotlinTargetHierarchy { @Suppress("DEPRECATION") companion object { - /** - * The 'main' SourceSetTree. Typically, with 'commonMain' as the root SourceSet - */ val main = SourceSetTree("main") - - /** - * The 'test' SourceSetTree. Typically, with 'commonTest' as the root SourceSet - */ val test = SourceSetTree("test") - - /** - * Special pre-defined SourceSetTree: Can be used to introduce a new tree with 'commonUnitTest' as the root SourceSet - * e.g. relevant for organising Android unitTest compilations/SourceSets - */ val unitTest = SourceSetTree("unitTest") - - - /** - * Special pre-defined SourceSetTree: Can be used to introduce a new tree with 'commonInstrumentedTest' as the root SourceSet - * e.g. relevant for organising Android instrumented compilations/SourceSets - */ val instrumentedTest = SourceSetTree("instrumentedTest") - - - /** - * Special pre-defined SourceSetTree: Can be used to introduce a new tree with 'commonIntegrationTest' as root SourceSEt - */ val integrationTest = SourceSetTree("integrationTest") } } diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/targetHierarchy/SourceSetTreeClassifier.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/targetHierarchy/SourceSetTreeClassifier.kt index ff7c95dfe95..1030d007095 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/targetHierarchy/SourceSetTreeClassifier.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/mpp/targetHierarchy/SourceSetTreeClassifier.kt @@ -15,33 +15,6 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinTargetHierarchy.SourceSetTree import org.jetbrains.kotlin.gradle.plugin.awaitFinalValue import org.jetbrains.kotlin.gradle.plugin.hierarchy.KotlinSourceSetTreeClassifier -/** - * Classifier providing the corresponding [SourceSetTree] associated with any given [KotlinCompilation] - * - * ### Example: Overwriting 'test' compilations [SourceSetTreeClassifier]: - * Consider the following setup: - * ```kotlin - * kotlin { - * val testCompilation = jvm().compilations.getByName("test") - * } - * ``` - * - * In this example, we know that the 'jvm/test' compilation will have a 'jvmTest' SourceSet which - * will depend on 'commonTest' and therefore is part of the 'test' [SourceSetTree]. - * - * When another [SourceSetTreeClassifier] is specified, this behaviour is changed. - * Using the External Kotlin Target API: - * ```kotlin - * myTarget.createCompilation { - * compilationName = "test" - * sourceSetTreeClassifier = SourceSetTreeClassifier.Name("unitTest") - * } - * ``` - * - * This will create a compilation called 'test' which however will be considered part of the 'unitTest' SourceSetTree. - * The SourceSet of this 'jvm/test' compilation will still be called 'jvmTest' but since its part of the 'unitTest [SourceSetTree], - * there will not be a dependsOn edge to 'commonTest', but (if present) 'commonUnitTest' - */ @ExternalKotlinTargetApi @Deprecated( "Use org.jetbrains.kotlin.gradle.plugin.hierarchy.KotlinSourceSetTreeClassifier instead", @@ -49,42 +22,24 @@ import org.jetbrains.kotlin.gradle.plugin.hierarchy.KotlinSourceSetTreeClassifie ) sealed class SourceSetTreeClassifier { - /** - * Default Classifier: The name of the compilation will be used to infer the [SourceSetTree]: - * 'main' compilations will be part of [SourceSetTree.main] - * 'test' compilations will be part of [SourceSetTree.test] - * ... - */ @ExternalKotlinTargetApi object Default : SourceSetTreeClassifier() { override fun toString(): String = "Default" } - /** - * Indicates that the given compilations is not part of any 'named' [SourceSetTree]. - * Neither [KotlinTargetHierarchy] will be applied nor default dependsOn edges shall be set. - */ @ExternalKotlinTargetApi object None : SourceSetTreeClassifier() { override fun toString(): String = "None" } - /** - * Predefined [SourceSetTree] using the [tree] specified. - */ @ExternalKotlinTargetApi data class Value(val tree: SourceSetTree) : SourceSetTreeClassifier() - /** - * Predefined [SourceSetTree] using the [name] specified - */ + @ExternalKotlinTargetApi data class Name(val name: String) : SourceSetTreeClassifier() - /** - * Wrapper around [org.gradle.api.provider.Property] of a given [SourceSetTree] in order to - * make the [SourceSetTree] configurable. - */ + @ExternalKotlinTargetApi class Property(val property: org.gradle.api.provider.Property) : SourceSetTreeClassifier() { override fun toString(): String {