diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt index 04d7566f59a..2b6336cb1a3 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt @@ -319,6 +319,12 @@ class K2JSCompilerArguments : CommonCompilerArguments() { @Argument(value = "-Xwasm-enable-asserts", description = "Turn on asserts") var wasmEnableAsserts: Boolean by FreezableVar(false) + @Argument( + value = "-Xuse-deprecated-legacy-compiler", + description = "Use deprecated legacy compiler without error" + ) + var useDeprecatedLegacyCompiler: Boolean by FreezableVar(false) + @Argument( value = "-Xlegacy-deprecated-no-warn", description = "Disable warnings of deprecation of legacy compiler" diff --git a/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java b/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java index d84d77afd21..578ed6bc94a 100644 --- a/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java +++ b/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java @@ -186,8 +186,22 @@ public class K2JSCompiler extends CLICompiler { return exitCode; } + 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" + + "\n" + + "Please migrate your project to the new IR-based compiler (https://kotl.in/jsir).\n" + + "Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle.\n" + + "\n" + + "You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler.\n" + + "=========="; + + if (!arguments.getUseDeprecatedLegacyCompiler()) { + messageCollector.report(ERROR, deprecatedMessage, null); + return COMPILATION_ERROR; + } + if (!arguments.getLegacyDeprecatedNoWarn()) { - messageCollector.report(STRONG_WARNING, "Legacy compiler is deprecated. Please migrate onto IR.", null); + messageCollector.report(STRONG_WARNING, deprecatedMessage, null); } if (arguments.getFreeArgs().isEmpty() && (!incrementalCompilationIsEnabledForJs(arguments))) { diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsCompilerRunnerTest.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsCompilerRunnerTest.kt index c7f2c1d5929..0d59e6f82b1 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsCompilerRunnerTest.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJsCompilerRunnerTest.kt @@ -42,6 +42,7 @@ abstract class AbstractIncrementalJsCompilerRunnerTest : AbstractIncrementalComp outputFile = File(destinationDir, "${testDir.name}.js").path sourceMap = true metaInfo = true + useDeprecatedLegacyCompiler = true } protected open val scopeExpansionMode = CompileScopeExpansionMode.NEVER diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalMultiModuleJsCompilerRunnerTest.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalMultiModuleJsCompilerRunnerTest.kt index d9ebd49d4be..6f02d91cedc 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalMultiModuleJsCompilerRunnerTest.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalMultiModuleJsCompilerRunnerTest.kt @@ -28,6 +28,7 @@ abstract class AbstractIncrementalMultiModuleJsCompilerRunnerTest : K2JSCompilerArguments().apply { sourceMap = true metaInfo = true + useDeprecatedLegacyCompiler = true } override fun makeForSingleModule( diff --git a/compiler/testData/cli/js/createMetadata.args b/compiler/testData/cli/js/createMetadata.args index 32aebd88812..7e91cc9ff23 100644 --- a/compiler/testData/cli/js/createMetadata.args +++ b/compiler/testData/cli/js/createMetadata.args @@ -1,5 +1,6 @@ compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/jslib-example/LibraryExample.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -meta-info -output $TEMP_DIR$/jslib-example.js diff --git a/compiler/testData/cli/js/emptySources.args b/compiler/testData/cli/js/emptySources.args index 1cb791a6a06..78693b64323 100644 --- a/compiler/testData/cli/js/emptySources.args +++ b/compiler/testData/cli/js/emptySources.args @@ -1,5 +1,6 @@ $TEMP_DIR$ -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -no-stdlib -output $TESTDATA_DIR$ diff --git a/compiler/testData/cli/js/inlineCycle.args b/compiler/testData/cli/js/inlineCycle.args index 227d882c7b0..0cd10d03efa 100644 --- a/compiler/testData/cli/js/inlineCycle.args +++ b/compiler/testData/cli/js/inlineCycle.args @@ -1,4 +1,5 @@ $TESTDATA_DIR$/inlineCycle.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TEMP_DIR$ diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 1289059a17f..682e400eeb3 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -44,6 +44,8 @@ where advanced options include: -Xrepositories= Paths to additional places where libraries could be found -Xstrict-implicit-export-types Generate strict types for implicitly exported entities inside d.ts files. Available in IR backend only. -Xtyped-arrays Translate primitive arrays to JS typed arrays + -Xuse-deprecated-legacy-compiler + Use deprecated legacy compiler without error -Xwasm Use experimental WebAssembly compiler backend -Xwasm-debug-info Add debug info to WebAssembly compiled module -Xwasm-enable-array-range-checks diff --git a/compiler/testData/cli/js/kotlinHomeWithoutStdlib.args b/compiler/testData/cli/js/kotlinHomeWithoutStdlib.args index 555a76a6af9..36dd10cca56 100644 --- a/compiler/testData/cli/js/kotlinHomeWithoutStdlib.args +++ b/compiler/testData/cli/js/kotlinHomeWithoutStdlib.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/simple2js.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -kotlin-home $TESTDATA_DIR$ -output diff --git a/compiler/testData/cli/js/kotlinPackage.args b/compiler/testData/cli/js/kotlinPackage.args index 987f95c63ef..be415b25371 100644 --- a/compiler/testData/cli/js/kotlinPackage.args +++ b/compiler/testData/cli/js/kotlinPackage.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/../kotlinPackage.kt -no-stdlib -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/languageVersion.args b/compiler/testData/cli/js/languageVersion.args index ee57c805a18..ac1e6d04160 100644 --- a/compiler/testData/cli/js/languageVersion.args +++ b/compiler/testData/cli/js/languageVersion.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/languageVersion.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TEMP_DIR$/out.js -language-version diff --git a/compiler/testData/cli/js/libraryDirNotFound.args b/compiler/testData/cli/js/libraryDirNotFound.args index 7b39c5bf84e..edadc3eee43 100644 --- a/compiler/testData/cli/js/libraryDirNotFound.args +++ b/compiler/testData/cli/js/libraryDirNotFound.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/withLib.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries not/existing/path -output diff --git a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args b/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args index a572b3504b8..bffd279d1fb 100644 --- a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args +++ b/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/separateModules/sepModule1.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -meta-info -Xmetadata-only -output @@ -7,6 +8,7 @@ $TEMP_DIR$/m1/m1.js --- $TESTDATA_DIR$/separateModules/sepModule2.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries $TEMP_DIR$/m1 -output diff --git a/compiler/testData/cli/js/modulesWithSameNames.args b/compiler/testData/cli/js/modulesWithSameNames.args index 56d77c91678..7efa61145e1 100644 --- a/compiler/testData/cli/js/modulesWithSameNames.args +++ b/compiler/testData/cli/js/modulesWithSameNames.args @@ -1,11 +1,13 @@ $TESTDATA_DIR$/separateModules/sepModule1.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -meta-info -output $TEMP_DIR$/m1/m.js --- $TESTDATA_DIR$/separateModules/sepModule2.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries $TEMP_DIR$/m1 -output diff --git a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.args b/compiler/testData/cli/js/modulesWithSameNamesAndFunc.args index d4d8c711cd2..150e28ff835 100644 --- a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.args +++ b/compiler/testData/cli/js/modulesWithSameNamesAndFunc.args @@ -1,11 +1,13 @@ $TESTDATA_DIR$/separateModules/sepModule3.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -meta-info -output $TEMP_DIR$/m3/m.js --- $TESTDATA_DIR$/separateModules/sepModule4.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries $TEMP_DIR$/m3 -output diff --git a/compiler/testData/cli/js/nonExistingSourcePath.args b/compiler/testData/cli/js/nonExistingSourcePath.args index d4635be86c4..e18069728bd 100644 --- a/compiler/testData/cli/js/nonExistingSourcePath.args +++ b/compiler/testData/cli/js/nonExistingSourcePath.args @@ -1,5 +1,6 @@ not/existing/path -no-stdlib -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TESTDATA_DIR$ diff --git a/compiler/testData/cli/js/notValidLibraryDir.args b/compiler/testData/cli/js/notValidLibraryDir.args index 7578950b9d7..8534ac566b4 100644 --- a/compiler/testData/cli/js/notValidLibraryDir.args +++ b/compiler/testData/cli/js/notValidLibraryDir.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/withLib.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib -output diff --git a/compiler/testData/cli/js/outputIsDirectory.args b/compiler/testData/cli/js/outputIsDirectory.args index 1a7d4dfd02c..38fc6f0ec78 100644 --- a/compiler/testData/cli/js/outputIsDirectory.args +++ b/compiler/testData/cli/js/outputIsDirectory.args @@ -1,4 +1,5 @@ $TESTDATA_DIR$/simple2js.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TESTDATA_DIR$ diff --git a/compiler/testData/cli/js/outputPostfixFileNotFound.args b/compiler/testData/cli/js/outputPostfixFileNotFound.args index e6c3b7cdc93..0aa8a305f9d 100644 --- a/compiler/testData/cli/js/outputPostfixFileNotFound.args +++ b/compiler/testData/cli/js/outputPostfixFileNotFound.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/simple2js.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TEMP_DIR$/out.js -output-postfix diff --git a/compiler/testData/cli/js/outputPrefixFileNotFound.args b/compiler/testData/cli/js/outputPrefixFileNotFound.args index 2947f518648..fb740922dfa 100644 --- a/compiler/testData/cli/js/outputPrefixFileNotFound.args +++ b/compiler/testData/cli/js/outputPrefixFileNotFound.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/simple2js.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TEMP_DIR$/out.js -output-prefix diff --git a/compiler/testData/cli/js/reifiedIntersectionType.args b/compiler/testData/cli/js/reifiedIntersectionType.args index 48c15789d5b..b2d6e25bd66 100644 --- a/compiler/testData/cli/js/reifiedIntersectionType.args +++ b/compiler/testData/cli/js/reifiedIntersectionType.args @@ -1,4 +1,5 @@ $TESTDATA_DIR$/reifiedIntersectionType.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/simple2js.args b/compiler/testData/cli/js/simple2js.args index 4608f238770..0eab61ab710 100644 --- a/compiler/testData/cli/js/simple2js.args +++ b/compiler/testData/cli/js/simple2js.args @@ -1,4 +1,5 @@ $TESTDATA_DIR$/simple2js.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -output $TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/sourceMap.args b/compiler/testData/cli/js/sourceMap.args index b08c86ea98f..ec092740ea7 100644 --- a/compiler/testData/cli/js/sourceMap.args +++ b/compiler/testData/cli/js/sourceMap.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/sourceMap.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-prefix ./ diff --git a/compiler/testData/cli/js/sourceMapCharEscape.args b/compiler/testData/cli/js/sourceMapCharEscape.args index b58ce29f8d4..a171c1bd6fa 100644 --- a/compiler/testData/cli/js/sourceMapCharEscape.args +++ b/compiler/testData/cli/js/sourceMapCharEscape.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/sourceMapCharEscape.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-embed-sources always diff --git a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args index 086c8e02a8b..f6195f0fe60 100644 --- a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args +++ b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/sourceMapDuplicatePath/ -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-base-dirs $TESTDATA_DIR$/sourceMapDuplicatePath/foo:$TESTDATA_DIR$/sourceMapDuplicatePath/bar diff --git a/compiler/testData/cli/js/sourceMapEmbedSources.args b/compiler/testData/cli/js/sourceMapEmbedSources.args index 86af64ebe9b..bcc4b60506d 100644 --- a/compiler/testData/cli/js/sourceMapEmbedSources.args +++ b/compiler/testData/cli/js/sourceMapEmbedSources.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/sourceMap.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-prefix ./ diff --git a/compiler/testData/cli/js/sourceMapPrefix.args b/compiler/testData/cli/js/sourceMapPrefix.args index 552970e41a4..eb23d435bd9 100644 --- a/compiler/testData/cli/js/sourceMapPrefix.args +++ b/compiler/testData/cli/js/sourceMapPrefix.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/sourceMap.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-prefix /localhost/src/ diff --git a/compiler/testData/cli/js/sourceMapRelativeRoot.args b/compiler/testData/cli/js/sourceMapRelativeRoot.args index 23bdf66536b..3f383748ec7 100644 --- a/compiler/testData/cli/js/sourceMapRelativeRoot.args +++ b/compiler/testData/cli/js/sourceMapRelativeRoot.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/sourceMapRelativeRoot/lib/src/lib.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -meta-info -output @@ -7,6 +8,7 @@ $TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/lib.js --- $TESTDATA_DIR$/sourceMapRelativeRoot/main/src/main.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries $TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/ -source-map diff --git a/compiler/testData/cli/js/sourceMapRootAuto.args b/compiler/testData/cli/js/sourceMapRootAuto.args index c095764d70a..dcffe36c7b5 100644 --- a/compiler/testData/cli/js/sourceMapRootAuto.args +++ b/compiler/testData/cli/js/sourceMapRootAuto.args @@ -1,6 +1,7 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-prefix ./ diff --git a/compiler/testData/cli/js/sourceMapRootManual.args b/compiler/testData/cli/js/sourceMapRootManual.args index dd7ae4f4d91..707ae2851e7 100644 --- a/compiler/testData/cli/js/sourceMapRootManual.args +++ b/compiler/testData/cli/js/sourceMapRootManual.args @@ -1,6 +1,7 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-base-dirs $TESTDATA_DIR$/ diff --git a/compiler/testData/cli/js/sourceMapRootMissing.args b/compiler/testData/cli/js/sourceMapRootMissing.args index a2b9e9da478..64efc435f8f 100644 --- a/compiler/testData/cli/js/sourceMapRootMissing.args +++ b/compiler/testData/cli/js/sourceMapRootMissing.args @@ -3,6 +3,7 @@ $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt $TESTDATA_DIR$/sourceMapRoot/bar/baz/file3.kt $TESTDATA_DIR$/sourceMapRoot/foo/baz/file4.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-base-dirs $TESTDATA_DIR$/sourceMapRoot/foo diff --git a/compiler/testData/cli/js/sourceMapRootMultiple.args b/compiler/testData/cli/js/sourceMapRootMultiple.args index e536251f791..6d03c00f575 100644 --- a/compiler/testData/cli/js/sourceMapRootMultiple.args +++ b/compiler/testData/cli/js/sourceMapRootMultiple.args @@ -1,6 +1,7 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -source-map -source-map-base-dirs $TESTDATA_DIR$/foo:$TESTDATA_DIR$/bar diff --git a/compiler/testData/cli/js/suppressAllWarningsJS.args b/compiler/testData/cli/js/suppressAllWarningsJS.args index fef8b326726..c6b4e4eee4a 100644 --- a/compiler/testData/cli/js/suppressAllWarningsJS.args +++ b/compiler/testData/cli/js/suppressAllWarningsJS.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/../warnings.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -nowarn -output $TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/withFolderAsLib.args b/compiler/testData/cli/js/withFolderAsLib.args index 18f5d8f1365..f9866a5043c 100644 --- a/compiler/testData/cli/js/withFolderAsLib.args +++ b/compiler/testData/cli/js/withFolderAsLib.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/withLib.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries $TESTDATA_DIR$/folderAsLib -output diff --git a/compiler/testData/cli/js/withLib.args b/compiler/testData/cli/js/withLib.args index 6e3f70e89a4..4258b05a63a 100644 --- a/compiler/testData/cli/js/withLib.args +++ b/compiler/testData/cli/js/withLib.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/withLib.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -libraries $TESTDATA_DIR$/lib/LibraryExample.jar -output diff --git a/compiler/testData/cli/js/wrongAbiVersion.args b/compiler/testData/cli/js/wrongAbiVersion.args index e4f2e0cbeef..092f08db38e 100644 --- a/compiler/testData/cli/js/wrongAbiVersion.args +++ b/compiler/testData/cli/js/wrongAbiVersion.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/simple2js.kt -Xlegacy-deprecated-no-warn +-Xuse-deprecated-legacy-compiler -no-stdlib -libraries $TESTDATA_DIR$/wrongAbiVersionLib/wrongAbiLib.meta.js diff --git a/compiler/testData/integration/ant/js/additionalArguments/build.log.expected b/compiler/testData/integration/ant/js/additionalArguments/build.log.expected index ead35ae2c62..1a08494632b 100644 --- a/compiler/testData/integration/ant/js/additionalArguments/build.log.expected +++ b/compiler/testData/integration/ant/js/additionalArguments/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/hello.kt] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/additionalArguments/build.xml b/compiler/testData/integration/ant/js/additionalArguments/build.xml index a1d9a6c52e8..eb2579c8464 100644 --- a/compiler/testData/integration/ant/js/additionalArguments/build.xml +++ b/compiler/testData/integration/ant/js/additionalArguments/build.xml @@ -4,6 +4,7 @@ + diff --git a/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.log.expected b/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.log.expected +++ b/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.xml b/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.xml index c5bfb5d4a65..5394734141e 100644 --- a/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.xml +++ b/compiler/testData/integration/ant/js/bothPrefixAndPostfix/build.xml @@ -5,6 +5,8 @@ + outputPostfix="${test.data}/postfix"> + + diff --git a/compiler/testData/integration/ant/js/manySources/build.log.expected b/compiler/testData/integration/ant/js/manySources/build.log.expected index 2b3c3b1acf1..0464b192c9f 100644 --- a/compiler/testData/integration/ant/js/manySources/build.log.expected +++ b/compiler/testData/integration/ant/js/manySources/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1, [TestData]/bar.kt, [TestData]/root2/Foo.kt] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/manySources/build.xml b/compiler/testData/integration/ant/js/manySources/build.xml index ca735fae0f3..07422dd6240 100644 --- a/compiler/testData/integration/ant/js/manySources/build.xml +++ b/compiler/testData/integration/ant/js/manySources/build.xml @@ -9,6 +9,7 @@ + diff --git a/compiler/testData/integration/ant/js/outputPostfix/build.log.expected b/compiler/testData/integration/ant/js/outputPostfix/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/outputPostfix/build.log.expected +++ b/compiler/testData/integration/ant/js/outputPostfix/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/outputPostfix/build.xml b/compiler/testData/integration/ant/js/outputPostfix/build.xml index 49c9baddd9c..d8fca68d8f5 100644 --- a/compiler/testData/integration/ant/js/outputPostfix/build.xml +++ b/compiler/testData/integration/ant/js/outputPostfix/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/outputPrefix/build.log.expected b/compiler/testData/integration/ant/js/outputPrefix/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/outputPrefix/build.log.expected +++ b/compiler/testData/integration/ant/js/outputPrefix/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/outputPrefix/build.xml b/compiler/testData/integration/ant/js/outputPrefix/build.xml index 467465ed93e..30b7f132c66 100644 --- a/compiler/testData/integration/ant/js/outputPrefix/build.xml +++ b/compiler/testData/integration/ant/js/outputPrefix/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/outputWithoutDirectory/build.log.expected b/compiler/testData/integration/ant/js/outputWithoutDirectory/build.log.expected index 4bbad48f8ae..2be6532b102 100644 --- a/compiler/testData/integration/ant/js/outputWithoutDirectory/build.log.expected +++ b/compiler/testData/integration/ant/js/outputWithoutDirectory/build.log.expected @@ -2,7 +2,14 @@ OUT: Buildfile: [TestData]/build.xml build: - [java] warning: legacy compiler is deprecated. Please migrate onto IR. + [java] warning: ========== + [java] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + [java] + [java] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). + [java] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. + [java] + [java] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. + [java] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/outputWithoutDirectory/build.xml b/compiler/testData/integration/ant/js/outputWithoutDirectory/build.xml index 7f34d248015..829a2afa282 100644 --- a/compiler/testData/integration/ant/js/outputWithoutDirectory/build.xml +++ b/compiler/testData/integration/ant/js/outputWithoutDirectory/build.xml @@ -6,6 +6,7 @@ + diff --git a/compiler/testData/integration/ant/js/simple/build.log.expected b/compiler/testData/integration/ant/js/simple/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/simple/build.log.expected +++ b/compiler/testData/integration/ant/js/simple/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/simple/build.xml b/compiler/testData/integration/ant/js/simple/build.xml index 9b68b598242..6f7a8bd1c04 100644 --- a/compiler/testData/integration/ant/js/simple/build.xml +++ b/compiler/testData/integration/ant/js/simple/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.log.expected b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.log.expected index cb94992394e..51002877374 100644 --- a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.log.expected @@ -4,9 +4,23 @@ Buildfile: [TestData]/build.xml build: [mkdir] Created dir: [Temp]/lib [kotlin2js] Compiling [[TestData]/jslib-example] => [[Temp]/lib/jslib-example.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [copy] Copying 2 files to [Temp] BUILD SUCCESSFUL diff --git a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.xml b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.xml index 0bb3592409e..4c3b13218c7 100644 --- a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib/build.xml @@ -5,12 +5,15 @@ - + + + + diff --git a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.log.expected b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.log.expected index e017aa87607..461c1572ff0 100644 --- a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.log.expected @@ -4,9 +4,23 @@ Buildfile: [TestData]/build.xml build: [mkdir] Created dir: [Temp]/lib [kotlin2js] Compiling [[TestData]/jslib-example] => [[Temp]/lib/jslib-example.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [copy] Copying 2 files to [Temp] [copy] Copying 1 file to [Temp] diff --git a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.xml b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.xml index 9685e785814..285ae1eeddf 100644 --- a/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLibModuleKind/build.xml @@ -5,12 +5,15 @@ - + + + + diff --git a/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.log.expected b/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.log.expected index 6abbd6c2ffa..2ba32824de3 100644 --- a/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.log.expected @@ -4,15 +4,36 @@ Buildfile: [TestData]/build.xml build: [mkdir] Created dir: [Temp]/lib [kotlin2js] Compiling [[TestData]/jslib-example1] => [[Temp]/lib/jslib-example1.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [kotlin2js] Compiling [[TestData]/jslib-example2] => [[Temp]/lib/jslib-example2.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [delete] Deleting: [Temp]/lib/jslib-example1.js [delete] Deleting: [Temp]/lib/jslib-example2.js [delete] Deleting: [Temp]/lib/jslib-example1.meta.js [delete] Deleting: [Temp]/lib/jslib-example2.meta.js [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [copy] Copying 1 file to [Temp] BUILD SUCCESSFUL diff --git a/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.xml b/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.xml index 7a36adb0f87..67b1089d9ea 100644 --- a/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithJsFilesWithTwoModulesAsLibrary/build.xml @@ -6,11 +6,14 @@ - + + + + @@ -29,6 +32,7 @@ + diff --git a/compiler/testData/integration/ant/js/simpleWithMain/build.log.expected b/compiler/testData/integration/ant/js/simpleWithMain/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/simpleWithMain/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithMain/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/simpleWithMain/build.xml b/compiler/testData/integration/ant/js/simpleWithMain/build.xml index 9b68b598242..6f7a8bd1c04 100644 --- a/compiler/testData/integration/ant/js/simpleWithMain/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithMain/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.log.expected b/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.xml b/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.xml index 9b68b598242..6f7a8bd1c04 100644 --- a/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithMainFQArgs/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.log.expected b/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.log.expected index 09006538e10..4c4067a7c85 100644 --- a/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.log.expected @@ -4,11 +4,32 @@ Buildfile: [TestData]/build.xml build: [mkdir] Created dir: [Temp]/lib [kotlin2js] Compiling [[TestData]/jslib-example1] => [[Temp]/lib/jslib-example1.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [kotlin2js] Compiling [[TestData]/jslib-example2] => [[Temp]/lib/jslib-example2.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [copy] Copying 4 files to [Temp] BUILD SUCCESSFUL diff --git a/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.xml b/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.xml index 18d9611ebb3..9bb1f305b0e 100644 --- a/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithTwoJsFilesAsLibraries/build.xml @@ -6,11 +6,14 @@ - + + + + @@ -18,6 +21,7 @@ + diff --git a/compiler/testData/integration/ant/js/simpleWithVarargMain/build.log.expected b/compiler/testData/integration/ant/js/simpleWithVarargMain/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/simpleWithVarargMain/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithVarargMain/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/simpleWithVarargMain/build.xml b/compiler/testData/integration/ant/js/simpleWithVarargMain/build.xml index 9b68b598242..6f7a8bd1c04 100644 --- a/compiler/testData/integration/ant/js/simpleWithVarargMain/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithVarargMain/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.log.expected b/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.xml b/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.xml index 3b3e641684b..43edff5572e 100644 --- a/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithoutStdlib/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.log.expected b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.log.expected index cb94992394e..51002877374 100644 --- a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.log.expected @@ -4,9 +4,23 @@ Buildfile: [TestData]/build.xml build: [mkdir] Created dir: [Temp]/lib [kotlin2js] Compiling [[TestData]/jslib-example] => [[Temp]/lib/jslib-example.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [copy] Copying 2 files to [Temp] BUILD SUCCESSFUL diff --git a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.xml b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.xml index c4a0e7cf67e..fbd93544c1c 100644 --- a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/build.xml @@ -5,12 +5,15 @@ - + + + + diff --git a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.log.expected b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.log.expected index cb94992394e..51002877374 100644 --- a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.log.expected +++ b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.log.expected @@ -4,9 +4,23 @@ Buildfile: [TestData]/build.xml build: [mkdir] Created dir: [Temp]/lib [kotlin2js] Compiling [[TestData]/jslib-example] => [[Temp]/lib/jslib-example.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== [copy] Copying 2 files to [Temp] BUILD SUCCESSFUL diff --git a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.xml b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.xml index 66bd81e13a9..4f18e667a1c 100644 --- a/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.xml +++ b/compiler/testData/integration/ant/js/simpleWithoutStdlibAndJsFileAsAnotherLib/build.xml @@ -5,12 +5,15 @@ - + + + + diff --git a/compiler/testData/integration/ant/js/sourceMap/build.log.expected b/compiler/testData/integration/ant/js/sourceMap/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/sourceMap/build.log.expected +++ b/compiler/testData/integration/ant/js/sourceMap/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/sourceMap/build.xml b/compiler/testData/integration/ant/js/sourceMap/build.xml index db65f7629fc..51dc90431c5 100644 --- a/compiler/testData/integration/ant/js/sourceMap/build.xml +++ b/compiler/testData/integration/ant/js/sourceMap/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/suppressWarnings/build.log.expected b/compiler/testData/integration/ant/js/suppressWarnings/build.log.expected index f6bc69cd6b6..9f06d710e6d 100644 --- a/compiler/testData/integration/ant/js/suppressWarnings/build.log.expected +++ b/compiler/testData/integration/ant/js/suppressWarnings/build.log.expected @@ -3,7 +3,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/suppressWarnings/build.xml b/compiler/testData/integration/ant/js/suppressWarnings/build.xml index 99654710f06..0fb13a8dd19 100644 --- a/compiler/testData/integration/ant/js/suppressWarnings/build.xml +++ b/compiler/testData/integration/ant/js/suppressWarnings/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/verbose/build.log.expected b/compiler/testData/integration/ant/js/verbose/build.log.expected index 26a2dc4e6fa..0f7ab7a4724 100644 --- a/compiler/testData/integration/ant/js/verbose/build.log.expected +++ b/compiler/testData/integration/ant/js/verbose/build.log.expected @@ -6,7 +6,14 @@ build: [kotlin2js] logging: using Kotlin home directory [KotlinProjectHome]/dist/kotlinc [kotlin2js] logging: exception on loading scripting plugin: java.lang.ClassNotFoundException: org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar [kotlin2js] logging: compiling source files: [TestData]/root1/foo.kt -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/verbose/build.xml b/compiler/testData/integration/ant/js/verbose/build.xml index 923ad4e360e..432bc4181e2 100644 --- a/compiler/testData/integration/ant/js/verbose/build.xml +++ b/compiler/testData/integration/ant/js/verbose/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/integration/ant/js/version/build.log.expected b/compiler/testData/integration/ant/js/version/build.log.expected index 4e16aeb8dde..b181c43df7f 100644 --- a/compiler/testData/integration/ant/js/version/build.log.expected +++ b/compiler/testData/integration/ant/js/version/build.log.expected @@ -4,7 +4,14 @@ Buildfile: [TestData]/build.xml build: [kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js] [kotlin2js] info: kotlinc-js [KotlinVersion] (JRE [JREVersion]) -[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR. +[kotlin2js] warning: ========== +[kotlin2js] This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. +[kotlin2js] +[kotlin2js] Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +[kotlin2js] Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. +[kotlin2js] +[kotlin2js] You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +[kotlin2js] ========== BUILD SUCCESSFUL Total time: [time] diff --git a/compiler/testData/integration/ant/js/version/build.xml b/compiler/testData/integration/ant/js/version/build.xml index 5b2c05bedc5..3915a0de254 100644 --- a/compiler/testData/integration/ant/js/version/build.xml +++ b/compiler/testData/integration/ant/js/version/build.xml @@ -2,6 +2,8 @@ - + + + diff --git a/compiler/testData/multiplatform/contracts/output.txt b/compiler/testData/multiplatform/contracts/output.txt index e504cd465c4..44acb8b1b07 100644 --- a/compiler/testData/multiplatform/contracts/output.txt +++ b/compiler/testData/multiplatform/contracts/output.txt @@ -9,4 +9,11 @@ Output: -- JS -- Exit code: OK Output: -warning: legacy compiler is deprecated. Please migrate onto IR. +warning: ========== +This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + +Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. + +You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +========== diff --git a/compiler/testData/multiplatform/funInterfaces/output.txt b/compiler/testData/multiplatform/funInterfaces/output.txt index e504cd465c4..44acb8b1b07 100644 --- a/compiler/testData/multiplatform/funInterfaces/output.txt +++ b/compiler/testData/multiplatform/funInterfaces/output.txt @@ -9,4 +9,11 @@ Output: -- JS -- Exit code: OK Output: -warning: legacy compiler is deprecated. Please migrate onto IR. +warning: ========== +This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + +Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. + +You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +========== diff --git a/compiler/testData/multiplatform/inlineClasses/output.txt b/compiler/testData/multiplatform/inlineClasses/output.txt index ec6d87e8a5d..12b24a3c7f3 100644 --- a/compiler/testData/multiplatform/inlineClasses/output.txt +++ b/compiler/testData/multiplatform/inlineClasses/output.txt @@ -21,7 +21,14 @@ actual class Foo2 actual constructor(actual val y: String) -- JS -- Exit code: COMPILATION_ERROR Output: -warning: legacy compiler is deprecated. Please migrate onto IR. +warning: ========== +This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + +Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. + +You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +========== compiler/testData/multiplatform/inlineClasses/js.kt:5:1: error: actual class 'Foo2' has no corresponding expected declaration The following declaration is incompatible because modifiers are different (companion, inner, inline): public final expect inline class Foo2 diff --git a/compiler/testData/multiplatform/jsNameClash/output.txt b/compiler/testData/multiplatform/jsNameClash/output.txt index 0faa4fa6893..7c8ca5ce112 100644 --- a/compiler/testData/multiplatform/jsNameClash/output.txt +++ b/compiler/testData/multiplatform/jsNameClash/output.txt @@ -5,4 +5,11 @@ Output: -- JS -- Exit code: OK Output: -warning: legacy compiler is deprecated. Please migrate onto IR. +warning: ========== +This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + +Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. + +You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +========== diff --git a/compiler/testData/multiplatform/optionalExpectation/output.txt b/compiler/testData/multiplatform/optionalExpectation/output.txt index e504cd465c4..44acb8b1b07 100644 --- a/compiler/testData/multiplatform/optionalExpectation/output.txt +++ b/compiler/testData/multiplatform/optionalExpectation/output.txt @@ -9,4 +9,11 @@ Output: -- JS -- Exit code: OK Output: -warning: legacy compiler is deprecated. Please migrate onto IR. +warning: ========== +This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + +Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. + +You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +========== diff --git a/compiler/testData/multiplatform/simple/output.txt b/compiler/testData/multiplatform/simple/output.txt index e504cd465c4..44acb8b1b07 100644 --- a/compiler/testData/multiplatform/simple/output.txt +++ b/compiler/testData/multiplatform/simple/output.txt @@ -9,4 +9,11 @@ Output: -- JS -- Exit code: OK Output: -warning: legacy compiler is deprecated. Please migrate onto IR. +warning: ========== +This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + +Please migrate your project to the new IR-based compiler (https://kotl.in/jsir). +Because your build tool will not support the new Kotlin/JS compiler, you will also need to migrate to Gradle. + +You can continue to use the deprecated legacy compiler in the current version of the toolchain by providing the compiler option -Xuse-deprecated-legacy-compiler. +========== diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt index a90c9c540dc..05c145d94a1 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt @@ -163,6 +163,7 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() { args.add(classpath.joinToString(File.pathSeparator)) } args.add("-Xlegacy-deprecated-no-warn") + args.add("-Xuse-deprecated-legacy-compiler") args.add("-output") args.add(output.path) args.add("-meta-info") diff --git a/compiler/tests/org/jetbrains/kotlin/cli/AnalysisHandlerExtensionTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/AnalysisHandlerExtensionTest.kt index ad4ddd536f7..484e97479a3 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/AnalysisHandlerExtensionTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/AnalysisHandlerExtensionTest.kt @@ -67,7 +67,7 @@ class AnalysisHandlerExtensionTest : TestCaseWithTmpdir() { val plugin = writePlugin(klass) val args = listOf("-Xplugin=$plugin", mainKt.absolutePath) val outputPath = if (compiler is K2JSCompiler) - listOf("-output", tmpdir.resolve("out.js").absolutePath) + listOf("-Xuse-deprecated-legacy-compiler", "-output", tmpdir.resolve("out.js").absolutePath) else listOf("-d", tmpdir.resolve("out").absolutePath) val (output, exitCode) = CompilerTestUtil.executeCompiler(compiler, args + outputPath + extras) diff --git a/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt index 6ab5dd51d7d..3e46ef39079 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt @@ -141,7 +141,7 @@ class LauncherScriptTest : TestCaseWithTmpdir() { runProcess( "kotlinc-js", "$testDataDirectory/emptyMain.kt", - "-Xlegacy-deprecated-no-warn", "-output", File(tmpdir, "out.js").path + "-Xlegacy-deprecated-no-warn", "-Xuse-deprecated-legacy-compiler", "-output", File(tmpdir, "out.js").path ) } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt index 5842cd0dcc4..29d3ea1d63e 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt @@ -122,7 +122,10 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration val result = when (compiler) { - is K2JSCompiler -> compileJsLibrary(libraryName, additionalOptions = libraryOptions + "-Xlegacy-deprecated-no-warn") + is K2JSCompiler -> compileJsLibrary( + libraryName, + additionalOptions = libraryOptions + "-Xlegacy-deprecated-no-warn" + "-Xuse-deprecated-legacy-compiler" + ) is K2JVMCompiler -> compileLibrary(libraryName, additionalOptions = libraryOptions) else -> throw UnsupportedOperationException(compiler.toString()) } diff --git a/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt b/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt index 566cca7ffcf..5d04115949f 100644 --- a/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt @@ -65,7 +65,7 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() { if (jsSrc != null) { appendLine() appendLine("-- JS --") - appendLine(K2JSCompiler().compile(jsSrc, commonSrc, "-output", jsDest!!)) + appendLine(K2JSCompiler().compile(jsSrc, commonSrc, "-Xuse-deprecated-legacy-compiler", "-output", jsDest!!)) } if (common2Src != null) { diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/GenerateJpsPluginTests.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/GenerateJpsPluginTests.kt index 2b33507af44..aa5de4fc8a9 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/GenerateJpsPluginTests.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/GenerateJpsPluginTests.kt @@ -32,10 +32,6 @@ fun main(args: Array) { ) } - testClass { - model("incremental/multiModule/common", extension = null, excludeParentDirs = true) - } - testClass { model( "incremental/multiModule/multiplatform/withGeneratedContent", extension = null, excludeParentDirs = true, diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJsJpsTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJsJpsTest.kt deleted file mode 100644 index 743b0aee3f9..00000000000 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJsJpsTest.kt +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.jps.build - -import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments -import org.jetbrains.kotlin.config.KotlinFacetSettings -import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder -import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder.Companion.JS_JPS_LOG -import org.jetbrains.kotlin.jps.model.JpsKotlinFacetModuleExtension -import org.jetbrains.kotlin.platform.js.JsPlatforms -import java.io.File - -abstract class AbstractIncrementalJsJpsTest : AbstractIncrementalJpsTest() { - override val buildLogFinder: BuildLogFinder - get() = super.buildLogFinder.copy(isJsEnabled = true) - - override fun doTest(testDataPath: String) { - val buildLogFile = File(testDataPath).resolve(JS_JPS_LOG) - if (!buildLogFile.exists()) { - buildLogFile.writeText("JPS JS LOG PLACEHOLDER") - } - super.doTest(testDataPath) - } - - override fun overrideModuleSettings() { - myProject.modules.forEach { - val facet = KotlinFacetSettings() - facet.compilerArguments = K2JSCompilerArguments() - facet.targetPlatform = JsPlatforms.defaultJsPlatform - - it.container.setChild( - JpsKotlinFacetModuleExtension.KIND, - JpsKotlinFacetModuleExtension(facet) - ) - } - } -} diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt index 0918cea5579..220998de4e4 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt @@ -167,6 +167,7 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() { libraries = libPaths.joinToString(File.pathSeparator) reportOutputFiles = true freeArgs = filesToCompile.map { it.canonicalPath } + useDeprecatedLegacyCompiler = true } configureAdditionalArgs(args) return runJSCompiler(args, env) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJsJpsTestGenerated.java b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJsJpsTestGenerated.java deleted file mode 100644 index 42ff1aeb8cd..00000000000 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJsJpsTestGenerated.java +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.jps.build; - -import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; -import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; - -import java.io.File; -import java.util.regex.Pattern; - -/** This class is generated by {@link org.jetbrains.kotlin.jps.GenerateJpsPluginTestsKt}. DO NOT MODIFY MANUALLY */ -@SuppressWarnings("all") -@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common") -@TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class IncrementalJsJpsTestGenerated extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInCommon() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common"), Pattern.compile("^([^\\.]+)$"), null, true); - } - - @TestMetadata("classAdded") - public void testClassAdded() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/classAdded/"); - } - - @TestMetadata("classRemoved") - public void testClassRemoved() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/classRemoved/"); - } - - @TestMetadata("constantValueChanged") - public void testConstantValueChanged() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/constantValueChanged/"); - } - - @TestMetadata("copyFileToAnotherModule") - public void testCopyFileToAnotherModule() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule/"); - } - - @TestMetadata("defaultArgumentInConstructorRemoved") - public void testDefaultArgumentInConstructorRemoved() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved/"); - } - - @TestMetadata("defaultParameterAdded") - public void testDefaultParameterAdded() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded/"); - } - - @TestMetadata("defaultParameterAddedForTopLevelFun") - public void testDefaultParameterAddedForTopLevelFun() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun/"); - } - - @TestMetadata("defaultParameterRemoved") - public void testDefaultParameterRemoved() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved/"); - } - - @TestMetadata("defaultParameterRemovedForTopLevelFun") - public void testDefaultParameterRemovedForTopLevelFun() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun/"); - } - - @TestMetadata("defaultValueInConstructorRemoved") - public void testDefaultValueInConstructorRemoved() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved/"); - } - - @TestMetadata("duplicatedClass") - public void testDuplicatedClass() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/duplicatedClass/"); - } - - @TestMetadata("exportedDependency") - public void testExportedDependency() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/exportedDependency/"); - } - - @TestMetadata("functionFromDifferentPackageChanged") - public void testFunctionFromDifferentPackageChanged() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged/"); - } - - @TestMetadata("inlineFunctionInlined") - public void testInlineFunctionInlined() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined/"); - } - - @TestMetadata("inlineFunctionTwoPackageParts") - public void testInlineFunctionTwoPackageParts() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts/"); - } - - @TestMetadata("moveFileToAnotherModule") - public void testMoveFileToAnotherModule() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule/"); - } - - @TestMetadata("simple") - public void testSimple() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/simple/"); - } - - @TestMetadata("simpleDependency") - public void testSimpleDependency() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependency/"); - } - - @TestMetadata("simpleDependencyErrorOnAccessToInternal1") - public void testSimpleDependencyErrorOnAccessToInternal1() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1/"); - } - - @TestMetadata("simpleDependencyErrorOnAccessToInternal2") - public void testSimpleDependencyErrorOnAccessToInternal2() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2/"); - } - - @TestMetadata("simpleDependencyUnchanged") - public void testSimpleDependencyUnchanged() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged/"); - } - - @TestMetadata("transitiveDependency") - public void testTransitiveDependency() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/transitiveDependency/"); - } - - @TestMetadata("transitiveInlining") - public void testTransitiveInlining() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/transitiveInlining/"); - } - - @TestMetadata("twoDependants") - public void testTwoDependants() throws Exception { - runTest("jps/jps-plugin/testData/incremental/multiModule/common/twoDependants/"); - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/classAdded") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ClassAdded extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInClassAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/classAdded"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/classRemoved") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ClassRemoved extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInClassRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/constantValueChanged") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantValueChanged extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInConstantValueChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/constantValueChanged"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CopyFileToAnotherModule extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInCopyFileToAnotherModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultArgumentInConstructorRemoved extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDefaultArgumentInConstructorRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultParameterAdded extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDefaultParameterAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultParameterAddedForTopLevelFun extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDefaultParameterAddedForTopLevelFun() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultParameterRemoved extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDefaultParameterRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultParameterRemovedForTopLevelFun extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDefaultParameterRemovedForTopLevelFun() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultValueInConstructorRemoved extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDefaultValueInConstructorRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/duplicatedClass") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DuplicatedClass extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInDuplicatedClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/duplicatedClass"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/exportedDependency") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ExportedDependency extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInExportedDependency() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/exportedDependency"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FunctionFromDifferentPackageChanged extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInFunctionFromDifferentPackageChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineFunctionInlined extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInInlineFunctionInlined() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineFunctionTwoPackageParts extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInInlineFunctionTwoPackageParts() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MoveFileToAnotherModule extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInMoveFileToAnotherModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simple") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Simple extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSimple() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simple"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependency") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SimpleDependency extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSimpleDependency() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependency"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SimpleDependencyErrorOnAccessToInternal1 extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal1() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SimpleDependencyErrorOnAccessToInternal2 extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal2() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SimpleDependencyUnchanged extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInSimpleDependencyUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/transitiveDependency") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TransitiveDependency extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInTransitiveDependency() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/transitiveDependency"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/transitiveInlining") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TransitiveInlining extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInTransitiveInlining() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/transitiveInlining"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } - - @TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/twoDependants") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TwoDependants extends AbstractIncrementalJsJpsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInTwoDependants() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/twoDependants"), Pattern.compile("^([^\\.]+)$"), null, true); - } - } -} diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt index c8549f4d3a4..662818ed4cc 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt @@ -78,8 +78,6 @@ import java.util.zip.ZipOutputStream open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { companion object { - private const val ADDITIONAL_MODULE_NAME = "module2" - private val EXCLUDE_FILES = arrayOf("Excluded.class", "YetAnotherExcluded.class") private val NOTHING = arrayOf() private const val KOTLIN_JS_LIBRARY = "jslib-example" @@ -119,13 +117,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { buildAllModules().assertSuccessful() } - protected fun doTestWithKotlinJavaScriptLibrary() { - initProject(JS_STDLIB) - createKotlinJavaScriptLibraryArchive() - addDependency(KOTLIN_JS_LIBRARY, File(workDir, KOTLIN_JS_LIBRARY_JAR)) - buildAllModules().assertSuccessful() - } - fun testKotlinProject() { doTest() @@ -150,14 +141,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { buildAllModules().assertSuccessful() } - fun testKotlinJavaScriptProject() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - - checkOutputFilesList() - checkWhen(touch("src/test1.kt"), null, pathsToDelete = k2jsOutput(PROJECT_NAME)) - } - private fun k2jsOutput(vararg moduleNames: String): Array { val moduleNamesSet = moduleNames.toSet() val list = mutableListOf() @@ -177,54 +160,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { return list.toTypedArray() } - fun testKotlinJavaScriptProjectNewSourceRootTypes() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - - checkOutputFilesList() - } - - fun testKotlinJavaScriptProjectWithCustomOutputPaths() { - initProject(JS_STDLIB_WITHOUT_FACET) - buildAllModules().assertSuccessful() - - checkOutputFilesList(File(workDir, "target")) - } - - fun testKotlinJavaScriptProjectWithSourceMap() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - - val sourceMapContent = File(getOutputDir(PROJECT_NAME), "$PROJECT_NAME.js.map").readText() - val expectedPath = "prefix-dir/src/pkg/test1.kt" - assertTrue("Source map file should contain relative path ($expectedPath)", sourceMapContent.contains("\"$expectedPath\"")) - - val librarySourceMapFile = File(getOutputDir(PROJECT_NAME), "lib/kotlin.js.map") - assertTrue("Source map for stdlib should be copied to $librarySourceMapFile", librarySourceMapFile.exists()) - } - - fun testKotlinJavaScriptProjectWithSourceMapRelativePaths() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - - val sourceMapContent = File(getOutputDir(PROJECT_NAME), "$PROJECT_NAME.js.map").readText() - val expectedPath = "../../../src/pkg/test1.kt" - assertTrue("Source map file should contain relative path ($expectedPath)", sourceMapContent.contains("\"$expectedPath\"")) - - val librarySourceMapFile = File(getOutputDir(PROJECT_NAME), "lib/kotlin.js.map") - assertTrue("Source map for stdlib should be copied to $librarySourceMapFile", librarySourceMapFile.exists()) - } - - fun testKotlinJavaScriptProjectWithTwoModules() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - - checkOutputFilesList() - checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)) - checkWhen(touch("module2/src/module2.kt"), null, k2jsOutput(ADDITIONAL_MODULE_NAME)) - checkWhen(arrayOf(touch("src/test1.kt"), touch("module2/src/module2.kt")), null, k2jsOutput(PROJECT_NAME, ADDITIONAL_MODULE_NAME)) - } - @WorkingDir("KotlinJavaScriptProjectWithTwoModules") fun testKotlinJavaScriptProjectWithTwoModulesAndWithLibrary() { initProject() @@ -234,84 +169,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { buildAllModules().assertSuccessful() } - fun testKotlinJavaScriptProjectWithDirectoryAsStdlib() { - initProject() - setupKotlinJSFacet() - val jslibJar = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibJarPath - val jslibDir = File(workDir, "KotlinJavaScript") - try { - Decompressor.Zip(jslibJar).extract(jslibDir) - } - catch (ex: IOException) { - throw IllegalStateException(ex.message) - } - - addDependency("KotlinJavaScript", jslibDir) - buildAllModules().assertSuccessful() - - checkOutputFilesList() - checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)) - } - - fun testKotlinJavaScriptProjectWithDirectoryAsLibrary() { - initProject(JS_STDLIB) - addDependency(KOTLIN_JS_LIBRARY, File(workDir, KOTLIN_JS_LIBRARY)) - buildAllModules().assertSuccessful() - - checkOutputFilesList() - checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)) - } - - fun testKotlinJavaScriptProjectWithLibrary() { - doTestWithKotlinJavaScriptLibrary() - - checkOutputFilesList() - checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)) - } - - fun testKotlinJavaScriptProjectWithLibraryCustomOutputDir() { - doTestWithKotlinJavaScriptLibrary() - - checkOutputFilesList() - checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)) - } - - fun testKotlinJavaScriptProjectWithLibraryNoCopy() { - doTestWithKotlinJavaScriptLibrary() - - checkOutputFilesList() - checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME)) - } - - fun testKotlinJavaScriptProjectWithLibraryAndErrors() { - initProject(JS_STDLIB) - createKotlinJavaScriptLibraryArchive() - addDependency(KOTLIN_JS_LIBRARY, File(workDir, KOTLIN_JS_LIBRARY_JAR)) - buildAllModules().assertFailed() - - checkOutputFilesList() - } - - fun testKotlinJavaScriptProjectWithEmptyDependencies() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - } - - fun testKotlinJavaScriptInternalFromSpecialRelatedModule() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - } - - fun testKotlinJavaScriptProjectWithTests() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - } - - fun testKotlinJavaScriptProjectWithTestsAndSeparateTestAndSrcModuleDependencies() { - initProject(JS_STDLIB) - buildAllModules().assertSuccessful() - } - fun testExcludeFolderInSourceRoot() { doTest() diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt index dcb8937249d..f0942ef13a3 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestBase.kt @@ -89,7 +89,9 @@ abstract class KotlinJpsBuildTestBase : AbstractKotlinJpsBuildTestCase() { protected fun setupKotlinJSFacet() { myProject.modules.forEach { val facet = KotlinFacetSettings() - facet.compilerArguments = K2JSCompilerArguments() + facet.compilerArguments = K2JSCompilerArguments().apply { + useDeprecatedLegacyCompiler = true + } facet.targetPlatform = JsPlatforms.defaultJsPlatform it.container.setChild( diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestIncremental.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestIncremental.kt index 89e1c526025..f4f8f06ee7c 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestIncremental.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTestIncremental.kt @@ -43,17 +43,6 @@ class KotlinJpsBuildTestIncremental : KotlinJpsBuildTest() { ).run() } - fun testKotlinJavaScriptChangePackage() { - initProject(LibraryDependency.JS_STDLIB) - buildAllModules().assertSuccessful() - - val class2Kt = File(workDir, "src/Class2.kt") - val newClass2KtContent = class2Kt.readText().replace("package2", "package1") - change(class2Kt.path, newClass2KtContent) - buildAllModules().assertSuccessful() - checkOutputFilesList(File(workDir, "out/production")) - } - fun testJpsDaemonIC() { fun testImpl() { assertTrue("Daemon was not enabled!", isDaemonEnabled()) diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/ModulesTxt.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/ModulesTxt.kt index eeedd28f334..0321eb0e72f 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/ModulesTxt.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/ModulesTxt.kt @@ -262,7 +262,10 @@ class ModulesTxtBuilder { "jvm" -> settings.compilerArguments = K2JVMCompilerArguments().also { settings.targetPlatform = JvmPlatforms.defaultJvmPlatform } "js" -> settings.compilerArguments = - K2JSCompilerArguments().also { settings.targetPlatform = JsPlatforms.defaultJsPlatform } + K2JSCompilerArguments().also { + settings.targetPlatform = JsPlatforms.defaultJsPlatform + it.useDeprecatedLegacyCompiler = true + } "native" -> settings.compilerArguments = FakeK2NativeCompilerArguments().also { settings.targetPlatform = NativePlatforms.unspecifiedNativePlatform } else -> { diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/AbstractJsProtoComparisonTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/AbstractJsProtoComparisonTest.kt index f796c54aa4d..772b695b488 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/AbstractJsProtoComparisonTest.kt +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/incremental/AbstractJsProtoComparisonTest.kt @@ -50,6 +50,7 @@ abstract class AbstractJsProtoComparisonTest : AbstractProtoComparisonTest js + + + -Xuse-deprecated-legacy-compiler + + test-compile diff --git a/libraries/examples/browser-example/pom.xml b/libraries/examples/browser-example/pom.xml index d0a44756a16..0fa1a2972f1 100644 --- a/libraries/examples/browser-example/pom.xml +++ b/libraries/examples/browser-example/pom.xml @@ -65,6 +65,11 @@ js + + + -Xuse-deprecated-legacy-compiler + + test-compile diff --git a/libraries/examples/js-example/pom.xml b/libraries/examples/js-example/pom.xml index 9d6e2f73b2c..bfdb7ce769a 100644 --- a/libraries/examples/js-example/pom.xml +++ b/libraries/examples/js-example/pom.xml @@ -52,6 +52,11 @@ + + + -Xuse-deprecated-legacy-compiler + + org.apache.maven.plugins diff --git a/libraries/examples/kotlin-js-library-example/pom.xml b/libraries/examples/kotlin-js-library-example/pom.xml index da8932ab4ed..130302c4556 100644 --- a/libraries/examples/kotlin-js-library-example/pom.xml +++ b/libraries/examples/kotlin-js-library-example/pom.xml @@ -57,6 +57,9 @@ ${project.build.outputDirectory}/${project.artifactId}.js + + -Xuse-deprecated-legacy-compiler + diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinProjectExtension.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinProjectExtension.kt index fcdcc198c43..10d5f105b35 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinProjectExtension.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinProjectExtension.kt @@ -11,7 +11,6 @@ import org.gradle.api.Named import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.Project import org.gradle.api.internal.plugins.DslObject -import org.gradle.api.logging.Logger import org.gradle.jvm.toolchain.JavaLanguageVersion import org.gradle.jvm.toolchain.JavaToolchainSpec import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi @@ -227,31 +226,45 @@ abstract class KotlinJsProjectExtension(project: Project) : KotlinJsCompilerType.LEGACY -> logger.warn(LEGACY_DEPRECATED) KotlinJsCompilerType.IR -> {} KotlinJsCompilerType.BOTH -> logger.warn(BOTH_DEPRECATED) - null -> throw GradleException(DEFAULT_WARN) + null -> throw GradleException(DEFAULT_COMPILER_ERROR) } } private val LEGACY_DEPRECATED = """ - The Kotlin/JS Legacy compiler backend is deprecated and will be removed in a future release. - Please migrate your project to the new IR-based compiler (https://kotl.in/jsir) - """.trimIndent() + | + |========== + |This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + | + |Please migrate the project to the new IR-based compiler (https://kotl.in/jsir). + |========== + | + """.trimMargin() private val BOTH_DEPRECATED = """ - Both mode is using the Kotlin/JS Legacy compiler backend, which is deprecated and will be removed in a future release. - Please migrate your project to the new IR-based compiler (https://kotl.in/jsir) - """.trimIndent() + | + |========== + |This project currently uses Both mode, which requires the Kotlin/JS Legacy compiler backend. + |This backend has been deprecated and will be removed in a future release. + | + |Please migrate the project to the new IR-based compiler (https://kotl.in/jsir). + |========== + | + """.trimMargin() - private val DEFAULT_WARN = + private val DEFAULT_COMPILER_ERROR = """ - The Kotlin/JS legacy compiler is no longer default. Please specify a compiler explicitly, via: - - kotlin.js.compiler=ir|legacy in your gradle.properties - - js(IR|LEGACY) { ... } in your build file. - - Note, that the legacy compiler backend is deprecated and will be removed in a future release. - Using the new IR-based compiler is recommended (https://kotl.in/jsir) - """.trimIndent() + | + |========== + |This project currently uses the Kotlin/JS Legacy compiler backend, which has been deprecated and will be removed in a future release. + |Please migrate the project to the new IR-based compiler (https://kotl.in/jsir) by adding: + |- kotlin.js.compiler=ir to your gradle.properties file. + |- js(IR) { ... } to your build file. + |You can continue to use the deprecated legacy compiler in the current version of the toolchain by specifying it explicitly. + |========== + | + """.trimMargin() } @Deprecated("Use js() instead", ReplaceWith("js()")) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt index eb8b9d1a689..ec575cb1fd3 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt @@ -1151,7 +1151,8 @@ abstract class Kotlin2JsCompile @Inject constructor( } args.friendModules = friendDependencies.files.joinToString(File.pathSeparator) { it.absolutePath } - args.legacyDeprecatedNoWarn = jsLegacyNoWarn.get() + args.legacyDeprecatedNoWarn = true + args.useDeprecatedLegacyCompiler = true logger.kotlinDebug("compiling with args ${ArgumentUtils.convertArgumentsToStringList(args)}") diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-accessToInternal/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-accessToInternal/pom.xml index 85ece630a47..a017e72db4a 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-accessToInternal/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-accessToInternal/pom.xml @@ -32,6 +32,9 @@ ${project.basedir}/customOutput/ + + -Xuse-deprecated-legacy-compiler + @@ -39,6 +42,11 @@ test-js + + + -Xuse-deprecated-legacy-compiler + + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-extraArguments/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-extraArguments/pom.xml index cd76cc78c49..5e367fe0e77 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-extraArguments/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-extraArguments/pom.xml @@ -34,6 +34,7 @@ -Xno-inline + -Xuse-deprecated-legacy-compiler diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-moduleKind/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-moduleKind/pom.xml index 35d972b074a..7b8df449217 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-moduleKind/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-moduleKind/pom.xml @@ -33,6 +33,9 @@ umd + + -Xuse-deprecated-legacy-compiler + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMap/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMap/pom.xml index 4a0ccfeddbd..ee893dccf65 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMap/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMap/pom.xml @@ -34,6 +34,9 @@ true prefixprefix/ + + -Xuse-deprecated-legacy-compiler + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMapEmbedSources/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMapEmbedSources/pom.xml index fa49124ccd4..2f77c1ca2eb 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMapEmbedSources/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-sourceMapEmbedSources/pom.xml @@ -34,6 +34,9 @@ true always + + -Xuse-deprecated-legacy-compiler + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/pom.xml index e8752b1d4d3..e55e9f34f91 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/pom.xml @@ -33,6 +33,9 @@ true + + -Xuse-deprecated-legacy-compiler + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/pom.xml index 5e8cfe0c698..df38c113861 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/pom.xml @@ -51,6 +51,9 @@ true + + -Xuse-deprecated-legacy-compiler + @@ -62,6 +65,9 @@ true + + -Xuse-deprecated-legacy-compiler + diff --git a/libraries/tools/maven-archetypes/kotlin-archetype-js/src/test/resources/projects/basic/archetype.properties b/libraries/tools/maven-archetypes/kotlin-archetype-js/src/test/resources/projects/basic/archetype.properties deleted file mode 100644 index 307d70f0126..00000000000 --- a/libraries/tools/maven-archetypes/kotlin-archetype-js/src/test/resources/projects/basic/archetype.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Nov 30 19:53:25 MSK 2015 -package=it.pkg -version=0.1-SNAPSHOT -groupId=archetype.it -artifactId=basic -kotlinVersion=${project.version} diff --git a/libraries/tools/maven-archetypes/kotlin-archetype-js/src/test/resources/projects/basic/goal.txt b/libraries/tools/maven-archetypes/kotlin-archetype-js/src/test/resources/projects/basic/goal.txt deleted file mode 100644 index 597acc76884..00000000000 --- a/libraries/tools/maven-archetypes/kotlin-archetype-js/src/test/resources/projects/basic/goal.txt +++ /dev/null @@ -1 +0,0 @@ -package \ No newline at end of file