Introduce Gradle multiplatform plugin
This commit is contained in:
+22
@@ -291,4 +291,26 @@ class KotlinGradleIT: BaseGradleIT() {
|
||||
assertSuccessful()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
fun testMultiplatformCompile() {
|
||||
val project = Project("multiplatformProject", GRADLE_VERSION)
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
assertContains(":lib:compileKotlinCommon",
|
||||
":lib:compileTestKotlinCommon",
|
||||
":libJvm:compileKotlin",
|
||||
":libJvm:compileTestKotlin",
|
||||
":libJs:compileKotlin2Js",
|
||||
":libJs:compileTestKotlin2Js")
|
||||
assertFileExists("lib/build/classes/main/foo/PlatformClass.kotlin_metadata")
|
||||
assertFileExists("lib/build/classes/test/foo/PlatformTest.kotlin_metadata")
|
||||
assertFileExists("libJvm/build/classes/main/foo/PlatformClass.class")
|
||||
assertFileExists("libJvm/build/classes/test/foo/PlatformTest.class")
|
||||
assertFileExists("libJs/build/classes/main/libJs_main.js")
|
||||
assertFileExists("libJs/build/classes/test/libJs_test.js")
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
apply plugin: 'kotlin-platform-common'
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
header class PlatformClass {
|
||||
val value: String
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
header class PlatformTest {
|
||||
//val value: PlatformClass
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
apply plugin: 'kotlin-platform-js'
|
||||
|
||||
dependencies {
|
||||
implement project(":lib")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
impl class PlatformClass {
|
||||
impl val value: String = "JS"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
impl class PlatformTest {
|
||||
//impl val value: PlatformClass = PlatformClass()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
apply plugin: 'kotlin-platform-jvm'
|
||||
|
||||
dependencies {
|
||||
implement project(":lib")
|
||||
compile 'com.google.guava:guava:20.0'
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
impl class PlatformClass {
|
||||
impl val value: String = "JVM"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
import com.google.common.collect.ImmutableSet
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val colors = ImmutableSet.of("red", "orange", "yellow")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
impl class PlatformTest {
|
||||
//impl val value: PlatformClass = PlatformClass()
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
include ':lib', ':libJvm', ':libJs'
|
||||
Reference in New Issue
Block a user