[Gradle] Introduce public KotlinGradlePluginDsl marker annotation
The purpose of this annotation is to distinguish different levels of DSL in KGP: - top level extension - target level DSL - compilation level DSL With this marker user should not be able to call implicit methods from upper levels of DSL, and it should reduce confusion with DSL usage. ^KT-57292 In Progress
This commit is contained in:
committed by
Space Team
parent
74b4adf8e2
commit
36e85fec95
@@ -257,6 +257,9 @@ public final class org/jetbrains/kotlin/gradle/dsl/KotlinCompile$DefaultImpls {
|
||||
public static fun kotlinOptions (Lorg/jetbrains/kotlin/gradle/dsl/KotlinCompile;Lorg/gradle/api/Action;)V
|
||||
}
|
||||
|
||||
public abstract interface annotation class org/jetbrains/kotlin/gradle/dsl/KotlinGradlePluginDsl : java/lang/annotation/Annotation {
|
||||
}
|
||||
|
||||
public abstract interface class org/jetbrains/kotlin/gradle/dsl/KotlinHierarchyDsl {
|
||||
public abstract fun applyHierarchyTemplate (Lkotlin/jvm/functions/Function1;)V
|
||||
public abstract fun applyHierarchyTemplate (Lorg/jetbrains/kotlin/gradle/plugin/KotlinHierarchyTemplate;)V
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright 2010-2023 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
/**
|
||||
* Marks a Kotlin Gradle plugin DSL language.
|
||||
*
|
||||
* @see DslMarker
|
||||
*/
|
||||
@DslMarker
|
||||
annotation class KotlinGradlePluginDsl
|
||||
+1
@@ -15,6 +15,7 @@ package org.jetbrains.kotlin.gradle.dsl
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
@KotlinGradlePluginDsl
|
||||
interface KotlinTopLevelExtensionConfig {
|
||||
|
||||
/**
|
||||
|
||||
+2
@@ -18,9 +18,11 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptionsDeprecated
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCompileDeprecated
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinGradlePluginDsl
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
|
||||
import org.jetbrains.kotlin.tooling.core.HasMutableExtras
|
||||
|
||||
@KotlinGradlePluginDsl
|
||||
interface KotlinCompilation<out T : KotlinCommonOptionsDeprecated> : Named,
|
||||
HasProject,
|
||||
HasMutableExtras,
|
||||
|
||||
+2
@@ -20,8 +20,10 @@ import org.jetbrains.kotlin.gradle.InternalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonCompilerOptions
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptionsDeprecated
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinGradlePluginDsl
|
||||
import org.jetbrains.kotlin.tooling.core.HasMutableExtras
|
||||
|
||||
@KotlinGradlePluginDsl
|
||||
interface KotlinTarget : Named, HasAttributes, HasProject, HasMutableExtras {
|
||||
val targetName: String
|
||||
val disambiguationClassifier: String? get() = targetName
|
||||
|
||||
Reference in New Issue
Block a user