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