[Gradle, JS] IR by default and report warnings for using legacy compiler

- just legacy - report warning about deprecation
- both - report warning about deprecation of legacy
- no compiler explicitly chosen - error about explicit setting compiler

warn from cli legacy compiler

nowarn flag - kotlin.js.compiler.nowarn

KT-42326
KT-53074
This commit is contained in:
Ilya Goncharov
2022-09-16 09:48:41 +00:00
committed by Space
parent b53d6d0d7e
commit bf8681296b
101 changed files with 327 additions and 245 deletions
+1
View File
@@ -1,4 +1,5 @@
compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/jslib-example/LibraryExample.kt
-Xlegacy-deprecated-no-warn
-meta-info
-output
$TEMP_DIR$/jslib-example.js
+1
View File
@@ -1,4 +1,5 @@
$TEMP_DIR$
-Xlegacy-deprecated-no-warn
-no-stdlib
-output
$TESTDATA_DIR$
+1
View File
@@ -1,3 +1,4 @@
$TESTDATA_DIR$/inlineCycle.kt
-Xlegacy-deprecated-no-warn
-output
$TEMP_DIR$
+1
View File
@@ -35,6 +35,7 @@ where advanced options include:
-Xir-safe-external-boolean Safe access via Boolean() to Boolean properties in externals to safely cast falsy values.
-Xir-safe-external-boolean-diagnostic={log|exception}
Enable runtime diagnostics when access safely to boolean in external declarations
-Xlegacy-deprecated-no-warn Disable warnings of deprecation of legacy compiler
-Xmetadata-only Generate *.meta.js and *.kjsm files only
-Xpartial-linkage Allow unlinked symbols
-Xrepositories=<path> Paths to additional places where libraries could be found
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/simple2js.kt
-Xlegacy-deprecated-no-warn
-kotlin-home
$TESTDATA_DIR$
-output
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/../kotlinPackage.kt
-no-stdlib
-Xlegacy-deprecated-no-warn
-output
$TEMP_DIR$/out.js
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/languageVersion.kt
-Xlegacy-deprecated-no-warn
-output
$TEMP_DIR$/out.js
-language-version
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/withLib.kt
-Xlegacy-deprecated-no-warn
-libraries
not/existing/path
-output
@@ -1,10 +1,12 @@
$TESTDATA_DIR$/separateModules/sepModule1.kt
-Xlegacy-deprecated-no-warn
-meta-info
-Xmetadata-only
-output
$TEMP_DIR$/m1/m1.js
---
$TESTDATA_DIR$/separateModules/sepModule2.kt
-Xlegacy-deprecated-no-warn
-libraries
$TEMP_DIR$/m1
-output
+2
View File
@@ -1,9 +1,11 @@
$TESTDATA_DIR$/separateModules/sepModule1.kt
-Xlegacy-deprecated-no-warn
-meta-info
-output
$TEMP_DIR$/m1/m.js
---
$TESTDATA_DIR$/separateModules/sepModule2.kt
-Xlegacy-deprecated-no-warn
-libraries
$TEMP_DIR$/m1
-output
@@ -1,9 +1,11 @@
$TESTDATA_DIR$/separateModules/sepModule3.kt
-Xlegacy-deprecated-no-warn
-meta-info
-output
$TEMP_DIR$/m3/m.js
---
$TESTDATA_DIR$/separateModules/sepModule4.kt
-Xlegacy-deprecated-no-warn
-libraries
$TEMP_DIR$/m3
-output
+1
View File
@@ -1,4 +1,5 @@
not/existing/path
-no-stdlib
-Xlegacy-deprecated-no-warn
-output
$TESTDATA_DIR$
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/withLib.kt
-Xlegacy-deprecated-no-warn
-libraries
compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib
-output
+1
View File
@@ -1,3 +1,4 @@
$TESTDATA_DIR$/simple2js.kt
-Xlegacy-deprecated-no-warn
-output
$TESTDATA_DIR$
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/simple2js.kt
-Xlegacy-deprecated-no-warn
-output
$TEMP_DIR$/out.js
-output-postfix
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/simple2js.kt
-Xlegacy-deprecated-no-warn
-output
$TEMP_DIR$/out.js
-output-prefix
+1
View File
@@ -1,3 +1,4 @@
$TESTDATA_DIR$/reifiedIntersectionType.kt
-Xlegacy-deprecated-no-warn
-output
$TEMP_DIR$/out.js
+1
View File
@@ -1,3 +1,4 @@
$TESTDATA_DIR$/simple2js.kt
-Xlegacy-deprecated-no-warn
-output
$TEMP_DIR$/out.js
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/sourceMap.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-prefix
./
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/sourceMapCharEscape.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-embed-sources
always
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/sourceMapDuplicatePath/
-Xlegacy-deprecated-no-warn
-source-map
-source-map-base-dirs
$TESTDATA_DIR$/sourceMapDuplicatePath/foo:$TESTDATA_DIR$/sourceMapDuplicatePath/bar
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/sourceMap.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-prefix
./
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/sourceMap.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-prefix
/localhost/src/
+2
View File
@@ -1,10 +1,12 @@
$TESTDATA_DIR$/sourceMapRelativeRoot/lib/src/lib.kt
-Xlegacy-deprecated-no-warn
-source-map
-meta-info
-output
$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/lib.js
---
$TESTDATA_DIR$/sourceMapRelativeRoot/main/src/main.kt
-Xlegacy-deprecated-no-warn
-libraries
$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/
-source-map
+1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/sourceMapRoot/foo/file1.kt
$TESTDATA_DIR$/sourceMapRoot/bar/file2.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-prefix
./
+1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/sourceMapRoot/foo/file1.kt
$TESTDATA_DIR$/sourceMapRoot/bar/file2.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-base-dirs
$TESTDATA_DIR$/
+1
View File
@@ -2,6 +2,7 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt
$TESTDATA_DIR$/sourceMapRoot/bar/file2.kt
$TESTDATA_DIR$/sourceMapRoot/bar/baz/file3.kt
$TESTDATA_DIR$/sourceMapRoot/foo/baz/file4.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-base-dirs
$TESTDATA_DIR$/sourceMapRoot/foo
+1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/sourceMapRoot/foo/file1.kt
$TESTDATA_DIR$/sourceMapRoot/bar/file2.kt
-Xlegacy-deprecated-no-warn
-source-map
-source-map-base-dirs
$TESTDATA_DIR$/foo:$TESTDATA_DIR$/bar
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/../warnings.kt
-Xlegacy-deprecated-no-warn
-nowarn
-output
$TEMP_DIR$/out.js
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/withLib.kt
-Xlegacy-deprecated-no-warn
-libraries
$TESTDATA_DIR$/folderAsLib
-output
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/withLib.kt
-Xlegacy-deprecated-no-warn
-libraries
$TESTDATA_DIR$/lib/LibraryExample.jar
-output
+1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/simple2js.kt
-Xlegacy-deprecated-no-warn
-no-stdlib
-libraries
$TESTDATA_DIR$/wrongAbiVersionLib/wrongAbiLib.meta.js
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/hello.kt] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ 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.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -2,6 +2,7 @@ OUT:
Buildfile: [TestData]/build.xml
build:
[java] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -4,7 +4,9 @@ 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] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
[copy] Copying 2 files to [Temp]
BUILD SUCCESSFUL
@@ -4,7 +4,9 @@ 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] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
[copy] Copying 2 files to [Temp]
[copy] Copying 1 file to [Temp]
@@ -4,12 +4,15 @@ 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] Compiling [[TestData]/jslib-example2] => [[Temp]/lib/jslib-example2.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
[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.
[copy] Copying 1 file to [Temp]
BUILD SUCCESSFUL
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -4,8 +4,11 @@ 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] Compiling [[TestData]/jslib-example2] => [[Temp]/lib/jslib-example2.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
[copy] Copying 4 files to [Temp]
BUILD SUCCESSFUL
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -4,7 +4,9 @@ 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] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
[copy] Copying 2 files to [Temp]
BUILD SUCCESSFUL
@@ -4,7 +4,9 @@ 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] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
[copy] Copying 2 files to [Temp]
BUILD SUCCESSFUL
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] warning: legacy compiler is deprecated. Please migrate onto IR.
BUILD SUCCESSFUL
Total time: [time]
@@ -6,6 +6,7 @@ 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.
BUILD SUCCESSFUL
Total time: [time]
@@ -4,6 +4,7 @@ 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.
BUILD SUCCESSFUL
Total time: [time]
+1
View File
@@ -9,3 +9,4 @@ Output:
-- JS --
Exit code: OK
Output:
warning: legacy compiler is deprecated. Please migrate onto IR.
@@ -9,3 +9,4 @@ Output:
-- JS --
Exit code: OK
Output:
warning: legacy compiler is deprecated. Please migrate onto IR.
@@ -21,6 +21,7 @@ actual class Foo2 actual constructor(actual val y: String)
-- JS --
Exit code: COMPILATION_ERROR
Output:
warning: legacy compiler is deprecated. Please migrate onto IR.
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
@@ -5,3 +5,4 @@ Output:
-- JS --
Exit code: OK
Output:
warning: legacy compiler is deprecated. Please migrate onto IR.
@@ -9,4 +9,4 @@ Output:
-- JS --
Exit code: OK
Output:
warning: legacy compiler is deprecated. Please migrate onto IR.
+1
View File
@@ -9,3 +9,4 @@ Output:
-- JS --
Exit code: OK
Output:
warning: legacy compiler is deprecated. Please migrate onto IR.