From 9e4dbe3400d0dcc88e49220b88493e45d7b058fa Mon Sep 17 00:00:00 2001 From: Igor Demin Date: Tue, 3 Aug 2021 17:48:59 +0300 Subject: [PATCH] Templates. Use currentOs in common MPP module Temporary (?) workaround for Preview --- templates/desktop-template/build.gradle.kts | 4 ++++ templates/multiplatform-template/common/build.gradle.kts | 8 ++++++-- templates/multiplatform-template/desktop/build.gradle.kts | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/templates/desktop-template/build.gradle.kts b/templates/desktop-template/build.gradle.kts index 2dad821f4c..19cdd98384 100644 --- a/templates/desktop-template/build.gradle.kts +++ b/templates/desktop-template/build.gradle.kts @@ -15,6 +15,10 @@ repositories { } dependencies { + // Note, if you develop a library, you should use compose.desktop.common. + // compose.desktop.currentOs should be used in launcher-sourceSet + // (in a separate module for demo project and in testMain). + // With compose.desktop.common you will also lose @Preview functionality implementation(compose.desktop.currentOs) } diff --git a/templates/multiplatform-template/common/build.gradle.kts b/templates/multiplatform-template/common/build.gradle.kts index d7742f72a7..11d04fb6fc 100644 --- a/templates/multiplatform-template/common/build.gradle.kts +++ b/templates/multiplatform-template/common/build.gradle.kts @@ -20,7 +20,11 @@ kotlin { } named("desktopMain") { dependencies { - api(compose.uiTooling) + // Note, if you develop a library, you should use compose.desktop.common. + // compose.desktop.currentOs should be used in launcher-sourceSet + // (in a separate module for demo project and in testMain). + // With compose.desktop.common you will also lose @Preview functionality + api(compose.desktop.currentOs) } } named("androidMain") { @@ -53,4 +57,4 @@ android { res.srcDirs("src/androidMain/res") } } -} +} \ No newline at end of file diff --git a/templates/multiplatform-template/desktop/build.gradle.kts b/templates/multiplatform-template/desktop/build.gradle.kts index 2a1a7377ff..bffabdaf28 100644 --- a/templates/multiplatform-template/desktop/build.gradle.kts +++ b/templates/multiplatform-template/desktop/build.gradle.kts @@ -13,7 +13,6 @@ kotlin { sourceSets { named("jvmMain") { dependencies { - implementation(compose.desktop.currentOs) implementation(project(":common")) } }