[K/JS Gradle] Remove forceLegacyBackendUsage from KotlinGradlePlugin previously added with the compiler flags refactoring, also fix bootstrap compilation of atomicfu plugin

This commit is contained in:
Artem Kobzar
2023-04-12 14:04:34 +00:00
committed by Space Team
parent 592baee852
commit f0aa6c6d32
5 changed files with 14 additions and 4 deletions
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/simple2js.kt
-output
$TEMP_DIR$/out.js
@@ -0,0 +1,2 @@
error: old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend
COMPILATION_ERROR
@@ -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");
@@ -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()
@@ -37,3 +37,7 @@ publishing {
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile> {
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
}