diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/pom.xml new file mode 100644 index 00000000000..956c71f4427 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + + org.jetbrains.kotlin + test-multimodule-root + 1.0-SNAPSHOT + ../pom.xml + + + test-multimodule-js + + + + org.jetbrains.kotlin + kotlin-js-library + ${kotlin.version} + + + org.jetbrains.kotlin + test-multimodule-shared + ${project.version} + + + + + ${project.basedir}/src/main/kotlin + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + compile + compile + + js + + + + true + + + + + + + + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/src/main/kotlin/org/jetbrains/HelloWorld.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/src/main/kotlin/org/jetbrains/HelloWorld.kt new file mode 100644 index 00000000000..85ffdd2648e --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/js/src/main/kotlin/org/jetbrains/HelloWorld.kt @@ -0,0 +1,9 @@ +package org.jetbrains + +fun main(args: Array) { + doMain() +} + +impl fun doMain() { + console.info(getGreeting()) +} diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/jvm/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/jvm/pom.xml new file mode 100644 index 00000000000..8159beb67af --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/jvm/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + + org.jetbrains.kotlin + test-multimodule-root + 1.0-SNAPSHOT + ../pom.xml + + + test-multimodule-jvm + + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + org.jetbrains.kotlin + test-multimodule-shared + ${project.version} + + + + + ${project.basedir}/src/main/kotlin + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + compile + compile + + compile + + + true + + + + + + + + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/jvm/src/main/kotlin/org/jetbrains/HelloWorld.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/jvm/src/main/kotlin/org/jetbrains/HelloWorld.kt new file mode 100644 index 00000000000..1c741f7cd70 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/jvm/src/main/kotlin/org/jetbrains/HelloWorld.kt @@ -0,0 +1,9 @@ +package org.jetbrains + +fun main(args : Array) { + doMain() +} + +impl fun doMain() { + System.out?.println(getGreeting()) +} \ No newline at end of file diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/pom.xml new file mode 100644 index 00000000000..7a6fcb8f4ff --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + org.jetbrains.kotlin + test-multimodule-root + 1.0-SNAPSHOT + pom + + + shared + js + jvm + + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/shared/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/shared/pom.xml new file mode 100644 index 00000000000..e55c44823ca --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/shared/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + + org.jetbrains.kotlin + test-multimodule-root + 1.0-SNAPSHOT + ../pom.xml + + + test-multimodule-shared + + + + org.jetbrains.kotlin + kotlin-stdlib-common + ${kotlin.version} + + + + + ${project.basedir}/src/main/kotlin + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + metadata + + metadata + + + + + + + + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/shared/src/main/kotlin/org/jetbrains/api.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/shared/src/main/kotlin/org/jetbrains/api.kt new file mode 100644 index 00000000000..f881a47de90 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/shared/src/main/kotlin/org/jetbrains/api.kt @@ -0,0 +1,7 @@ +package org.jetbrains + +header fun doMain() + +fun getGreeting() : String { + return "Hello, World!" +} \ No newline at end of file diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/verify.bsh b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/verify.bsh new file mode 100644 index 00000000000..7d3350db213 --- /dev/null +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-multiplatform/verify.bsh @@ -0,0 +1,23 @@ +source(new File(basedir, "../../../verify-common.bsh").getAbsolutePath()); + +assertBuildLogHasLineThatContains("kotlin-maven-plugin"); + +File classFile = new File(basedir, "jvm/target/classes/org/jetbrains/HelloWorldKt.class"); +if (!classFile.exists()) { + throw new FileNotFoundException("Could not find generated class file: " + classFile); +} + +classFile = new File(basedir, "jvm/target/classes/org/jetbrains/ApiKt.class"); +if (!classFile.exists()) { + throw new FileNotFoundException("Could not find generated class file: " + classFile); +} + +File scriptFile = new File(basedir, "js/target/js/test-multimodule-js.js"); +if (!scriptFile.exists()) { + throw new FileNotFoundException("Could not find generated JavaScript file: " + scriptFile); +} + +File metaFile = new File(basedir, "shared/target/classes/org/jetbrains/ApiKt.kotlin_metadata"); +if (!metaFile.exists()) { + throw new FileNotFoundException("Could not find generated common metadata file: " + metaFile); +}