[CLI] Replace K2 -Xmodule by -Xfragments and -Xfragment-sources

KT-56210
This commit is contained in:
Sebastian Sellmair
2023-02-21 15:12:21 +01:00
committed by Space Team
parent 8e5b19fe96
commit 21bf497830
30 changed files with 157 additions and 92 deletions
+3 -2
View File
@@ -83,6 +83,9 @@ where advanced options include:
Use 'warning' level to issue warnings instead of errors.
-Xextended-compiler-checks Enable additional compiler checks that might provide verbose diagnostic information for certain errors.
Warning: this mode is not backward-compatible and might cause compilation errors in previously compiled code.
-Xfragment-sources=<fragment name>;<path>
Adds sources to a specific fragment of a multiplatform compilation
-Xfragments=<fragment name> Declares all known fragments of a multiplatform compilation
-Xenable-incremental-compilation
Enable incremental compilation
-Xinference-compatibility Enable compatibility changes for generic type inference algorithm
@@ -91,8 +94,6 @@ where advanced options include:
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xlist-phases List backend phases
-Xmetadata-version Change metadata version of the generated binary files
-Xmodule=<module name>;<source file[,source file...]>
Describes module with specific sources. Usage of this arguments requires to specify module for each source file from free args
-Xmulti-platform Enable experimental language support for multi-platform projects
-Xnew-inference Enable new experimental generic type inference algorithm
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
+4 -3
View File
@@ -8,8 +8,9 @@ fir-hmpp
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/../jvm/hmpp/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/../jvm/hmpp/src/b.kt
-Xmodule=c;$TESTDATA_DIR$/../jvm/hmpp/src/c.kt
-Xfragments=a,b,c
-Xfragment-sources=a;$TESTDATA_DIR$/../jvm/hmpp/src/a.kt
-Xfragment-sources=b;$TESTDATA_DIR$/../jvm/hmpp/src/b.kt
-Xfragment-sources=c;$TESTDATA_DIR$/../jvm/hmpp/src/c.kt
-Xdepends-on=b\:a
-Xdepends-on=c\:b
+3 -2
View File
@@ -189,6 +189,9 @@ where advanced options include:
Use 'warning' level to issue warnings instead of errors.
-Xextended-compiler-checks Enable additional compiler checks that might provide verbose diagnostic information for certain errors.
Warning: this mode is not backward-compatible and might cause compilation errors in previously compiled code.
-Xfragment-sources=<fragment name>;<path>
Adds sources to a specific fragment of a multiplatform compilation
-Xfragments=<fragment name> Declares all known fragments of a multiplatform compilation
-Xenable-incremental-compilation
Enable incremental compilation
-Xinference-compatibility Enable compatibility changes for generic type inference algorithm
@@ -197,8 +200,6 @@ where advanced options include:
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xlist-phases List backend phases
-Xmetadata-version Change metadata version of the generated binary files
-Xmodule=<module name>;<source file[,source file...]>
Describes module with specific sources. Usage of this arguments requires to specify module for each source file from free args
-Xmulti-platform Enable experimental language support for multi-platform projects
-Xnew-inference Enable new experimental generic type inference algorithm
-Xno-check-actual Do not check presence of 'actual' modifier in multi-platform projects
+4 -3
View File
@@ -6,9 +6,10 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/src/b.kt
-Xmodule=c;$TESTDATA_DIR$/src/c.kt
-Xfragments=a,b,c
-Xfragment-sources=a;$TESTDATA_DIR$/src/a.kt
-Xfragment-sources=b;$TESTDATA_DIR$/src/b.kt
-Xfragment-sources=c;$TESTDATA_DIR$/src/c.kt
-Xdepends-on=b\:a
-Xdepends-on=c\:b
-Xdepends-on=a\:c
+2 -1
View File
@@ -4,5 +4,6 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xfragments=a
-Xfragment-sources=a;$TESTDATA_DIR$/src/a.kt
-Xdepends-on=b\:a
@@ -8,5 +8,5 @@ as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: there are multiple modules with same name(s): a, a
error: -Xdepends-on flag can not be used without -Xfragments
COMPILATION_ERROR
+1 -1
View File
@@ -8,5 +8,5 @@ as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: -Xdepends-on flag can not be used without -Xmodule
error: -Xdepends-on flag can not be used without -Xfragments
COMPILATION_ERROR
@@ -5,4 +5,4 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;a.kt;b.kt
-Xfragments=a,a
@@ -8,7 +8,6 @@ as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: incorrect syntax for -Xmodule argument. `<module name>;<source file[,source file...]>` expected but got `a;a.kt;b.kt`
error: source '$TESTDATA_DIR$/src/a.kt' does not belong to any module
error: source '$TESTDATA_DIR$/src/b.kt' does not belong to any module
COMPILATION_ERROR
-10
View File
@@ -1,10 +0,0 @@
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/src/b.kt
-Xmodule=a;$TESTDATA_DIR$/src/c.kt
@@ -5,4 +5,5 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xfragments=a,b,c
-Xfragment-sources=a;a.kt;
@@ -0,0 +1,14 @@
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+MultiPlatformProjects
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: incorrect syntax for -Xfragment-sources argument. `<module name>;<source file>` expected but got `a;a.kt;`
error: source '$TESTDATA_DIR$/src/a.kt' does not belong to any module
error: source '$TESTDATA_DIR$/src/b.kt' does not belong to any module
COMPILATION_ERROR
@@ -4,5 +4,4 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a
-Xmodule=b;
-Xfragments=a,b
+1 -2
View File
@@ -6,6 +6,5 @@ $TEMP_DIR$
-language-version
1.9
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/src/b.kt,$TESTDATA_DIR$/src/c.kt
-Xfragments=a,b,c
-Xcommon-sources=$TESTDATA_DIR$/src/a.kt,$TESTDATA_DIR$/src/b.kt
+1 -1
View File
@@ -7,5 +7,5 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: -Xmodule flag is not supported for language version < 2.0
warning: -Xfragments flag is not supported for language version < 2.0
OK
@@ -5,6 +5,6 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/src/b.kt
-Xfragments=a,b
-Xfragment-sources=a;$TESTDATA_DIR$/src/a.kt,b;$TESTDATA_DIR$/src/b.kt
-Xdepends-on=c\:a
@@ -8,5 +8,5 @@ as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: module `c` not found in -Xmodule arguments
error: module `c` not found in -Xfragments arguments
COMPILATION_ERROR
@@ -0,0 +1,11 @@
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xfragments=a,b
-Xfragment-sources=a;$TESTDATA_DIR$/src/a.kt
-Xfragment-sources=b;$TESTDATA_DIR$/src/a.kt
-Xfragment-sources=b;$TESTDATA_DIR$/src/b.kt
@@ -8,6 +8,5 @@ as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: file '$TESTDATA_DIR$/src/a.kt' can be a part of only one module, but is listed as a source for both `a` and `b`, please check you -Xmodule options.
error: source '$TESTDATA_DIR$/src/b.kt' does not belong to any module
error: file '$TESTDATA_DIR$/src/a.kt' can be a part of only one module, but is listed as a source for both `a` and `b`, please check you -Xfragment-sources options.
COMPILATION_ERROR
@@ -5,5 +5,5 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/src/a.kt
-Xfragments=a,b
-Xfragment-sources=a;$TESTDATA_DIR$/src/a.kt
+6 -3
View File
@@ -6,8 +6,11 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/src/b.kt
-Xmodule=c;$TESTDATA_DIR$/src/c.kt
-Xfragments=a
-Xfragments=b
-Xfragments=c
-Xfragment-sources=a;$TESTDATA_DIR$/src/a.kt
-Xfragment-sources=b;$TESTDATA_DIR$/src/b.kt
-Xfragment-sources=c;$TESTDATA_DIR$/src/c.kt
-Xdepends-on=b\:a
-Xdepends-on=c\:b
@@ -0,0 +1,11 @@
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
$TESTDATA_DIR$/src/c.kt
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xfragments=a,b,c
-Xfragment-sources=a;$TESTDATA_DIR$/src/a.kt,b;$TESTDATA_DIR$/src/b.kt,c;$TESTDATA_DIR$/src/c.kt
-Xdepends-on=b\:a,c\:b
@@ -0,0 +1,11 @@
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+MultiPlatformProjects
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+4 -3
View File
@@ -6,8 +6,9 @@ $TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/../jvm/hmpp/src/a.kt
-Xmodule=b;$TESTDATA_DIR$/../jvm/hmpp/src/b.kt
-Xmodule=c;$TESTDATA_DIR$/../jvm/hmpp/src/c.kt
-Xfragments=a,b,c
-Xfragment-sources=a;$TESTDATA_DIR$/../jvm/hmpp/src/a.kt
-Xfragment-sources=b;$TESTDATA_DIR$/../jvm/hmpp/src/b.kt
-Xfragment-sources=c;$TESTDATA_DIR$/../jvm/hmpp/src/c.kt
-Xdepends-on=b\:a
-Xdepends-on=c\:b