From 1484e8852cc22751edbb7a9af79ea45737a362a1 Mon Sep 17 00:00:00 2001 From: Daniel Penkin Date: Tue, 8 May 2012 12:08:37 +0400 Subject: [PATCH 1/5] Merged with upstream master --- .../main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java b/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java index 9f5d7b4dfec..5f0e8ad0a26 100644 --- a/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java +++ b/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java @@ -26,6 +26,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.k2js.config.Config; import org.jetbrains.k2js.facade.K2JSTranslator; import org.jetbrains.k2js.facade.MainCallParameters; +import org.jetbrains.k2js.facade.exceptions.TranslationException; import java.io.File; import java.nio.charset.Charset; From d6e8b63dc3b5ea60b8ff2d1fd2ade35a5dab49d1 Mon Sep 17 00:00:00 2001 From: Daniel Penkin Date: Tue, 8 May 2012 02:23:36 +0400 Subject: [PATCH 2/5] Added simple kotlin-maven-plugin integration test --- libraries/tools/kotlin-maven-plugin/pom.xml | 26 +++++ .../kotlin-maven-plugin/src/it/settings.xml | 35 ++++++ .../src/it/test-helloworld/pom.xml | 105 ++++++++++++++++++ .../main/kotlin/org/jetbrains/HelloWorld.kt | 14 +++ .../org/jetbrains/HelloWorldJavaTest.java | 18 +++ .../src/it/test-helloworld/verify.bsh | 7 ++ 6 files changed, 205 insertions(+) create mode 100644 libraries/tools/kotlin-maven-plugin/src/it/settings.xml create mode 100644 libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml create mode 100644 libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/main/kotlin/org/jetbrains/HelloWorld.kt create mode 100644 libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/test/java/org/jetbrains/HelloWorldJavaTest.java create mode 100644 libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/verify.bsh diff --git a/libraries/tools/kotlin-maven-plugin/pom.xml b/libraries/tools/kotlin-maven-plugin/pom.xml index bc60410e04a..4caa1412f92 100644 --- a/libraries/tools/kotlin-maven-plugin/pom.xml +++ b/libraries/tools/kotlin-maven-plugin/pom.xml @@ -55,6 +55,32 @@ maven-plugin-plugin 2.9 + + + maven-invoker-plugin + 1.5 + + src/it + ${project.build.directory}/it + + */pom.xml + + + src/it/settings.xml + ${project.build.directory}/local-repo + verify.bsh + + + + integration-test + package + + install + run + + + + diff --git a/libraries/tools/kotlin-maven-plugin/src/it/settings.xml b/libraries/tools/kotlin-maven-plugin/src/it/settings.xml new file mode 100644 index 00000000000..4d6edd35ac6 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin/src/it/settings.xml @@ -0,0 +1,35 @@ + + + + + it-repo + + true + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + \ No newline at end of file diff --git a/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml new file mode 100644 index 00000000000..5d9734b9e55 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml @@ -0,0 +1,105 @@ + + + 4.0.0 + + org.jetbrains.kotlin.it + test-helloworld + 1.0 + Test Hello World project + + + Test the kotlin-maven-plugin:compile goal on HelloWorld project. + + + + 0.1-SNAPSHOT + + + + + junit + junit + 4.9 + + + + + + ${project.basedir}/src/main/kotlin + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + compile + process-sources + + compile + + + + test-compile + process-test-sources + + test-compile + + + + + + + + + + + jetbrains-release + http://repository.jetbrains.com/releases + + true + + + false + + + + jetbrains-snapshots + http://repository.jetbrains.com/kotlin-snapshots + + false + + + true + + + + + + + jetbrains-release + http://repository.jetbrains.com/releases + + true + + + false + + + + jetbrains-snapshots + http://repository.jetbrains.com/kotlin-snapshots + + false + + + true + + + + + \ No newline at end of file diff --git a/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/main/kotlin/org/jetbrains/HelloWorld.kt b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/main/kotlin/org/jetbrains/HelloWorld.kt new file mode 100644 index 00000000000..c3a8fa7ca3a --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/main/kotlin/org/jetbrains/HelloWorld.kt @@ -0,0 +1,14 @@ +package org.jetbrains +/** + * User: danielpenkin + * Date: 06.05.12 + * Time: 22:53 + */ + +fun main(args : Array) { + System.out?.println(getGreeting()) +} + +fun getGreeting() : String { + return "Hello, World!" +} \ No newline at end of file diff --git a/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/test/java/org/jetbrains/HelloWorldJavaTest.java b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/test/java/org/jetbrains/HelloWorldJavaTest.java new file mode 100644 index 00000000000..5a60556b1b2 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/src/test/java/org/jetbrains/HelloWorldJavaTest.java @@ -0,0 +1,18 @@ +package org.jetbrains; + +import org.junit.Test; + +import static junit.framework.Assert.assertEquals; + +/** + * User: danielpenkin + * Date: 06.05.12 + * Time: 23:35 + */ +public class HelloWorldJavaTest { + + @Test + public void greeting() { + assertEquals("Hello, World!", org.jetbrains.namespace.getGreeting()); + } +} diff --git a/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/verify.bsh b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/verify.bsh new file mode 100644 index 00000000000..760db7e13d0 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/verify.bsh @@ -0,0 +1,7 @@ +import java.io.*; + +File file = new File( basedir, "target/test-helloworld-1.0.jar" ); +if (!file.exists() || !file.isFile()) +{ + throw new FileNotFoundException( "Could not find generated JAR: " + file ); +} \ No newline at end of file From 281e8e5a76ef8d45a680590154cdd578c62efb9e Mon Sep 17 00:00:00 2001 From: Daniel Penkin Date: Tue, 8 May 2012 02:35:29 +0400 Subject: [PATCH 3/5] Temporarily removed settings.xml --- libraries/tools/kotlin-maven-plugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/tools/kotlin-maven-plugin/pom.xml b/libraries/tools/kotlin-maven-plugin/pom.xml index 4caa1412f92..2775a9a645f 100644 --- a/libraries/tools/kotlin-maven-plugin/pom.xml +++ b/libraries/tools/kotlin-maven-plugin/pom.xml @@ -66,7 +66,7 @@ */pom.xml - src/it/settings.xml + ${project.build.directory}/local-repo verify.bsh From a2ee297db94656266a39e1332147f91ce8e5063e Mon Sep 17 00:00:00 2001 From: Daniel Penkin Date: Tue, 8 May 2012 23:10:03 +0400 Subject: [PATCH 4/5] Removed unnecessary repository sections --- .../src/it/test-helloworld/pom.xml | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml index 5d9734b9e55..cb69d9c1f65 100644 --- a/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml +++ b/libraries/tools/kotlin-maven-plugin/src/it/test-helloworld/pom.xml @@ -55,51 +55,4 @@ - - - - jetbrains-release - http://repository.jetbrains.com/releases - - true - - - false - - - - jetbrains-snapshots - http://repository.jetbrains.com/kotlin-snapshots - - false - - - true - - - - - - - jetbrains-release - http://repository.jetbrains.com/releases - - true - - - false - - - - jetbrains-snapshots - http://repository.jetbrains.com/kotlin-snapshots - - false - - - true - - - - \ No newline at end of file From 422fc81e384c8bdb2e9bda62210f72b995fc0501 Mon Sep 17 00:00:00 2001 From: Daniel Penkin Date: Tue, 8 May 2012 23:15:27 +0400 Subject: [PATCH 5/5] Removed unnecessary import statement --- .../main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java b/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java index 5f0e8ad0a26..9f5d7b4dfec 100644 --- a/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java +++ b/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JSCompilerPlugin.java @@ -26,7 +26,6 @@ import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.k2js.config.Config; import org.jetbrains.k2js.facade.K2JSTranslator; import org.jetbrains.k2js.facade.MainCallParameters; -import org.jetbrains.k2js.facade.exceptions.TranslationException; import java.io.File; import java.nio.charset.Charset;