CompilerAdapter for <javac> task + test for compiler attribute

No test for the typedef <withKotlin/> because Ant 1.7 doesn't seem to support typedef inside <javac>
This commit is contained in:
Andrey Breslav
2013-10-08 17:15:30 +04:00
parent bf49bc0220
commit a985882baf
8 changed files with 116 additions and 8 deletions
@@ -0,0 +1,12 @@
OUT Buildfile: build.xml
OUT
OUT build:
OUT [mkdir] Created dir: [Temp]/classes
OUT [javac] Compiling 1 source file to [Temp]/classes
OUT [javac] Compiling [[[TestData]/root1]] => [[Temp]/classes]
OUT [javac] Running javac...
OUT [jar] Building jar: [Temp]/hello.jar
OUT
OUT BUILD SUCCESSFUL
OUT Total time: [time]
Return code: 0
@@ -0,0 +1,13 @@
<project name="Ant Task Test" default="build">
<target name="build">
<delete dir="${temp}/classes" failonerror="false"/>
<mkdir dir="${temp}/classes"/>
<javac destdir="${temp}/classes" compiler="org.jetbrains.jet.buildtools.ant.KotlinCompilerAdapter">
<src path="${test.data}/root1"/>
</javac>
<jar destfile="${temp}/hello.jar">
<fileset dir="${temp}/classes"/>
</jar>
</target>
</project>
@@ -0,0 +1,3 @@
OUT Hello, a!
OUT Java
Return code: 0
@@ -0,0 +1,7 @@
package hello
fun main(args : Array<String>) {
for (s in arrayList("a"))
println("Hello, $s!")
j.Java().f();
}
@@ -0,0 +1,14 @@
package j;
import java.lang.String;
import java.lang.System;
public class Java {
public void f() {
System.out.println("Java");
}
public static void main(String[] args) {
hello.HelloPackage.main(new String[] {});
}
}