Skip to content

Commit

Permalink
Templates. Use currentOs in common MPP module
Browse files Browse the repository at this point in the history
Temporary (?) workaround for Preview
  • Loading branch information
igordmn committed Aug 3, 2021
1 parent a9f3f4f commit 9e4dbe3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions templates/desktop-template/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
8 changes: 6 additions & 2 deletions templates/multiplatform-template/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -53,4 +57,4 @@ android {
res.srcDirs("src/androidMain/res")
}
}
}
}
1 change: 0 additions & 1 deletion templates/multiplatform-template/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ kotlin {
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":common"))
}
}
Expand Down

0 comments on commit 9e4dbe3

Please sign in to comment.