diff --git a/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args b/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args new file mode 100644 index 00000000000..d99fe90b79c --- /dev/null +++ b/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args @@ -0,0 +1,3 @@ +$TESTDATA_DIR$/simple2js.kt +-output +$TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.out b/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.out new file mode 100644 index 00000000000..a33af2c6697 --- /dev/null +++ b/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.out @@ -0,0 +1,2 @@ +error: old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend +COMPILATION_ERROR diff --git a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index 1fae0c082df..ede645c6deb 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -1363,6 +1363,11 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/languageVersion.args"); } + @TestMetadata("legacyCompilerUsageWithoutFlag.args") + public void testLegacyCompilerUsageWithoutFlag() throws Exception { + runTest("compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args"); + } + @TestMetadata("libraryDirNotFound.args") public void testLibraryDirNotFound() throws Exception { runTest("compiler/testData/cli/js/libraryDirNotFound.args"); diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt index 5f2bfe713b6..f98ef4308d7 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Kotlin2JsCompile.kt @@ -158,10 +158,6 @@ abstract class Kotlin2JsCompile @Inject constructor( args.fragmentRefines = multiplatformStructure.fragmentRefinesCompilerArgs } - if (!isIrBackendEnabled()) { - args.forceDeprecatedLegacyCompilerUsage = true - } - // Overriding freeArgs from compilerOptions with enhanced one + additional one set on execution phase // containing additional arguments based on the js compilation configuration args.freeArgs = executionTimeFreeCompilerArgs ?: enhancedFreeCompilerArgs.get() diff --git a/plugins/atomicfu/atomicfu-runtime/build.gradle.kts b/plugins/atomicfu/atomicfu-runtime/build.gradle.kts index 58c6cf4185b..6b52d718e15 100644 --- a/plugins/atomicfu/atomicfu-runtime/build.gradle.kts +++ b/plugins/atomicfu/atomicfu-runtime/build.gradle.kts @@ -37,3 +37,7 @@ publishing { } } } + +tasks.withType { + kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage" +} \ No newline at end of file