From 36a3b94972fb30a1e9a17973d55179c7a4595b28 Mon Sep 17 00:00:00 2001 From: Joffrey BION Date: Wed, 22 May 2019 02:17:33 +0200 Subject: Make common project multiplatform --- sw-common-model/build.gradle.kts | 44 ++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'sw-common-model/build.gradle.kts') diff --git a/sw-common-model/build.gradle.kts b/sw-common-model/build.gradle.kts index 81c58543..c1c6e3fe 100644 --- a/sw-common-model/build.gradle.kts +++ b/sw-common-model/build.gradle.kts @@ -1,11 +1,43 @@ plugins { - kotlin("jvm") + kotlin("multiplatform") id("org.jlleitschuh.gradle.ktlint") } -dependencies { - implementation(kotlin("stdlib-jdk8")) - - testImplementation(kotlin("test")) - testImplementation(kotlin("test-junit")) +kotlin { + jvm() + js() + sourceSets { + val commonMain by getting { + dependencies { + implementation(kotlin("stdlib-common")) + } + } + val commonTest by getting { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + } + } + val jvmMain by getting { + dependencies { + implementation(kotlin("stdlib-jdk8")) + } + } + val jvmTest by getting { + dependencies { + implementation(kotlin("test")) + implementation(kotlin("test-junit")) + } + } + val jsMain by getting { + dependencies { + implementation(kotlin("stdlib-js")) + } + } + val jsTest by getting { + dependencies { + implementation(kotlin("test-js")) + } + } + } } -- cgit