Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiplatform projects in IDEA / Android Studio #30

Merged
merged 3 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions examples/imageviewer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
17 changes: 13 additions & 4 deletions examples/imageviewer/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
File renamed without changes.
14 changes: 0 additions & 14 deletions examples/imageviewer/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
14 changes: 14 additions & 0 deletions examples/issues/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
17 changes: 13 additions & 4 deletions examples/issues/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
14 changes: 0 additions & 14 deletions examples/issues/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
32 changes: 21 additions & 11 deletions examples/todoapp/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions templates/multiplatform-template/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
17 changes: 13 additions & 4 deletions templates/multiplatform-template/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
16 changes: 0 additions & 16 deletions templates/multiplatform-template/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")