[K/JS] Deprecate old JS-compiler
This commit is contained in:
+5
@@ -362,6 +362,11 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
|||||||
collector.deprecationWarn(irBaseClassInMetadata, false, "-Xir-base-class-in-metadata")
|
collector.deprecationWarn(irBaseClassInMetadata, false, "-Xir-base-class-in-metadata")
|
||||||
collector.deprecationWarn(irNewIr2Js, true, "-Xir-new-ir2js")
|
collector.deprecationWarn(irNewIr2Js, true, "-Xir-new-ir2js")
|
||||||
|
|
||||||
|
if (languageVersion >= LanguageVersion.KOTLIN_1_9) {
|
||||||
|
collector.deprecationWarn(legacyDeprecatedNoWarn, false, "-Xlegacy-deprecated-no-warn")
|
||||||
|
collector.deprecationWarn(useDeprecatedLegacyCompiler, false, "-Xuse-deprecated-legacy-compiler")
|
||||||
|
}
|
||||||
|
|
||||||
return super.configureAnalysisFlags(collector, languageVersion).also {
|
return super.configureAnalysisFlags(collector, languageVersion).also {
|
||||||
it[allowFullyQualifiedNameInKClass] = wasm && wasmKClassFqn //Only enabled WASM BE supports this flag
|
it[allowFullyQualifiedNameInKClass] = wasm && wasmKClassFqn //Only enabled WASM BE supports this flag
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,6 +182,13 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
|||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LanguageVersionSettings languageVersionSettings = CommonConfigurationKeysKt.getLanguageVersionSettings(configuration);
|
||||||
|
|
||||||
|
if (languageVersionSettings.getLanguageVersion().compareTo(LanguageVersion.KOTLIN_1_9) >= 0) {
|
||||||
|
messageCollector.report(ERROR, "Old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend", null);
|
||||||
|
return COMPILATION_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
String deprecatedMessage = "==========\n" +
|
String deprecatedMessage = "==========\n" +
|
||||||
"This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release.\n" +
|
"This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release.\n" +
|
||||||
"\n" +
|
"\n" +
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
$TESTDATA_DIR$/languageVersion.kt
|
||||||
|
-Xlegacy-deprecated-no-warn
|
||||||
|
-Xuse-deprecated-legacy-compiler
|
||||||
|
-output
|
||||||
|
$TEMP_DIR$/out.js
|
||||||
|
-language-version
|
||||||
|
1.9
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
warning: language version 1.9 is experimental, there are no backwards compatibility guarantees for new language and library features
|
||||||
|
error: old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend
|
||||||
|
COMPILATION_ERROR
|
||||||
@@ -1205,6 +1205,11 @@ public class CliTestGenerated extends AbstractCliTest {
|
|||||||
runTest("compiler/testData/cli/js/jsHelp.args");
|
runTest("compiler/testData/cli/js/jsHelp.args");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("jsOldBackend.args")
|
||||||
|
public void testJsOldBackend() throws Exception {
|
||||||
|
runTest("compiler/testData/cli/js/jsOldBackend.args");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kotlinHomeWithoutStdlib.args")
|
@TestMetadata("kotlinHomeWithoutStdlib.args")
|
||||||
public void testKotlinHomeWithoutStdlib() throws Exception {
|
public void testKotlinHomeWithoutStdlib() throws Exception {
|
||||||
runTest("compiler/testData/cli/js/kotlinHomeWithoutStdlib.args");
|
runTest("compiler/testData/cli/js/kotlinHomeWithoutStdlib.args");
|
||||||
|
|||||||
+8
-6
@@ -294,17 +294,19 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
|||||||
doTestPreReleaseKotlinLibrary(K2JVMCompiler(), "library", tmpdir)
|
doTestPreReleaseKotlinLibrary(K2JVMCompiler(), "library", tmpdir)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testReleaseCompilerAgainstPreReleaseLibraryJs() {
|
// https://youtrack.jetbrains.com/issue/KT-54905
|
||||||
doTestPreReleaseKotlinLibrary(K2JSCompiler(), "library", File(tmpdir, "usage.js"))
|
// fun testReleaseCompilerAgainstPreReleaseLibraryJs() {
|
||||||
}
|
// doTestPreReleaseKotlinLibrary(K2JSCompiler(), "library", File(tmpdir, "usage.js"))
|
||||||
|
// }
|
||||||
|
|
||||||
fun testReleaseCompilerAgainstPreReleaseLibrarySkipPrereleaseCheck() {
|
fun testReleaseCompilerAgainstPreReleaseLibrarySkipPrereleaseCheck() {
|
||||||
doTestPreReleaseKotlinLibrary(K2JVMCompiler(), "library", tmpdir, "-Xskip-prerelease-check")
|
doTestPreReleaseKotlinLibrary(K2JVMCompiler(), "library", tmpdir, "-Xskip-prerelease-check")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testReleaseCompilerAgainstPreReleaseLibraryJsSkipPrereleaseCheck() {
|
// https://youtrack.jetbrains.com/issue/KT-54905
|
||||||
doTestPreReleaseKotlinLibrary(K2JSCompiler(), "library", File(tmpdir, "usage.js"), "-Xskip-prerelease-check")
|
// fun testReleaseCompilerAgainstPreReleaseLibraryJsSkipPrereleaseCheck() {
|
||||||
}
|
// doTestPreReleaseKotlinLibrary(K2JSCompiler(), "library", File(tmpdir, "usage.js"), "-Xskip-prerelease-check")
|
||||||
|
// }
|
||||||
|
|
||||||
fun testReleaseCompilerAgainstPreReleaseLibrarySkipMetadataVersionCheck() {
|
fun testReleaseCompilerAgainstPreReleaseLibrarySkipMetadataVersionCheck() {
|
||||||
doTestPreReleaseKotlinLibrary(K2JVMCompiler(), "library", tmpdir, "-Xskip-metadata-version-check")
|
doTestPreReleaseKotlinLibrary(K2JVMCompiler(), "library", tmpdir, "-Xskip-metadata-version-check")
|
||||||
|
|||||||
Reference in New Issue
Block a user