[Gradle] Simplify optInAnnotation function name to optIn in DSL
#KT-38111
This commit is contained in:
+2
-2
@@ -18,10 +18,10 @@ interface LanguageSettingsBuilder : LanguageSettings {
|
||||
|
||||
override val enabledLanguageFeatures: Set<String>
|
||||
|
||||
@Deprecated("Unsupported and will be removed in next major releases", replaceWith = ReplaceWith("optInAnnotation(name)"))
|
||||
@Deprecated("Unsupported and will be removed in next major releases", replaceWith = ReplaceWith("optIn(name)"))
|
||||
fun useExperimentalAnnotation(name: String)
|
||||
|
||||
fun optInAnnotation(name: String)
|
||||
fun optIn(annotationName: String)
|
||||
|
||||
override val experimentalAnnotationsInUse: Set<String>
|
||||
}
|
||||
+3
-3
@@ -730,8 +730,8 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
// languageVersion = '1.4'
|
||||
// apiVersion = '1.4'
|
||||
enableLanguageFeature('InlineClasses')
|
||||
optInAnnotation('kotlin.ExperimentalUnsignedTypes')
|
||||
optInAnnotation('kotlin.contracts.ExperimentalContracts')
|
||||
optIn('kotlin.ExperimentalUnsignedTypes')
|
||||
optIn('kotlin.contracts.ExperimentalContracts')
|
||||
progressiveMode = true
|
||||
}
|
||||
project.ext.set("kotlin.mpp.freeCompilerArgsForSourceSet.${'$'}name", ["-Xno-inline"])
|
||||
@@ -824,7 +824,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
||||
)
|
||||
|
||||
testMonotonousCheck(
|
||||
"languageSettings.optInAnnotation('kotlin.ExperimentalUnsignedTypes')",
|
||||
"languageSettings.optIn('kotlin.ExperimentalUnsignedTypes')",
|
||||
"The dependent source set must use all opt-in annotations that its dependency uses."
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ kotlin {
|
||||
targetBMain.dependsOn(nativeMain)
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targetA.compilations.getByName("main").cinterops.create("curl")
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ kotlin {
|
||||
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targets.withType<KotlinNativeTarget>().forEach { target ->
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ kotlin {
|
||||
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targets.withType<KotlinNativeTarget>().forEach { target ->
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ kotlin {
|
||||
}
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targets.withType<KotlinNativeTarget>().forEach { target ->
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ kotlin {
|
||||
}
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targets.withType<KotlinNativeTarget>().forEach { target ->
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ kotlin {
|
||||
targetBMain.dependsOn(nativeMain)
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targetA.compilations.getByName("main").cinterops.create("withPosix") {
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ kotlin {
|
||||
targetBMain.dependsOn(nativeMain)
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targetA.compilations.getByName("main").cinterops.create("sqlite")
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ kotlin {
|
||||
targetBMain.dependsOn(nativeMain)
|
||||
|
||||
sourceSets.all {
|
||||
languageSettings.optInAnnotation("kotlin.RequiresOptIn")
|
||||
languageSettings.optIn("kotlin.RequiresOptIn")
|
||||
}
|
||||
|
||||
targetA.compilations.getByName("main").cinterops.create("sqlite")
|
||||
|
||||
+4
-4
@@ -77,8 +77,8 @@ internal class DefaultLanguageSettingsBuilder(@Transient private val project: Pr
|
||||
return optInAnnotationsInUse
|
||||
}
|
||||
|
||||
override fun optInAnnotation(name: String) {
|
||||
optInAnnotationsInUseImpl += name
|
||||
override fun optIn(annotationName: String) {
|
||||
optInAnnotationsInUseImpl += annotationName
|
||||
}
|
||||
|
||||
override fun useExperimentalAnnotation(name: String) {
|
||||
@@ -86,9 +86,9 @@ internal class DefaultLanguageSettingsBuilder(@Transient private val project: Pr
|
||||
project,
|
||||
"Kotlin language settings function",
|
||||
"useExperimentalAnnotation",
|
||||
"optInAnnotation"
|
||||
"optIn"
|
||||
)
|
||||
optInAnnotation(name)
|
||||
optIn(name)
|
||||
}
|
||||
|
||||
/* A Kotlin task that is responsible for code analysis of the owner of this language settings builder. */
|
||||
|
||||
Reference in New Issue
Block a user