Use -opt-in instead of -Xopt-in in comments and scripts
This commit is contained in:
@@ -40,9 +40,9 @@ compileKotlinCommon {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = [
|
||||
"-module-name", project.name,
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalMultiplatform",
|
||||
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalMultiplatform",
|
||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-Xallow-kotlin-package",
|
||||
]
|
||||
}
|
||||
@@ -51,9 +51,9 @@ compileKotlinCommon {
|
||||
compileTestKotlinCommon {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += [
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-opt-in=kotlin.ExperimentalStdlibApi",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public expect annotation class JsName(val name: String)
|
||||
*
|
||||
* Usages of such annotations will be reported as warnings unless an explicit opt-in with
|
||||
* the [OptIn] annotation, e.g. `@OptIn(ExperimentalJsExport::class)`,
|
||||
* or with the `-Xopt-in=kotlin.js.ExperimentalJsExport` compiler option is given.
|
||||
* or with the `-opt-in=kotlin.js.ExperimentalJsExport` compiler option is given.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Experimental(level = Experimental.Level.WARNING)
|
||||
|
||||
@@ -70,8 +70,8 @@ compileKotlin {
|
||||
kotlinOptions.freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xmultifile-parts-inherit",
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-Xsuppress-deprecated-jvm-target-warning",
|
||||
]
|
||||
kotlinOptions.moduleName = project.name
|
||||
@@ -81,10 +81,10 @@ compileTestKotlin {
|
||||
kotlinOptions.freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xmulti-platform",
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-Xopt-in=kotlin.io.path.ExperimentalPathApi",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-opt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-opt-in=kotlin.io.path.ExperimentalPathApi",
|
||||
"-Xcommon-sources=${fileTree('../test').join(',')}",
|
||||
"-Xsuppress-deprecated-jvm-target-warning",
|
||||
]
|
||||
|
||||
@@ -15,7 +15,7 @@ import kotlin.annotation.AnnotationTarget.*
|
||||
*
|
||||
* Any usage of a declaration annotated with `@ExperimentalPathApi` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalPathApi::class)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlin.io.path.ExperimentalPathApi`.
|
||||
* or by using the compiler argument `-opt-in=kotlin.io.path.ExperimentalPathApi`.
|
||||
*/
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
|
||||
@@ -67,10 +67,10 @@ compileTestKotlin {
|
||||
kotlinOptions.freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xmulti-platform",
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-Xopt-in=kotlin.io.path.ExperimentalPathApi",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-opt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-opt-in=kotlin.io.path.ExperimentalPathApi",
|
||||
"-Xcommon-sources=${fileTree('../test').join(',')}",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -138,9 +138,9 @@ compileKotlin2Js {
|
||||
outputFile = "${buildDir}/classes/main/kotlin.js"
|
||||
sourceMap = true
|
||||
freeCompilerArgs += [
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalMultiplatform",
|
||||
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalMultiplatform",
|
||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -149,9 +149,9 @@ compileTestKotlin2Js {
|
||||
kotlinOptions {
|
||||
moduleKind = "umd"
|
||||
freeCompilerArgs += [
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-opt-in=kotlin.ExperimentalStdlibApi",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import findAssociatedObject
|
||||
*
|
||||
* Any usage of a declaration annotated with `@ExperimentalAssociatedObjects` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalAssociatedObjects::class)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlin.reflect.ExperimentalAssociatedObjects`.
|
||||
* or by using the compiler argument `-opt-in=kotlin.reflect.ExperimentalAssociatedObjects`.
|
||||
*/
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
|
||||
@Retention(value = AnnotationRetention.BINARY)
|
||||
|
||||
@@ -116,9 +116,9 @@ compileKotlin {
|
||||
freeCompilerArgs = [
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xmultifile-parts-inherit",
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalMultiplatform",
|
||||
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalMultiplatform",
|
||||
"-opt-in=kotlin.contracts.ExperimentalContracts",
|
||||
"-Xuse-14-inline-classes-mangling-scheme",
|
||||
"-Xsuppress-deprecated-jvm-target-warning",
|
||||
]
|
||||
@@ -129,9 +129,9 @@ compileKotlin {
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs += [
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-opt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-Xsuppress-deprecated-jvm-target-warning",
|
||||
]
|
||||
// This is needed for JavaTypeTest; typeOf for non-reified type parameters doesn't work otherwise, for implementation reasons.
|
||||
@@ -140,7 +140,7 @@ compileTestKotlin {
|
||||
}
|
||||
|
||||
compileLongRunningTestKotlin {
|
||||
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalStdlibApi"
|
||||
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.ExperimentalStdlibApi"
|
||||
}
|
||||
|
||||
task longRunningTest(type: Test, dependsOn: longRunningTestClasses) {
|
||||
|
||||
@@ -12,9 +12,9 @@ sourceSets {
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = [
|
||||
"-Xopt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xopt-in=kotlin.time.ExperimentalTime",
|
||||
"-opt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-opt-in=kotlin.time.ExperimentalTime",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import kotlin.annotation.AnnotationTarget.*
|
||||
*
|
||||
* Any usage of a declaration annotated with `@ExperimentalStdlibApi` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalStdlibApi::class)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlin.ExperimentalStdlibApi`.
|
||||
* or by using the compiler argument `-opt-in=kotlin.ExperimentalStdlibApi`.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Experimental(level = Experimental.Level.ERROR)
|
||||
|
||||
@@ -14,7 +14,7 @@ import kotlin.internal.RequireKotlinVersionKind
|
||||
*
|
||||
* Any usage of a declaration annotated with `@ExperimentalMultiplatform` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalMultiplatform::class)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlin.ExperimentalMultiplatform`.
|
||||
* or by using the compiler argument `-opt-in=kotlin.ExperimentalMultiplatform`.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Experimental
|
||||
|
||||
@@ -18,7 +18,7 @@ import kotlin.reflect.KClass
|
||||
* Call sites of any declaration annotated with that marker should opt in to the API either by using [OptIn],
|
||||
* or by being annotated with that marker themselves, effectively causing further propagation of the opt-in requirement.
|
||||
*
|
||||
* This class requires opt-in itself and can only be used with the compiler argument `-Xopt-in=kotlin.RequiresOptIn`.
|
||||
* This class requires opt-in itself and can only be used with the compiler argument `-opt-in=kotlin.RequiresOptIn`.
|
||||
*
|
||||
* @property message message to be reported on usages of API without an explicit opt-in, or empty string for the default message.
|
||||
* The default message is: "This declaration is experimental and its usage should be marked with 'Marker'
|
||||
@@ -50,7 +50,7 @@ public annotation class RequiresOptIn(
|
||||
* Allows to use the API denoted by the given markers in the annotated file, declaration, or expression.
|
||||
* If a declaration is annotated with [OptIn], its usages are **not** required to opt in to that API.
|
||||
*
|
||||
* This class requires opt-in itself and can only be used with the compiler argument `-Xopt-in=kotlin.RequiresOptIn`.
|
||||
* This class requires opt-in itself and can only be used with the compiler argument `-opt-in=kotlin.RequiresOptIn`.
|
||||
*/
|
||||
@Target(
|
||||
CLASS, PROPERTY, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, EXPRESSION, FILE, TYPEALIAS
|
||||
|
||||
@@ -14,7 +14,7 @@ import kotlin.internal.InlineOnly
|
||||
*
|
||||
* Any usage of a declaration annotated with `@ExperimentalContracts` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalContracts::class)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlin.contracts.ExperimentalContracts`.
|
||||
* or by using the compiler argument `-opt-in=kotlin.contracts.ExperimentalContracts`.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
|
||||
@@ -10,7 +10,7 @@ package kotlin.experimental
|
||||
*
|
||||
* Any usage of a declaration annotated with `@ExperimentalTypeInference` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalTypeInference::class)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlin.experimental.ExperimentalTypeInference`.
|
||||
* or by using the compiler argument `-opt-in=kotlin.experimental.ExperimentalTypeInference`.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Experimental(level = Experimental.Level.ERROR)
|
||||
|
||||
@@ -16,7 +16,7 @@ import kotlin.annotation.AnnotationTarget.*
|
||||
*
|
||||
* Any usage of a declaration annotated with `@ExperimentalTime` must be accepted either by
|
||||
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalTime::class)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlin.time.ExperimentalTime`.
|
||||
* or by using the compiler argument `-opt-in=kotlin.time.ExperimentalTime`.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@Experimental(level = Experimental.Level.ERROR)
|
||||
|
||||
@@ -15,7 +15,7 @@ import kotlin.internal.RequireKotlinVersionKind
|
||||
*
|
||||
* Usages of such API will be reported as warnings unless an explicit opt-in with
|
||||
* the [OptIn] annotation, e.g. `@OptIn(ExperimentalUnsignedTypes::class)`,
|
||||
* or with the `-Xopt-in=kotlin.ExperimentalUnsignedTypes` compiler option is given.
|
||||
* or with the `-opt-in=kotlin.ExperimentalUnsignedTypes` compiler option is given.
|
||||
*
|
||||
* It's recommended to propagate the experimental status to the API that depends on unsigned types by annotating it with this annotation.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user