Ant task: support 'failOnError' attribute in kotlinc and withKotlin

This commit is contained in:
Alexander Udalov
2015-06-02 17:17:59 +03:00
parent 6d00c265e2
commit 0ad6dce7ce
8 changed files with 72 additions and 9 deletions
@@ -0,0 +1,3 @@
package hello;
public class IncorrectJavaCode {
@@ -0,0 +1,21 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[javac] Compiling 2 source files to [Temp]
[javac] Compiling [[TestData]] => [[Temp]]
[javac] ERROR: [TestData]/incorrectKotlinCode.kt: (4, 1) Parameter name expected
[javac] ERROR: [TestData]/incorrectKotlinCode.kt: (4, 1) Expecting comma or ')'
[javac] ERROR: [TestData]/incorrectKotlinCode.kt: (4, 1) Expecting ')'
[kotlinc] Compiling [[TestData]] => [[Temp]]
[kotlinc] ERROR: [TestData]/incorrectKotlinCode.kt: (4, 1) Parameter name expected
[kotlinc] ERROR: [TestData]/incorrectKotlinCode.kt: (4, 1) Expecting comma or ')'
[kotlinc] ERROR: [TestData]/incorrectKotlinCode.kt: (4, 1) Expecting ')'
BUILD SUCCESSFUL
Total time: [time]
ERR:
[javac] Compile failed; see the compiler error output for details.
Return code: 0
@@ -0,0 +1,11 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<javac srcdir="${test.data}" destdir="${temp}" includeantruntime="false" failonerror="false">
<withKotlin/>
</javac>
<kotlinc src="${test.data}" output="${temp}" failonerror="false"/>
</target>
</project>
@@ -0,0 +1,12 @@
ERR:
Exception in thread "main" java.lang.NoClassDefFoundError: hello/HelloPackage
Caused by: java.lang.ClassNotFoundException: hello.HelloPackage
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Return code: 1
@@ -0,0 +1,3 @@
package hello
fun main(