Ant task: support additional arguments, drop inline/optimize

Only "-X" options are now supported as additional command line arguments
This commit is contained in:
Alexander Udalov
2014-07-30 13:50:20 -07:00
parent 45a57011d8
commit 9442724821
14 changed files with 97 additions and 118 deletions
@@ -2,6 +2,10 @@
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar" inline="wrong"/>
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar">
<compilerarg value="-Xno-inline"/>
<compilerarg line="-Xno-call-assertions -Xno-param-assertions"/>
<compilerarg value="-Xno-optimize"/>
</kotlinc>
</target>
</project>
@@ -0,0 +1,7 @@
package hello
fun main(args : Array<String>) {
for (s in listOf("a")) {
println("Hello, $s!")
}
}
@@ -0,0 +1,14 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlinc] Compiling [[[TestData]/hello.kt]] => [[Temp]/hello.jar]
ERR:
BUILD FAILED
[TestData]/build.xml:5: Invalid argument: -option-never-to-be-supported
Total time: [time]
Return code: 1
@@ -2,6 +2,8 @@
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar" inline="false"/>
<kotlinc src="${test.data}/hello.kt" output="${temp}/hello.jar">
<compilerarg value="-option-never-to-be-supported"/>
</kotlinc>
</target>
</project>
@@ -0,0 +1,4 @@
package hello
fun main(args : Array<String>) {
}
@@ -1,7 +0,0 @@
package hello
fun main(args : Array<String>) {
for (s in arrayList("a"))
println("Hello, $s!")
}
@@ -1,31 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
ERR:
BUILD FAILED
[TestData]/build.xml:5: org.jetbrains.jet.cli.jvm.compiler.CompileEnvironmentException: Wrong value for inline option: 'wrong'. Should be 'on'/'off' or 'true'/'false'
at org.jetbrains.jet.buildtools.ant.BytecodeCompilerTask.execute(BytecodeCompilerTask.java:153)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: [time]
Return code: 1
@@ -1,7 +0,0 @@
package hello
fun main(args : Array<String>) {
for (s in arrayList("a"))
println("Hello, $s!")
}