Support argfiles in kotlin compiler

Using '-Xargfile=path/to/argfile' will substitute
that argument with the content of argfile.

See KT-24472
This commit is contained in:
Dmitry Savvinov
2018-05-17 21:36:59 +03:00
parent ede2e227c2
commit 43467516ef
18 changed files with 210 additions and 29 deletions
@@ -0,0 +1 @@
$TESTDATA_DIR$/apiVersion.kt -d $TEMP_DIR$ -api-version 1.0 -language-version 1.1
@@ -0,0 +1 @@
-Xargfile=$TESTDATA_DIR$/apiVersionLessThanLanguage.argfile
@@ -0,0 +1,7 @@
compiler/testData/cli/jvm/apiVersion.kt:2:5: error: the feature "bound callable references" is only available since API version 1.1
""::class.isInstance(42)
^
compiler/testData/cli/jvm/apiVersion.kt:2:15: error: unresolved reference: isInstance
""::class.isInstance(42)
^
COMPILATION_ERROR
+4
View File
@@ -0,0 +1,4 @@
-X"some escaped \" sequence \\"
$TESTDATA_DIR$/apiVersion.kt
-d
$TEMP_DIR$ -api-version 1.0 -language-version 1.1
+1
View File
@@ -0,0 +1 @@
-Xargfile=$TESTDATA_DIR$/argfileWithEscaping.argfile
+8
View File
@@ -0,0 +1,8 @@
warning: flag is not supported by this version of the compiler: -Xsome escaped " sequence /
compiler/testData/cli/jvm/apiVersion.kt:2:5: error: the feature "bound callable references" is only available since API version 1.1
""::class.isInstance(42)
^
compiler/testData/cli/jvm/apiVersion.kt:2:15: error: unresolved reference: isInstance
""::class.isInstance(42)
^
COMPILATION_ERROR
+1 -1
View File
@@ -1 +1 @@
{"\/home\/dsavvinov\/Repos\/kotlin-fork\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/a\/A1.kt":["import c.JavaC"],"\/home\/dsavvinov\/Repos\/kotlin-fork\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/a\/A2.kt":[],"\/home\/dsavvinov\/Repos\/kotlin-fork\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/b\/B1.kt":["import a.*"],"\/home\/dsavvinov\/Repos\/kotlin-fork\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/b\/nestedB\/B2.kt":["import a.A1 as AliasedA1","import a.A1"],"\/home\/dsavvinov\/Repos\/kotlin-fork\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/c\/C1.kt":["import a.A1","import a.A2","import b.B1.Companion.a2","import b.nestedB.bar","import b.nestedB.foo"]}
{"\/home\/dsavvinov\/Repos\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/a\/A1.kt":["import c.JavaC"],"\/home\/dsavvinov\/Repos\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/a\/A2.kt":[],"\/home\/dsavvinov\/Repos\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/b\/B1.kt":["import a.*"],"\/home\/dsavvinov\/Repos\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/b\/nestedB\/B2.kt":["import a.A1 as AliasedA1","import a.A1"],"\/home\/dsavvinov\/Repos\/kotlin\/compiler\/testData\/cli\/jvm\/importsProducer\/c\/C1.kt":["import a.A1","import a.A2","import b.B1.Companion.a2","import b.nestedB.bar","import b.nestedB.foo"]}
@@ -0,0 +1 @@
$TEMP_DIR$ -api-version 1.0 -language-version 1.1
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/apiVersion.kt
-d
-Xargfile=$TESTDATA_DIR$/mixingArgfilesAndUsualArgs.argfile
@@ -0,0 +1,7 @@
compiler/testData/cli/jvm/apiVersion.kt:2:5: error: the feature "bound callable references" is only available since API version 1.1
""::class.isInstance(42)
^
compiler/testData/cli/jvm/apiVersion.kt:2:15: error: unresolved reference: isInstance
""::class.isInstance(42)
^
COMPILATION_ERROR
+4
View File
@@ -0,0 +1,4 @@
$TESTDATA_DIR$/simple.kt
-d
$TEMP_DIR$
-Xargfile=$TESTDATA_DIR$/nonexisting.argfile
+2
View File
@@ -0,0 +1,2 @@
warning: argfile not found: $TESTDATA_DIR$/nonexisting.argfile
OK