diff --git a/examples/imageviewer/build.gradle.kts b/examples/imageviewer/build.gradle.kts index 602d7f27b0..42c2f3f832 100755 --- a/examples/imageviewer/build.gradle.kts +++ b/examples/imageviewer/build.gradle.kts @@ -1,3 +1,17 @@ +buildscript { + repositories { + google() + jcenter() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } + + dependencies { + classpath("org.jetbrains.compose:compose-gradle-plugin:0.1.0-dev97") + classpath("com.android.tools.build:gradle:4.0.1") + classpath(kotlin("gradle-plugin", version = "1.4.0")) + } +} + allprojects { repositories { mavenLocal() diff --git a/examples/imageviewer/desktop/build.gradle.kts b/examples/imageviewer/desktop/build.gradle.kts index 4346cbfed2..1c0eb81892 100755 --- a/examples/imageviewer/desktop/build.gradle.kts +++ b/examples/imageviewer/desktop/build.gradle.kts @@ -1,15 +1,24 @@ import org.jetbrains.compose.compose plugins { - kotlin("jvm") + kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22) id("org.jetbrains.compose") java application } -dependencies { - implementation(compose.desktop.currentOs) - implementation(project(":common")) +kotlin { + jvm { + withJava() + } + sourceSets { + named("jvmMain") { + dependencies { + implementation(compose.desktop.currentOs) + implementation(project(":common")) + } + } + } } application { diff --git a/examples/imageviewer/desktop/src/main/kotlin/imageviewer/Main.kt b/examples/imageviewer/desktop/src/jvmMain/kotlin/imageviewer/Main.kt old mode 100755 new mode 100644 similarity index 100% rename from examples/imageviewer/desktop/src/main/kotlin/imageviewer/Main.kt rename to examples/imageviewer/desktop/src/jvmMain/kotlin/imageviewer/Main.kt diff --git a/examples/imageviewer/settings.gradle.kts b/examples/imageviewer/settings.gradle.kts index aaede1ffa0..9a0d554e9b 100755 --- a/examples/imageviewer/settings.gradle.kts +++ b/examples/imageviewer/settings.gradle.kts @@ -1,15 +1 @@ -buildscript { - repositories { - google() - jcenter() - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - } - - dependencies { - classpath("org.jetbrains.compose:compose-gradle-plugin:0.1.0-dev97") - classpath("com.android.tools.build:gradle:4.0.1") - classpath(kotlin("gradle-plugin", version = "1.4.0")) - } -} - include(":common", ":android", ":desktop") diff --git a/examples/issues/build.gradle.kts b/examples/issues/build.gradle.kts index 602d7f27b0..42c2f3f832 100644 --- a/examples/issues/build.gradle.kts +++ b/examples/issues/build.gradle.kts @@ -1,3 +1,17 @@ +buildscript { + repositories { + google() + jcenter() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } + + dependencies { + classpath("org.jetbrains.compose:compose-gradle-plugin:0.1.0-dev97") + classpath("com.android.tools.build:gradle:4.0.1") + classpath(kotlin("gradle-plugin", version = "1.4.0")) + } +} + allprojects { repositories { mavenLocal() diff --git a/examples/issues/desktop/build.gradle.kts b/examples/issues/desktop/build.gradle.kts index f89894125d..4a433dfef8 100644 --- a/examples/issues/desktop/build.gradle.kts +++ b/examples/issues/desktop/build.gradle.kts @@ -1,15 +1,24 @@ import org.jetbrains.compose.compose plugins { - kotlin("jvm") + kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22) id("org.jetbrains.compose") java application } -dependencies { - implementation(compose.desktop.currentOs) - implementation(project(":common")) +kotlin { + jvm { + withJava() + } + sourceSets { + named("jvmMain") { + dependencies { + implementation(compose.desktop.currentOs) + implementation(project(":common")) + } + } + } } application { diff --git a/examples/issues/desktop/src/main/kotlin/androidx/ui/examples/jetissues/Main.kt b/examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt similarity index 100% rename from examples/issues/desktop/src/main/kotlin/androidx/ui/examples/jetissues/Main.kt rename to examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt diff --git a/examples/issues/settings.gradle.kts b/examples/issues/settings.gradle.kts index aaede1ffa0..9a0d554e9b 100644 --- a/examples/issues/settings.gradle.kts +++ b/examples/issues/settings.gradle.kts @@ -1,15 +1 @@ -buildscript { - repositories { - google() - jcenter() - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - } - - dependencies { - classpath("org.jetbrains.compose:compose-gradle-plugin:0.1.0-dev97") - classpath("com.android.tools.build:gradle:4.0.1") - classpath(kotlin("gradle-plugin", version = "1.4.0")) - } -} - include(":common", ":android", ":desktop") diff --git a/examples/todoapp/desktop/build.gradle.kts b/examples/todoapp/desktop/build.gradle.kts index a7ec46c63c..0ea31179d7 100755 --- a/examples/todoapp/desktop/build.gradle.kts +++ b/examples/todoapp/desktop/build.gradle.kts @@ -1,22 +1,32 @@ import org.jetbrains.compose.compose plugins { - kotlin("jvm") + kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22) id("org.jetbrains.compose") java application } -dependencies { - implementation(compose.desktop.currentOs) - implementation(project(":common:utils")) - implementation(project(":common:database")) - implementation(project(":common:root")) - implementation(Deps.ArkIvanov.Decompose.decompose) - implementation(Deps.ArkIvanov.MVIKotlin.mvikotlin) - implementation(Deps.ArkIvanov.MVIKotlin.mvikotlinMain) - implementation(Deps.Badoo.Reaktive.reaktive) - implementation(Deps.Badoo.Reaktive.coroutinesInterop) +kotlin { + jvm { + withJava() + } + + sourceSets { + named("jvmMain") { + dependencies { + implementation(compose.desktop.currentOs) + implementation(project(":common:utils")) + implementation(project(":common:database")) + implementation(project(":common:root")) + implementation(Deps.ArkIvanov.Decompose.decompose) + implementation(Deps.ArkIvanov.MVIKotlin.mvikotlin) + implementation(Deps.ArkIvanov.MVIKotlin.mvikotlinMain) + implementation(Deps.Badoo.Reaktive.reaktive) + implementation(Deps.Badoo.Reaktive.coroutinesInterop) + } + } + } } application { diff --git a/examples/todoapp/desktop/src/main/kotlin/example/todo/desktop/Main.kt b/examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt old mode 100755 new mode 100644 similarity index 100% rename from examples/todoapp/desktop/src/main/kotlin/example/todo/desktop/Main.kt rename to examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt diff --git a/templates/multiplatform-template/build.gradle.kts b/templates/multiplatform-template/build.gradle.kts index 44f0a96615..51718cc3dc 100644 --- a/templates/multiplatform-template/build.gradle.kts +++ b/templates/multiplatform-template/build.gradle.kts @@ -1,3 +1,19 @@ +buildscript { + val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.1.0-dev97" + + repositories { + google() + jcenter() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } + + dependencies { + classpath("org.jetbrains.compose:compose-gradle-plugin:$composeVersion") + classpath("com.android.tools.build:gradle:4.0.1") + classpath(kotlin("gradle-plugin", version = "1.4.0")) + } +} + allprojects { repositories { google() diff --git a/templates/multiplatform-template/desktop/build.gradle.kts b/templates/multiplatform-template/desktop/build.gradle.kts index c7ee1bab94..eaa9f9e584 100644 --- a/templates/multiplatform-template/desktop/build.gradle.kts +++ b/templates/multiplatform-template/desktop/build.gradle.kts @@ -1,15 +1,24 @@ import org.jetbrains.compose.compose plugins { - kotlin("jvm") + kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22) id("org.jetbrains.compose") java application } -dependencies { - implementation(compose.desktop.currentOs) - implementation(project(":common")) +kotlin { + jvm { + withJava() + } + sourceSets { + named("jvmMain") { + dependencies { + implementation(compose.desktop.currentOs) + implementation(project(":common")) + } + } + } } application { diff --git a/templates/multiplatform-template/desktop/src/main/kotlin/main.kt b/templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt similarity index 100% rename from templates/multiplatform-template/desktop/src/main/kotlin/main.kt rename to templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt diff --git a/templates/multiplatform-template/settings.gradle.kts b/templates/multiplatform-template/settings.gradle.kts index 07c421fc8c..9a0d554e9b 100644 --- a/templates/multiplatform-template/settings.gradle.kts +++ b/templates/multiplatform-template/settings.gradle.kts @@ -1,17 +1 @@ -buildscript { - val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.1.0-dev97" - - repositories { - google() - jcenter() - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - } - - dependencies { - classpath("org.jetbrains.compose:compose-gradle-plugin:$composeVersion") - classpath("com.android.tools.build:gradle:4.0.1") - classpath(kotlin("gradle-plugin", version = "1.4.0")) - } -} - include(":common", ":android", ":desktop")