Use -opt-in instead of -Xopt-in in comments and scripts
This commit is contained in:
@@ -41,7 +41,7 @@ dependencies {
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = ['-Xopt-in=kotlin.ExperimentalUnsignedTypes', '-Xskip-metadata-version-check']
|
||||
freeCompilerArgs = ['-opt-in=kotlin.ExperimentalUnsignedTypes', '-Xskip-metadata-version-check']
|
||||
allWarningsAsErrors=true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ sourceSets {
|
||||
compileCompilerKotlin {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
kotlinOptions.allWarningsAsErrors=true
|
||||
kotlinOptions.freeCompilerArgs += ['-Xopt-in=kotlin.RequiresOptIn', '-Xopt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI', '-Xskip-prerelease-check']
|
||||
kotlinOptions.freeCompilerArgs += ['-opt-in=kotlin.RequiresOptIn', '-opt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI', '-Xskip-prerelease-check']
|
||||
}
|
||||
|
||||
compileCli_bcKotlin {
|
||||
@@ -185,11 +185,11 @@ targetList.each { target ->
|
||||
args = [*konanArgs,
|
||||
'-output', project(':kotlin-native:runtime').file("build/${target}Stdlib"),
|
||||
'-produce', 'library', '-module-name', 'stdlib',
|
||||
'-Xmulti-platform', '-Xopt-in=kotlin.RequiresOptIn',
|
||||
'-Xopt-in=kotlin.contracts.ExperimentalContracts',
|
||||
'-Xopt-in=kotlin.ExperimentalMultiplatform',
|
||||
'-Xopt-in=kotlin.native.internal.InternalForKotlinNative',
|
||||
'-Xopt-in=kotlin.native.SymbolNameIsDeprecated',
|
||||
'-Xmulti-platform', '-opt-in=kotlin.RequiresOptIn',
|
||||
'-opt-in=kotlin.contracts.ExperimentalContracts',
|
||||
'-opt-in=kotlin.ExperimentalMultiplatform',
|
||||
'-opt-in=kotlin.native.internal.InternalForKotlinNative',
|
||||
'-opt-in=kotlin.native.SymbolNameIsDeprecated',
|
||||
*commonSrc.toList(),
|
||||
*testAnnotationCommon.toList(),
|
||||
*testCommon.toList(),
|
||||
|
||||
@@ -873,14 +873,14 @@ standaloneTest("cleaner_basic") {
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_basic.kt"
|
||||
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_workers") {
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_workers.kt"
|
||||
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
standaloneTest("cleaner_in_main_with_checker") {
|
||||
@@ -927,7 +927,7 @@ standaloneTest("cleaner_in_tls_worker") {
|
||||
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
||||
!isNoopGC
|
||||
source = "runtime/basic/cleaner_in_tls_worker.kt"
|
||||
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
standaloneTest("worker_bound_reference0") {
|
||||
@@ -1406,7 +1406,7 @@ task localClass_localHierarchy(type: KonanLocalTest) {
|
||||
|
||||
standaloneTest("objectDeclaration_globalConstants") {
|
||||
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
||||
flags = ["-opt", "-Xopt-in=kotlin.native.internal.InternalForKotlinNative", "-tr"]
|
||||
flags = ["-opt", "-opt-in=kotlin.native.internal.InternalForKotlinNative", "-tr"]
|
||||
source = "codegen/objectDeclaration/globalConstants.kt"
|
||||
}
|
||||
|
||||
@@ -1791,7 +1791,7 @@ linkTest("classDelegation_linkTest") {
|
||||
}
|
||||
|
||||
standaloneTest("contracts") {
|
||||
flags = [ '-Xopt-in=kotlin.RequiresOptIn', '-tr' ]
|
||||
flags = [ '-opt-in=kotlin.RequiresOptIn', '-tr' ]
|
||||
source = "codegen/contracts/contracts.kt"
|
||||
}
|
||||
|
||||
@@ -3182,7 +3182,7 @@ standaloneTest("codegen_escapeAnalysis_stackAllocated") {
|
||||
disabled = (cacheTesting != null) || // Cache is not compatible with -opt.
|
||||
project.globalTestArgs.contains('-g') || // -g and -opt are incompatible
|
||||
isExperimentalMM // TODO: Experimental MM doesn't support stack-allocated objects yet.
|
||||
flags = ['-opt', '-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-opt', '-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
source = "codegen/escapeAnalysis/stackAllocated.kt"
|
||||
}
|
||||
|
||||
@@ -3301,7 +3301,7 @@ standaloneTest("stress_gc_allocations") {
|
||||
(project.testTarget != "watchos_simulator_arm64") &&
|
||||
!isNoopGC
|
||||
source = "runtime/memory/stress_gc_allocations.kt"
|
||||
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
standaloneTest("mpp1") {
|
||||
@@ -4852,7 +4852,7 @@ if (PlatformInfo.isAppleTarget(project)) {
|
||||
enabled = !isNoopGC
|
||||
source = "interop/objc/kt42172/main.kt"
|
||||
interop = "objc_kt42172"
|
||||
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
useGoldenData = true
|
||||
|
||||
doBeforeBuild {
|
||||
@@ -4985,7 +4985,7 @@ dynamicTest("interop_cleaners_main_thread") {
|
||||
cSource = "$projectDir/interop/cleaners/main_thread.cpp"
|
||||
clangTool = "clang++"
|
||||
useGoldenData = true
|
||||
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
dynamicTest("interop_cleaners_second_thread") {
|
||||
@@ -4994,7 +4994,7 @@ dynamicTest("interop_cleaners_second_thread") {
|
||||
cSource = "$projectDir/interop/cleaners/second_thread.cpp"
|
||||
clangTool = "clang++"
|
||||
useGoldenData = true
|
||||
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
dynamicTest("interop_cleaners_leak") {
|
||||
@@ -5003,7 +5003,7 @@ dynamicTest("interop_cleaners_leak") {
|
||||
cSource = "$projectDir/interop/cleaners/leak.cpp"
|
||||
clangTool = "clang++"
|
||||
useGoldenData = true
|
||||
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
||||
}
|
||||
|
||||
dynamicTest("interop_migrating_main_thread_legacy") {
|
||||
@@ -5598,7 +5598,7 @@ private void configureStdlibTest(KonanGTest task, boolean inWorker) {
|
||||
enableMultiplatform true
|
||||
extraOpts inWorker ? '-trw' : '-tr',
|
||||
'-Xverify-ir',
|
||||
'-Xopt-in=kotlin.RequiresOptIn,kotlin.ExperimentalStdlibApi',
|
||||
'-opt-in=kotlin.RequiresOptIn,kotlin.ExperimentalStdlibApi',
|
||||
"-friend-modules", project.rootProject.file("${UtilsKt.getKotlinNativeDist(project)}/klib/common/stdlib").absolutePath
|
||||
extraOpts project.globalTestArgs
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ class RunExternalTestGroup extends JavaExec implements CompilerRunner {
|
||||
def experimentalSettings = findLinesWithPrefixesRemoved(text, "// !USE_EXPERIMENTAL: ")
|
||||
if (experimentalSettings.size() != 0) {
|
||||
experimentalSettings.forEach { line ->
|
||||
line.split(" ").toList().forEach { flags.add("-Xopt-in=$it") }
|
||||
line.split(" ").toList().forEach { flags.add("-opt-in=$it") }
|
||||
}
|
||||
}
|
||||
def expectActualLinker = findLinesWithPrefixesRemoved(text, "// EXPECT_ACTUAL_LINKER")
|
||||
|
||||
@@ -55,7 +55,7 @@ kotlin {
|
||||
|
||||
jvm().compilations.all {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = ["-Xopt-in=kotlinx.cli.ExperimentalCli", "-Xopt-in=kotlin.RequiresOptIn"]
|
||||
freeCompilerArgs = ["-opt-in=kotlinx.cli.ExperimentalCli", "-opt-in=kotlin.RequiresOptIn"]
|
||||
suppressWarnings = true
|
||||
}
|
||||
}
|
||||
@@ -94,9 +94,9 @@ targetList.each { target ->
|
||||
args = [*konanArgs,
|
||||
'-output', outputFile,
|
||||
'-produce', 'library', '-module-name', moduleName,
|
||||
'-Xmulti-platform', '-Xopt-in=kotlinx.cli.ExperimentalCli',
|
||||
'-Xopt-in=kotlin.ExperimentalMultiplatform',
|
||||
'-Werror', '-Xopt-in=kotlin.RequiresOptIn',
|
||||
'-Xmulti-platform', '-opt-in=kotlinx.cli.ExperimentalCli',
|
||||
'-opt-in=kotlin.ExperimentalMultiplatform',
|
||||
'-Werror', '-opt-in=kotlin.RequiresOptIn',
|
||||
commonSrc.absolutePath,
|
||||
"-Xcommon-sources=${commonSrc.absolutePath}",
|
||||
nativeSrc]
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import kotlin.annotation.AnnotationTarget.*
|
||||
*
|
||||
* 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)`,
|
||||
* or by using the compiler argument `-Xopt-in=kotlinx.cli.ExperimentalCli`.
|
||||
* or by using the compiler argument `-opt-in=kotlinx.cli.ExperimentalCli`.
|
||||
*/
|
||||
@RequiresOptIn("This API is experimental. It may be changed in the future without notice.", RequiresOptIn.Level.WARNING)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
|
||||
@@ -12,7 +12,7 @@ import kotlin.native.internal.*
|
||||
*
|
||||
* 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)
|
||||
|
||||
Reference in New Issue
Block a user