diff --git a/compiler/integration-tests/src/org/jetbrains/kotlin/AntTaskTest.java b/compiler/integration-tests/src/org/jetbrains/kotlin/AntTaskTest.java index 0c6f66f2faa..ef4cc1801a2 100644 --- a/compiler/integration-tests/src/org/jetbrains/kotlin/AntTaskTest.java +++ b/compiler/integration-tests/src/org/jetbrains/kotlin/AntTaskTest.java @@ -28,7 +28,7 @@ import static junit.framework.Assert.assertEquals; public class AntTaskTest extends KotlinIntegrationTestBase { private void doAntTest(String... extraJavaArgs) throws Exception { String jar = tmpdir.getTmpDir().getAbsolutePath() + File.separator + "hello.jar"; - String runtime = new File("dist/kotlinc/lib/kotlin-runtime.jar").getAbsolutePath(); + String runtime = getKotlinRuntimePath(); assertEquals("compilation failed", 0, runAnt("build.log", "build.xml", extraJavaArgs)); runJava("hello.run", "-cp", jar + File.pathSeparator + runtime, "hello.HelloPackage"); @@ -46,7 +46,22 @@ public class AntTaskTest extends KotlinIntegrationTestBase { @Test public void javacCompiler() throws Exception { - doAntTest("-cp", getCompilerLib() + "/kotlin-ant.jar"); + doAntTest("-cp", getKotlinAntPath(), + "-Dkotlin.home", getCompilerLib().getAbsolutePath()); + } + + @Test + public void externalAnnotations() throws Exception { + doAntTest("-cp", getKotlinAntPath(), + "-Didea.sdk", getIdeaSdkHome(), + "-Dkotlin.home", getCompilerLib().getAbsolutePath()); + } + + @Test + public void kotlinCompiler() throws Exception { + doAntTest("-cp", getKotlinAntPath(), + "-Didea.sdk", getIdeaSdkHome(), + "-Dkotlin.home", getCompilerLib().getAbsolutePath()); } @Override @@ -69,7 +84,15 @@ public class AntTaskTest extends KotlinIntegrationTestBase { return runJava(logName, strings.toArray(new String[strings.size()])); } + private static String getKotlinAntPath() { + return getCompilerLib() + File.separator + "kotlin-ant.jar"; + } + + private static String getIdeaSdkHome() { + return getKotlinProjectHome().getAbsolutePath() + File.separator + "ideaSDK"; + } + private static String getAntHome() { - return getKotlinProjectHome().getAbsolutePath() + File.separator + "dependencies" + File.separator + "ant-1.7"; + return getKotlinProjectHome().getAbsolutePath() + File.separator + "dependencies" + File.separator + "ant-1.8"; } } diff --git a/compiler/integration-tests/testData/antTaskJvm/build.log.expected b/compiler/integration-tests/testData/antTaskJvm/build.log.expected index e15ec4eda2d..c71b096d7e8 100644 --- a/compiler/integration-tests/testData/antTaskJvm/build.log.expected +++ b/compiler/integration-tests/testData/antTaskJvm/build.log.expected @@ -1,4 +1,4 @@ -OUT Buildfile: build.xml +OUT Buildfile: [TestData]/build.xml OUT OUT build: OUT [kotlinc] Compiling [[[TestData]/hello.kt]] => [[Temp]/hello.jar] diff --git a/compiler/integration-tests/testData/antTaskJvmManyRoots/build.log.expected b/compiler/integration-tests/testData/antTaskJvmManyRoots/build.log.expected index bb62842274a..7607db6a4ad 100644 --- a/compiler/integration-tests/testData/antTaskJvmManyRoots/build.log.expected +++ b/compiler/integration-tests/testData/antTaskJvmManyRoots/build.log.expected @@ -1,4 +1,4 @@ -OUT Buildfile: build.xml +OUT Buildfile: [TestData]/build.xml OUT OUT build: OUT [kotlinc] Compiling [[[TestData]/root1, [TestData]/root2]] => [[Temp]/hello.jar] diff --git a/compiler/integration-tests/testData/externalAnnotations/build.log.expected b/compiler/integration-tests/testData/externalAnnotations/build.log.expected new file mode 100644 index 00000000000..bc21d11bbfc --- /dev/null +++ b/compiler/integration-tests/testData/externalAnnotations/build.log.expected @@ -0,0 +1,12 @@ +OUT Buildfile: [TestData]/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 diff --git a/compiler/integration-tests/testData/externalAnnotations/build.xml b/compiler/integration-tests/testData/externalAnnotations/build.xml new file mode 100644 index 00000000000..113c3040eb8 --- /dev/null +++ b/compiler/integration-tests/testData/externalAnnotations/build.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/compiler/integration-tests/testData/externalAnnotations/hello.run.expected b/compiler/integration-tests/testData/externalAnnotations/hello.run.expected new file mode 100644 index 00000000000..de564d891df --- /dev/null +++ b/compiler/integration-tests/testData/externalAnnotations/hello.run.expected @@ -0,0 +1,3 @@ +OUT Hello, a! +OUT Java Hello +Return code: 0 diff --git a/compiler/integration-tests/testData/externalAnnotations/root1/a/j/annotations.xml b/compiler/integration-tests/testData/externalAnnotations/root1/a/j/annotations.xml new file mode 100644 index 00000000000..17578e94069 --- /dev/null +++ b/compiler/integration-tests/testData/externalAnnotations/root1/a/j/annotations.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/compiler/integration-tests/testData/externalAnnotations/root1/b/j/annotations.xml b/compiler/integration-tests/testData/externalAnnotations/root1/b/j/annotations.xml new file mode 100644 index 00000000000..4d5d038491c --- /dev/null +++ b/compiler/integration-tests/testData/externalAnnotations/root1/b/j/annotations.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/compiler/integration-tests/testData/externalAnnotations/root1/hello.kt b/compiler/integration-tests/testData/externalAnnotations/root1/hello.kt new file mode 100644 index 00000000000..75434833e46 --- /dev/null +++ b/compiler/integration-tests/testData/externalAnnotations/root1/hello.kt @@ -0,0 +1,9 @@ +package hello + +fun main(args : Array) { + for (s in arrayList("a")) + println("Hello, $s!") + val java: String = j.Java().f() + val hello: String = j.Java().f2() + println("$java $hello") +} diff --git a/compiler/integration-tests/testData/externalAnnotations/root1/j/Java.java b/compiler/integration-tests/testData/externalAnnotations/root1/j/Java.java new file mode 100644 index 00000000000..ce5f7282990 --- /dev/null +++ b/compiler/integration-tests/testData/externalAnnotations/root1/j/Java.java @@ -0,0 +1,20 @@ +package j; + +import org.jetbrains.annotations.NotNull; + +import java.lang.String; +import java.lang.System; + +public class Java { + public String f() { + return "Java"; + } + + public String f2() { + return "Hello"; + } + + public static void main(String[] args) { + hello.HelloPackage.main(new String[] {}); + } +} \ No newline at end of file diff --git a/compiler/integration-tests/testData/javacCompiler/build.log.expected b/compiler/integration-tests/testData/javacCompiler/build.log.expected index 1b19712aa36..bc21d11bbfc 100644 --- a/compiler/integration-tests/testData/javacCompiler/build.log.expected +++ b/compiler/integration-tests/testData/javacCompiler/build.log.expected @@ -1,4 +1,4 @@ -OUT Buildfile: build.xml +OUT Buildfile: [TestData]/build.xml OUT OUT build: OUT [mkdir] Created dir: [Temp]/classes diff --git a/compiler/integration-tests/testData/javacCompiler/build.xml b/compiler/integration-tests/testData/javacCompiler/build.xml index c7bceadc551..72e91b75d25 100644 --- a/compiler/integration-tests/testData/javacCompiler/build.xml +++ b/compiler/integration-tests/testData/javacCompiler/build.xml @@ -1,10 +1,15 @@ - + + + + + - + + diff --git a/compiler/integration-tests/testData/kotlinCompiler/build.log.expected b/compiler/integration-tests/testData/kotlinCompiler/build.log.expected new file mode 100644 index 00000000000..25ee1864938 --- /dev/null +++ b/compiler/integration-tests/testData/kotlinCompiler/build.log.expected @@ -0,0 +1,11 @@ +OUT Buildfile: [TestData]/build.xml +OUT +OUT build: +OUT [mkdir] Created dir: [Temp]/classes +OUT [kotlinc] Compiling [[[TestData]/root1]] => [[Temp]/classes] +OUT [javac] Compiling 1 source file to [Temp]/classes +OUT [jar] Building jar: [Temp]/hello.jar +OUT +OUT BUILD SUCCESSFUL +OUT Total time: [time] +Return code: 0 diff --git a/compiler/integration-tests/testData/kotlinCompiler/build.xml b/compiler/integration-tests/testData/kotlinCompiler/build.xml new file mode 100644 index 00000000000..73359810bf0 --- /dev/null +++ b/compiler/integration-tests/testData/kotlinCompiler/build.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/compiler/integration-tests/testData/kotlinCompiler/hello.run.expected b/compiler/integration-tests/testData/kotlinCompiler/hello.run.expected new file mode 100644 index 00000000000..de564d891df --- /dev/null +++ b/compiler/integration-tests/testData/kotlinCompiler/hello.run.expected @@ -0,0 +1,3 @@ +OUT Hello, a! +OUT Java Hello +Return code: 0 diff --git a/compiler/integration-tests/testData/kotlinCompiler/root1/a/j/annotations.xml b/compiler/integration-tests/testData/kotlinCompiler/root1/a/j/annotations.xml new file mode 100644 index 00000000000..17578e94069 --- /dev/null +++ b/compiler/integration-tests/testData/kotlinCompiler/root1/a/j/annotations.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/compiler/integration-tests/testData/kotlinCompiler/root1/b/j/annotations.xml b/compiler/integration-tests/testData/kotlinCompiler/root1/b/j/annotations.xml new file mode 100644 index 00000000000..4d5d038491c --- /dev/null +++ b/compiler/integration-tests/testData/kotlinCompiler/root1/b/j/annotations.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/compiler/integration-tests/testData/kotlinCompiler/root1/hello.kt b/compiler/integration-tests/testData/kotlinCompiler/root1/hello.kt new file mode 100644 index 00000000000..75434833e46 --- /dev/null +++ b/compiler/integration-tests/testData/kotlinCompiler/root1/hello.kt @@ -0,0 +1,9 @@ +package hello + +fun main(args : Array) { + for (s in arrayList("a")) + println("Hello, $s!") + val java: String = j.Java().f() + val hello: String = j.Java().f2() + println("$java $hello") +} diff --git a/compiler/integration-tests/testData/kotlinCompiler/root1/j/Java.java b/compiler/integration-tests/testData/kotlinCompiler/root1/j/Java.java new file mode 100644 index 00000000000..ce5f7282990 --- /dev/null +++ b/compiler/integration-tests/testData/kotlinCompiler/root1/j/Java.java @@ -0,0 +1,20 @@ +package j; + +import org.jetbrains.annotations.NotNull; + +import java.lang.String; +import java.lang.System; + +public class Java { + public String f() { + return "Java"; + } + + public String f2() { + return "Hello"; + } + + public static void main(String[] args) { + hello.HelloPackage.main(new String[] {}); + } +} \ No newline at end of file diff --git a/update_dependencies.xml b/update_dependencies.xml index a781425c2c9..c8fe417bd71 100644 --- a/update_dependencies.xml +++ b/update_dependencies.xml @@ -89,6 +89,22 @@ + + + + + + + + + + + + + + @@ -121,16 +137,9 @@ - - - - - - - - + + +