[CLI] Add CLI arguments to pass HMPP module structure to the compiler

^KT-56209
This commit is contained in:
Dmitriy Novozhilov
2023-02-08 18:14:12 +02:00
committed by Space Team
parent ec59cc050c
commit 77caa31640
31 changed files with 504 additions and 0 deletions
+4
View File
@@ -63,6 +63,8 @@ where advanced options include:
-Xcommon-sources=<path> Sources of the common module that need to be compiled together with this module in the multi-platform mode.
Should be a subset of sources passed as free arguments
-Xcontext-receivers Enable experimental context receivers
-XdependsOn=<fromModuleName>:<onModuleName>
Declares that <fromModuleName> depends on <onModuleName> with dependsOn relation
-Xdisable-default-scripting-plugin
Do not enable scripting plugin by default
-Xdisable-phases Disable backend phases
@@ -89,6 +91,8 @@ 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
View File
@@ -169,6 +169,8 @@ where advanced options include:
-Xcommon-sources=<path> Sources of the common module that need to be compiled together with this module in the multi-platform mode.
Should be a subset of sources passed as free arguments
-Xcontext-receivers Enable experimental context receivers
-XdependsOn=<fromModuleName>:<onModuleName>
Declares that <fromModuleName> depends on <onModuleName> with dependsOn relation
-Xdisable-default-scripting-plugin
Do not enable scripting plugin by default
-Xdisable-phases Disable backend phases
@@ -195,6 +197,8 @@ 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
+14
View File
@@ -0,0 +1,14 @@
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
$TESTDATA_DIR$/src/c.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=c;$TESTDATA_DIR$/src/c.kt
-XdependsOn=b\:a
-XdependsOn=c\:b
-XdependsOn=a\:c
+12
View File
@@ -0,0 +1,12 @@
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: there is a cycle in dependencies of module `b`
COMPILATION_ERROR
@@ -0,0 +1,8 @@
$TESTDATA_DIR$/src/a.kt
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;$TESTDATA_DIR$/src/a.kt
-XdependsOn=b\:a
@@ -0,0 +1,12 @@
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: -XdependsOn flag is specified but there is only one module declared
COMPILATION_ERROR
@@ -0,0 +1,7 @@
$TESTDATA_DIR$/src/a.kt
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-XdependsOn=a\:b
@@ -0,0 +1,12 @@
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: -XdependsOn flag can not be used without -Xmodule
COMPILATION_ERROR
+10
View File
@@ -0,0 +1,10 @@
$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
+12
View File
@@ -0,0 +1,12 @@
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: there are multiple modules with same name(s): a, a
COMPILATION_ERROR
+11
View File
@@ -0,0 +1,11 @@
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
$TESTDATA_DIR$/src/c.kt
-d
$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
-Xcommon-sources=$TESTDATA_DIR$/src/a.kt,$TESTDATA_DIR$/src/b.kt
+11
View File
@@ -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: -Xmodule flag is not supported for language version < 2.0
OK
+10
View File
@@ -0,0 +1,10 @@
$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
-XdependsOn=c\:a
+12
View File
@@ -0,0 +1,12 @@
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: module `c` not found in -Xmodule arguments
COMPILATION_ERROR
@@ -0,0 +1,8 @@
$TESTDATA_DIR$/src/a.kt
$TESTDATA_DIR$/src/b.kt
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a;a.kt;b.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 -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
@@ -0,0 +1,8 @@
$TESTDATA_DIR$/src/a.kt
-d
$TEMP_DIR$
-language-version
2.0
-XXLanguage\:+MultiPlatformProjects
-Xmodule=a
-Xmodule=b;
+12
View File
@@ -0,0 +1,12 @@
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: source '$TESTDATA_DIR$/src/a.kt' does not belong to any module
COMPILATION_ERROR
@@ -0,0 +1,9 @@
$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/a.kt
@@ -0,0 +1,13 @@
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: 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
COMPILATION_ERROR
@@ -0,0 +1,8 @@
$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
+12
View File
@@ -0,0 +1,12 @@
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: source '$TESTDATA_DIR$/src/b.kt' does not belong to any module
COMPILATION_ERROR
+7
View File
@@ -0,0 +1,7 @@
expect class A {
fun foo()
}
expect class B {
fun bar()
}
+13
View File
@@ -0,0 +1,13 @@
actual class A {
actual fun foo() {}
fun actFoo() {}
}
fun acceptB(b: B) {
b.bar()
}
fun acceptA(a: A) {
a.foo()
a.actFoo()
}
+15
View File
@@ -0,0 +1,15 @@
actual class B {
actual fun bar() {}
fun actBar() {}
}
fun actualAcceptB(b: B) {
b.bar()
b.actBar()
}
fun test() {
acceptA(A())
acceptB(B())
actualAcceptB(B())
}