Browse Source

Merge pull request #30 from JetBrains/fix_multiplatfrom_template

Fix multiplatform projects in IDEA / Android Studio
pull/37/head
Igor Demin 4 years ago committed by GitHub
parent
commit
451f8084b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      examples/imageviewer/build.gradle.kts
  2. 11
      examples/imageviewer/desktop/build.gradle.kts
  3. 0
      examples/imageviewer/desktop/src/jvmMain/kotlin/imageviewer/Main.kt
  4. 14
      examples/imageviewer/settings.gradle.kts
  5. 14
      examples/issues/build.gradle.kts
  6. 11
      examples/issues/desktop/build.gradle.kts
  7. 0
      examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt
  8. 14
      examples/issues/settings.gradle.kts
  9. 12
      examples/todoapp/desktop/build.gradle.kts
  10. 0
      examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt
  11. 16
      templates/multiplatform-template/build.gradle.kts
  12. 11
      templates/multiplatform-template/desktop/build.gradle.kts
  13. 0
      templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt
  14. 16
      templates/multiplatform-template/settings.gradle.kts

14
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()

11
examples/imageviewer/desktop/build.gradle.kts

@ -1,16 +1,25 @@
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
}
kotlin {
jvm {
withJava()
}
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":common"))
}
}
}
}
application {
mainClassName = "example.imageviewer.MainKt"

0
examples/imageviewer/desktop/src/main/kotlin/imageviewer/Main.kt → examples/imageviewer/desktop/src/jvmMain/kotlin/imageviewer/Main.kt

14
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")

14
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()

11
examples/issues/desktop/build.gradle.kts

@ -1,16 +1,25 @@
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
}
kotlin {
jvm {
withJava()
}
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":common"))
}
}
}
}
application {
mainClassName = "androidx.ui.examples.jetissues.MainKt"

0
examples/issues/desktop/src/main/kotlin/androidx/ui/examples/jetissues/Main.kt → examples/issues/desktop/src/jvmMain/kotlin/androidx/ui/examples/jetissues/Main.kt

14
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")

12
examples/todoapp/desktop/build.gradle.kts

@ -1,12 +1,19 @@
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
}
kotlin {
jvm {
withJava()
}
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":common:utils"))
@ -18,6 +25,9 @@ dependencies {
implementation(Deps.Badoo.Reaktive.reaktive)
implementation(Deps.Badoo.Reaktive.coroutinesInterop)
}
}
}
}
application {
mainClassName = "example.todo.desktop.MainKt"

0
examples/todoapp/desktop/src/main/kotlin/example/todo/desktop/Main.kt → examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt

16
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()

11
templates/multiplatform-template/desktop/build.gradle.kts

@ -1,16 +1,25 @@
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
}
kotlin {
jvm {
withJava()
}
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":common"))
}
}
}
}
application {
mainClassName = "MainKt"

0
templates/multiplatform-template/desktop/src/main/kotlin/main.kt → templates/multiplatform-template/desktop/src/jvmMain/kotlin/main.kt

16
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")

Loading…
Cancel
Save