<kotlinc> ant task now supports <src> element and multiple source directories

This commit is contained in:
Andrey Breslav
2013-10-08 15:03:32 +04:00
parent ed006a66c5
commit bf49bc0220
10 changed files with 103 additions and 19 deletions
@@ -23,8 +23,7 @@ import java.io.File;
import static junit.framework.Assert.assertEquals;
public class AntTaskTest extends KotlinIntegrationTestBase {
@Test
public void antTaskJvm() throws Exception {
private void doAntTest() throws Exception {
String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "hello.jar";
String runtime = new File("dist/kotlinc/lib/kotlin-runtime.jar").getAbsolutePath();
@@ -32,6 +31,16 @@ public class AntTaskTest extends KotlinIntegrationTestBase {
runJava("hello.run", "-cp", jar + File.pathSeparator + runtime, "Hello.HelloPackage");
}
@Test
public void antTaskJvm() throws Exception {
doAntTest();
}
@Test
public void antTaskJvmManyRoots() throws Exception {
doAntTest();
}
@Override
protected String normalizeOutput(String content) {
return super.normalizeOutput(content)
@@ -1,7 +1,7 @@
OUT Buildfile: build.xml
OUT
OUT build:
OUT [kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
OUT [kotlinc] Compiling [[[TestData]/hello.kt]] => [[Temp]/hello.jar]
OUT
OUT BUILD SUCCESSFUL
OUT Total time: [time]
@@ -0,0 +1,8 @@
OUT Buildfile: build.xml
OUT
OUT build:
OUT [kotlinc] Compiling [[[TestData]/root1, [TestData]/root2]] => [[Temp]/hello.jar]
OUT
OUT BUILD SUCCESSFUL
OUT Total time: [time]
Return code: 0
@@ -0,0 +1,10 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/jet/buildtools/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlinc output="${temp}/hello.jar">
<src path="${test.data}/root1"/>
<src path="${test.data}/root2"/>
</kotlinc>
</target>
</project>
@@ -0,0 +1,2 @@
OUT Hello, a!
Return code: 0
@@ -0,0 +1,7 @@
package Hello
fun main(args : Array<String>) {
for (s in arrayList("a"))
println("Hello, $s!")
foo()
}
@@ -0,0 +1,3 @@
package Hello
fun foo() {}