Replace -Xuse-experimental with -Xopt-in in codebase
This commit is contained in:
committed by
teamcityserver
parent
195b6d1fb1
commit
47c8bab48e
+2
-2
@@ -314,8 +314,8 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
|||||||
reportError: (String) -> Unit,
|
reportError: (String) -> Unit,
|
||||||
reportWarning: (String) -> Unit
|
reportWarning: (String) -> Unit
|
||||||
) {
|
) {
|
||||||
// Ideally, we should run full resolution (with all classifier usage checkers) on classifiers used in "-Xexperimental" and
|
// Ideally, we should run full resolution (with all classifier usage checkers) on classifiers used in
|
||||||
// "-Xuse-experimental" arguments. However, it's not easy to do this. This should be solved in the future with the support of
|
// "-Xopt-in" arguments. However, it's not easy to do this. This should be solved in the future with the support of
|
||||||
// module annotations. For now, we only check deprecations because this is needed to correctly retire unneeded compiler arguments.
|
// module annotations. For now, we only check deprecations because this is needed to correctly retire unneeded compiler arguments.
|
||||||
val deprecationResolver = DeprecationResolver(
|
val deprecationResolver = DeprecationResolver(
|
||||||
LockBasedStorageManager("ExperimentalUsageChecker"),
|
LockBasedStorageManager("ExperimentalUsageChecker"),
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ sourceSets.main.get().java.srcDir("src/jvm/kotlin")
|
|||||||
|
|
||||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
freeCompilerArgs = listOf("-Xuse-experimental=kotlin.ExperimentalUnsignedTypes",
|
freeCompilerArgs = listOf("-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||||
"-Xuse-experimental=kotlin.Experimental",
|
|
||||||
"-Xopt-in=kotlin.RequiresOptIn",
|
"-Xopt-in=kotlin.RequiresOptIn",
|
||||||
"-Xinline-classes",
|
"-Xinline-classes",
|
||||||
"-Xskip-prerelease-check")
|
"-Xskip-prerelease-check")
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ import kotlin.annotation.AnnotationTarget.*
|
|||||||
*
|
*
|
||||||
* Any usage of a declaration annotated with `@ExperimentalCli` must be accepted either by
|
* Any usage of a declaration annotated with `@ExperimentalCli` must be accepted either by
|
||||||
* annotating that usage with the [UseExperimental] annotation, e.g. `@UseExperimental(ExperimentalCli::class)`,
|
* annotating that usage with the [UseExperimental] annotation, e.g. `@UseExperimental(ExperimentalCli::class)`,
|
||||||
* or by using the compiler argument `-Xuse-experimental=kotlinx.cli.ExperimentalCli`.
|
* or by using the compiler argument `-Xopt-in=kotlinx.cli.ExperimentalCli`.
|
||||||
*/
|
*/
|
||||||
@RequiresOptIn("This API is experimental. It may be changed in the future without notice.", RequiresOptIn.Level.WARNING)
|
@RequiresOptIn("This API is experimental. It may be changed in the future without notice.", RequiresOptIn.Level.WARNING)
|
||||||
@Retention(AnnotationRetention.BINARY)
|
@Retention(AnnotationRetention.BINARY)
|
||||||
|
|||||||
@@ -50,9 +50,8 @@ tasks.withType<KotlinCompile<*>>().configureEach {
|
|||||||
kotlinOptions.freeCompilerArgs += listOf(
|
kotlinOptions.freeCompilerArgs += listOf(
|
||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-Xallow-result-return-type",
|
"-Xallow-result-return-type",
|
||||||
"-Xuse-experimental=kotlin.Experimental",
|
"-Xopt-in=kotlin.ExperimentalMultiplatform",
|
||||||
"-Xuse-experimental=kotlin.ExperimentalMultiplatform",
|
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||||
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
|
||||||
"-Xinline-classes"
|
"-Xinline-classes"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,9 +122,8 @@ tasks.withType<KotlinCompile<*>> {
|
|||||||
kotlinOptions.freeCompilerArgs += listOf(
|
kotlinOptions.freeCompilerArgs += listOf(
|
||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-Xallow-result-return-type",
|
"-Xallow-result-return-type",
|
||||||
"-Xuse-experimental=kotlin.Experimental",
|
"-Xopt-in=kotlin.ExperimentalMultiplatform",
|
||||||
"-Xuse-experimental=kotlin.ExperimentalMultiplatform",
|
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||||
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
|
||||||
"-Xinline-classes",
|
"-Xinline-classes",
|
||||||
"-Xopt-in=kotlin.RequiresOptIn",
|
"-Xopt-in=kotlin.RequiresOptIn",
|
||||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||||
|
|||||||
@@ -138,9 +138,8 @@ tasks.withType<KotlinCompile<*>>().configureEach {
|
|||||||
kotlinOptions.freeCompilerArgs += listOf(
|
kotlinOptions.freeCompilerArgs += listOf(
|
||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-Xallow-result-return-type",
|
"-Xallow-result-return-type",
|
||||||
"-Xuse-experimental=kotlin.Experimental",
|
"-Xopt-in=kotlin.ExperimentalMultiplatform",
|
||||||
"-Xuse-experimental=kotlin.ExperimentalMultiplatform",
|
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||||
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
|
||||||
"-Xinline-classes",
|
"-Xinline-classes",
|
||||||
"-Xopt-in=kotlin.RequiresOptIn",
|
"-Xopt-in=kotlin.RequiresOptIn",
|
||||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||||
|
|||||||
@@ -74,9 +74,8 @@ tasks.withType<KotlinCompile<*>>().configureEach {
|
|||||||
kotlinOptions.freeCompilerArgs += listOf(
|
kotlinOptions.freeCompilerArgs += listOf(
|
||||||
"-Xallow-kotlin-package",
|
"-Xallow-kotlin-package",
|
||||||
"-Xallow-result-return-type",
|
"-Xallow-result-return-type",
|
||||||
"-Xuse-experimental=kotlin.Experimental",
|
"-Xopt-in=kotlin.ExperimentalMultiplatform",
|
||||||
"-Xuse-experimental=kotlin.ExperimentalMultiplatform",
|
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||||
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
|
||||||
"-Xinline-classes",
|
"-Xinline-classes",
|
||||||
"-Xopt-in=kotlin.RequiresOptIn",
|
"-Xopt-in=kotlin.RequiresOptIn",
|
||||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||||
|
|||||||
Reference in New Issue
Block a user