From d23806a3f48895a8aa48cf478cf2c4c0be8e22c4 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov <654232+AlexeyTsvetkov@users.noreply.github.com> Date: Mon, 24 Jan 2022 13:16:39 +0300 Subject: [PATCH] Update examples (#1740) * Update examples to Gradle 7.3.3 Resolves #1654 * Update compose and agp in examples Resolves #1117 * Fix gradle plugins classloading in examples and templates * Make falling balls mpp compatible with examples checker --- examples/codeviewer/android/build.gradle.kts | 6 +++--- examples/codeviewer/build.gradle.kts | 21 ++++++++++++++++++- examples/codeviewer/common/build.gradle.kts | 10 ++++----- examples/codeviewer/gradle.properties | 4 ++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/codeviewer/settings.gradle.kts | 1 + examples/falling-balls/build.gradle.kts | 2 +- examples/falling-balls/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/imageviewer/android/build.gradle.kts | 4 ++-- examples/imageviewer/build.gradle.kts | 13 +++++++++++- examples/imageviewer/common/build.gradle.kts | 4 ++-- examples/imageviewer/gradle.properties | 4 ++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/intellij-plugin/build.gradle.kts | 4 ++-- examples/intellij-plugin/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/issues/android/build.gradle.kts | 4 ++-- examples/issues/build.gradle.kts | 14 +++++++++++-- examples/issues/gradle.properties | 4 ++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/notepad/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../todoapp-lite/android/build.gradle.kts | 4 ++-- examples/todoapp-lite/build.gradle.kts | 13 +++++++++++- examples/todoapp-lite/common/build.gradle.kts | 4 ++-- examples/todoapp-lite/gradle.properties | 4 ++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/todoapp/android/build.gradle.kts | 4 ++-- .../android/src/main/AndroidManifest.xml | 3 ++- .../buildSrc/buildSrc/src/main/kotlin/Deps.kt | 2 +- examples/todoapp/buildSrc/gradle.properties | 2 +- .../src/main/kotlin/android-setup.gradle.kts | 4 ++-- .../multiplatform-compose-setup.gradle.kts | 4 ++-- .../kotlin/multiplatform-setup.gradle.kts | 2 +- examples/todoapp/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/visual-effects/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/web-compose-bird/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/web-landing/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- examples/web-with-react/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../widgets-gallery/android/build.gradle.kts | 4 ++-- examples/widgets-gallery/build.gradle.kts | 13 +++++++++++- .../falling-balls-mpp/build.gradle.kts | 8 +++---- .../falling-balls-mpp/gradle.properties | 7 +++++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../falling-balls-mpp/settings.gradle.kts | 12 +++++++++-- .../lwjgl-integration/build.gradle.kts | 1 - templates/desktop-template/build.gradle.kts | 1 - templates/desktop-template/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../android/build.gradle.kts | 4 ++-- .../multiplatform-template/build.gradle.kts | 13 +++++++++++- .../common/build.gradle.kts | 6 ++---- .../multiplatform-template/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- templates/web-template/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 63 files changed, 173 insertions(+), 93 deletions(-) diff --git a/examples/codeviewer/android/build.gradle.kts b/examples/codeviewer/android/build.gradle.kts index 86dad830b9..1a03c22b9f 100644 --- a/examples/codeviewer/android/build.gradle.kts +++ b/examples/codeviewer/android/build.gradle.kts @@ -15,12 +15,12 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } dependencies { implementation(project(":common")) - implementation("androidx.activity:activity-compose:1.3.1") + implementation("androidx.activity:activity-compose:1.4.0") } \ No newline at end of file diff --git a/examples/codeviewer/build.gradle.kts b/examples/codeviewer/build.gradle.kts index 45172c70e6..59387d208b 100644 --- a/examples/codeviewer/build.gradle.kts +++ b/examples/codeviewer/build.gradle.kts @@ -1,7 +1,26 @@ -allprojects { +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + kotlin("jvm") apply false + kotlin("multiplatform") apply false + kotlin("android") apply false + id("com.android.application") apply false + id("com.android.library") apply false + id("org.jetbrains.compose") apply false +} + +subprojects { repositories { google() mavenCentral() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } + + plugins.withId("org.jetbrains.kotlin.multiplatform") { + tasks.withType { + kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + } + } } diff --git a/examples/codeviewer/common/build.gradle.kts b/examples/codeviewer/common/build.gradle.kts index c61757acac..08fb9990fa 100644 --- a/examples/codeviewer/common/build.gradle.kts +++ b/examples/codeviewer/common/build.gradle.kts @@ -22,8 +22,8 @@ kotlin { named("androidMain") { kotlin.srcDirs("src/jvmMain/kotlin") dependencies { - api("androidx.appcompat:appcompat:1.3.0-beta01") - api("androidx.core:core-ktx:1.3.1") + api("androidx.appcompat:appcompat:1.4.1") + api("androidx.core:core-ktx:1.7.0") } } named("desktopMain") { @@ -41,13 +41,11 @@ android { defaultConfig { minSdkVersion(21) targetSdkVersion(31) - versionCode = 1 - versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } sourceSets { diff --git a/examples/codeviewer/gradle.properties b/examples/codeviewer/gradle.properties index 53cd8cde1a..14eb612db5 100644 --- a/examples/codeviewer/gradle.properties +++ b/examples/codeviewer/gradle.properties @@ -20,5 +20,5 @@ android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official kotlin.version=1.6.10 -agp.version=4.2.2 -compose.version=1.0.1-rc2 +agp.version=7.0.4 +compose.version=1.0.1 diff --git a/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties b/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties +++ b/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/codeviewer/settings.gradle.kts b/examples/codeviewer/settings.gradle.kts index f4ac8d1ff7..c2ab465cc8 100644 --- a/examples/codeviewer/settings.gradle.kts +++ b/examples/codeviewer/settings.gradle.kts @@ -13,6 +13,7 @@ pluginManagement { kotlin("jvm").version(kotlinVersion) kotlin("multiplatform").version(kotlinVersion) kotlin("android").version(kotlinVersion) + id("com.android.base").version(agpVersion) id("com.android.application").version(agpVersion) id("com.android.library").version(agpVersion) id("org.jetbrains.compose").version(composeVersion) diff --git a/examples/falling-balls/build.gradle.kts b/examples/falling-balls/build.gradle.kts index f368d90c3f..18cfc5e907 100644 --- a/examples/falling-balls/build.gradle.kts +++ b/examples/falling-balls/build.gradle.kts @@ -7,7 +7,7 @@ plugins { id("org.jetbrains.compose") } -group = "me.user" +group = "org.jetbrains.compose.demo.falling" version = "1.0" repositories { diff --git a/examples/falling-balls/gradle.properties b/examples/falling-balls/gradle.properties index e09f731866..d97ca90eff 100644 --- a/examples/falling-balls/gradle.properties +++ b/examples/falling-balls/gradle.properties @@ -1,3 +1,3 @@ kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/examples/falling-balls/gradle/wrapper/gradle-wrapper.properties b/examples/falling-balls/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/falling-balls/gradle/wrapper/gradle-wrapper.properties +++ b/examples/falling-balls/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/imageviewer/android/build.gradle.kts b/examples/imageviewer/android/build.gradle.kts index 4b09e1d354..58c1d38d15 100755 --- a/examples/imageviewer/android/build.gradle.kts +++ b/examples/imageviewer/android/build.gradle.kts @@ -15,8 +15,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/examples/imageviewer/build.gradle.kts b/examples/imageviewer/build.gradle.kts index 45172c70e6..bf95fe23b1 100755 --- a/examples/imageviewer/build.gradle.kts +++ b/examples/imageviewer/build.gradle.kts @@ -1,4 +1,15 @@ -allprojects { +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + kotlin("jvm") apply false + kotlin("multiplatform") apply false + kotlin("android") apply false + id("com.android.application") apply false + id("com.android.library") apply false + id("org.jetbrains.compose") apply false +} + +subprojects { repositories { google() mavenCentral() diff --git a/examples/imageviewer/common/build.gradle.kts b/examples/imageviewer/common/build.gradle.kts index d9e8b25c79..1ad8f76dfd 100755 --- a/examples/imageviewer/common/build.gradle.kts +++ b/examples/imageviewer/common/build.gradle.kts @@ -43,8 +43,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } sourceSets { diff --git a/examples/imageviewer/gradle.properties b/examples/imageviewer/gradle.properties index 53cd8cde1a..14eb612db5 100755 --- a/examples/imageviewer/gradle.properties +++ b/examples/imageviewer/gradle.properties @@ -20,5 +20,5 @@ android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official kotlin.version=1.6.10 -agp.version=4.2.2 -compose.version=1.0.1-rc2 +agp.version=7.0.4 +compose.version=1.0.1 diff --git a/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties b/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100755 --- a/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties +++ b/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/intellij-plugin/build.gradle.kts b/examples/intellij-plugin/build.gradle.kts index c462f5a4d4..ea35316991 100644 --- a/examples/intellij-plugin/build.gradle.kts +++ b/examples/intellij-plugin/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.compose.compose plugins { - id("org.jetbrains.intellij") version "1.1.4" + id("org.jetbrains.intellij") version "1.3.0" java kotlin("jvm") id("org.jetbrains.compose") @@ -24,7 +24,7 @@ dependencies { // See https://github.com/JetBrains/gradle-intellij-plugin/ intellij { - version.set("2021.2") + version.set("2021.3") } tasks.withType { diff --git a/examples/intellij-plugin/gradle.properties b/examples/intellij-plugin/gradle.properties index e09f731866..d97ca90eff 100644 --- a/examples/intellij-plugin/gradle.properties +++ b/examples/intellij-plugin/gradle.properties @@ -1,3 +1,3 @@ kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties b/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/issues/android/build.gradle.kts b/examples/issues/android/build.gradle.kts index 812f033130..73574362f6 100644 --- a/examples/issues/android/build.gradle.kts +++ b/examples/issues/android/build.gradle.kts @@ -15,8 +15,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/examples/issues/build.gradle.kts b/examples/issues/build.gradle.kts index 543d661ea0..bf95fe23b1 100644 --- a/examples/issues/build.gradle.kts +++ b/examples/issues/build.gradle.kts @@ -1,6 +1,16 @@ -allprojects { +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + kotlin("jvm") apply false + kotlin("multiplatform") apply false + kotlin("android") apply false + id("com.android.application") apply false + id("com.android.library") apply false + id("org.jetbrains.compose") apply false +} + +subprojects { repositories { - mavenLocal() google() mavenCentral() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") diff --git a/examples/issues/gradle.properties b/examples/issues/gradle.properties index 9cc269d6ad..14a606d0ab 100644 --- a/examples/issues/gradle.properties +++ b/examples/issues/gradle.properties @@ -20,5 +20,5 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true kotlin.version=1.6.10 -agp.version=4.2.2 -compose.version=1.0.1-rc2 +agp.version=7.0.4 +compose.version=1.0.1 diff --git a/examples/issues/gradle/wrapper/gradle-wrapper.properties b/examples/issues/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/issues/gradle/wrapper/gradle-wrapper.properties +++ b/examples/issues/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/notepad/gradle.properties b/examples/notepad/gradle.properties index a33aa2d639..edb8733db4 100644 --- a/examples/notepad/gradle.properties +++ b/examples/notepad/gradle.properties @@ -1,4 +1,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 \ No newline at end of file diff --git a/examples/notepad/gradle/wrapper/gradle-wrapper.properties b/examples/notepad/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/notepad/gradle/wrapper/gradle-wrapper.properties +++ b/examples/notepad/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/todoapp-lite/android/build.gradle.kts b/examples/todoapp-lite/android/build.gradle.kts index 4a07b39add..9e99b62de6 100755 --- a/examples/todoapp-lite/android/build.gradle.kts +++ b/examples/todoapp-lite/android/build.gradle.kts @@ -15,8 +15,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/examples/todoapp-lite/build.gradle.kts b/examples/todoapp-lite/build.gradle.kts index 45172c70e6..bf95fe23b1 100755 --- a/examples/todoapp-lite/build.gradle.kts +++ b/examples/todoapp-lite/build.gradle.kts @@ -1,4 +1,15 @@ -allprojects { +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + kotlin("jvm") apply false + kotlin("multiplatform") apply false + kotlin("android") apply false + id("com.android.application") apply false + id("com.android.library") apply false + id("org.jetbrains.compose") apply false +} + +subprojects { repositories { google() mavenCentral() diff --git a/examples/todoapp-lite/common/build.gradle.kts b/examples/todoapp-lite/common/build.gradle.kts index a80db145fd..9d690d5244 100755 --- a/examples/todoapp-lite/common/build.gradle.kts +++ b/examples/todoapp-lite/common/build.gradle.kts @@ -30,8 +30,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } sourceSets { diff --git a/examples/todoapp-lite/gradle.properties b/examples/todoapp-lite/gradle.properties index 53cd8cde1a..14eb612db5 100755 --- a/examples/todoapp-lite/gradle.properties +++ b/examples/todoapp-lite/gradle.properties @@ -20,5 +20,5 @@ android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official kotlin.version=1.6.10 -agp.version=4.2.2 -compose.version=1.0.1-rc2 +agp.version=7.0.4 +compose.version=1.0.1 diff --git a/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties b/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100755 --- a/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties +++ b/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/todoapp/android/build.gradle.kts b/examples/todoapp/android/build.gradle.kts index a985d52a4d..15cdab46f0 100755 --- a/examples/todoapp/android/build.gradle.kts +++ b/examples/todoapp/android/build.gradle.kts @@ -17,8 +17,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } packagingOptions { diff --git a/examples/todoapp/android/src/main/AndroidManifest.xml b/examples/todoapp/android/src/main/AndroidManifest.xml index e746a926bc..28cedb4399 100755 --- a/examples/todoapp/android/src/main/AndroidManifest.xml +++ b/examples/todoapp/android/src/main/AndroidManifest.xml @@ -16,7 +16,8 @@ android:theme="@style/Theme.AppCompat.Light.NoActionBar"> + android:label="@string/app_name" + android:exported="false"> diff --git a/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt b/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt index 22fb775829..959c45e516 100644 --- a/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt +++ b/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt @@ -29,7 +29,7 @@ object Deps { object Android { object Tools { object Build { - const val gradlePlugin = "com.android.tools.build:gradle:4.1.0" + const val gradlePlugin = "com.android.tools.build:gradle:7.0.4" } } } diff --git a/examples/todoapp/buildSrc/gradle.properties b/examples/todoapp/buildSrc/gradle.properties index 09a6ac3d11..998bcf1c5b 100755 --- a/examples/todoapp/buildSrc/gradle.properties +++ b/examples/todoapp/buildSrc/gradle.properties @@ -1,3 +1,3 @@ # TODO can we get rid of duplication with root gradle.properties? kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/examples/todoapp/buildSrc/src/main/kotlin/android-setup.gradle.kts b/examples/todoapp/buildSrc/src/main/kotlin/android-setup.gradle.kts index 095b16947b..6175d18bce 100644 --- a/examples/todoapp/buildSrc/src/main/kotlin/android-setup.gradle.kts +++ b/examples/todoapp/buildSrc/src/main/kotlin/android-setup.gradle.kts @@ -13,8 +13,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } sourceSets { diff --git a/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-compose-setup.gradle.kts b/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-compose-setup.gradle.kts index 94b9f5d4aa..dd7083a01d 100644 --- a/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-compose-setup.gradle.kts +++ b/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-compose-setup.gradle.kts @@ -23,7 +23,7 @@ kotlin { named("androidMain") { dependencies { - implementation("androidx.appcompat:appcompat:1.3.0-beta01") + implementation("androidx.appcompat:appcompat:1.3.0") implementation("androidx.core:core-ktx:1.3.1") } } @@ -36,6 +36,6 @@ kotlin { } tasks.withType { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "11" } } diff --git a/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts b/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts index 870dfbf62b..3e393dc8e9 100644 --- a/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts +++ b/examples/todoapp/buildSrc/src/main/kotlin/multiplatform-setup.gradle.kts @@ -40,6 +40,6 @@ kotlin { } tasks.withType { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "11" } } diff --git a/examples/todoapp/gradle.properties b/examples/todoapp/gradle.properties index 83e23bb5b2..9e9d3d7eee 100755 --- a/examples/todoapp/gradle.properties +++ b/examples/todoapp/gradle.properties @@ -24,4 +24,4 @@ org.gradle.caching=true kotlin.native.disableCompilerDaemon=true kotlin.version=1.6.10 -compose.version=1.0.1-rc2 \ No newline at end of file +compose.version=1.0.1 \ No newline at end of file diff --git a/examples/todoapp/gradle/wrapper/gradle-wrapper.properties b/examples/todoapp/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100755 --- a/examples/todoapp/gradle/wrapper/gradle-wrapper.properties +++ b/examples/todoapp/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/visual-effects/gradle.properties b/examples/visual-effects/gradle.properties index e09f731866..d97ca90eff 100644 --- a/examples/visual-effects/gradle.properties +++ b/examples/visual-effects/gradle.properties @@ -1,3 +1,3 @@ kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/examples/visual-effects/gradle/wrapper/gradle-wrapper.properties b/examples/visual-effects/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/visual-effects/gradle/wrapper/gradle-wrapper.properties +++ b/examples/visual-effects/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/web-compose-bird/gradle.properties b/examples/web-compose-bird/gradle.properties index 417a2d5b9e..6d98ad2a0d 100644 --- a/examples/web-compose-bird/gradle.properties +++ b/examples/web-compose-bird/gradle.properties @@ -1,4 +1,4 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/examples/web-compose-bird/gradle/wrapper/gradle-wrapper.properties b/examples/web-compose-bird/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/web-compose-bird/gradle/wrapper/gradle-wrapper.properties +++ b/examples/web-compose-bird/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/web-compose-in-js/gradle/wrapper/gradle-wrapper.properties b/examples/web-compose-in-js/gradle/wrapper/gradle-wrapper.properties index 69a9715077..2e6e5897b5 100644 --- a/examples/web-compose-in-js/gradle/wrapper/gradle-wrapper.properties +++ b/examples/web-compose-in-js/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/web-landing/gradle.properties b/examples/web-landing/gradle.properties index e09f731866..d97ca90eff 100644 --- a/examples/web-landing/gradle.properties +++ b/examples/web-landing/gradle.properties @@ -1,3 +1,3 @@ kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/examples/web-landing/gradle/wrapper/gradle-wrapper.properties b/examples/web-landing/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/web-landing/gradle/wrapper/gradle-wrapper.properties +++ b/examples/web-landing/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/web-with-react/gradle.properties b/examples/web-with-react/gradle.properties index e09f731866..d97ca90eff 100644 --- a/examples/web-with-react/gradle.properties +++ b/examples/web-with-react/gradle.properties @@ -1,3 +1,3 @@ kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/examples/web-with-react/gradle/wrapper/gradle-wrapper.properties b/examples/web-with-react/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/examples/web-with-react/gradle/wrapper/gradle-wrapper.properties +++ b/examples/web-with-react/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/widgets-gallery/android/build.gradle.kts b/examples/widgets-gallery/android/build.gradle.kts index d5866b2b34..ea3aaf410d 100644 --- a/examples/widgets-gallery/android/build.gradle.kts +++ b/examples/widgets-gallery/android/build.gradle.kts @@ -15,8 +15,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/examples/widgets-gallery/build.gradle.kts b/examples/widgets-gallery/build.gradle.kts index 45172c70e6..bf95fe23b1 100644 --- a/examples/widgets-gallery/build.gradle.kts +++ b/examples/widgets-gallery/build.gradle.kts @@ -1,4 +1,15 @@ -allprojects { +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + kotlin("jvm") apply false + kotlin("multiplatform") apply false + kotlin("android") apply false + id("com.android.application") apply false + id("com.android.library") apply false + id("org.jetbrains.compose") apply false +} + +subprojects { repositories { google() mavenCentral() diff --git a/experimental/examples/falling-balls-mpp/build.gradle.kts b/experimental/examples/falling-balls-mpp/build.gradle.kts index bb14bae182..5ae444ce7b 100644 --- a/experimental/examples/falling-balls-mpp/build.gradle.kts +++ b/experimental/examples/falling-balls-mpp/build.gradle.kts @@ -14,8 +14,8 @@ buildscript { } plugins { - kotlin("multiplatform") version "1.6.10" - id("org.jetbrains.compose") version "1.1.0-beta04" + kotlin("multiplatform") + id("org.jetbrains.compose") } version = "1.0-SNAPSHOT" @@ -23,9 +23,9 @@ version = "1.0-SNAPSHOT" repositories { mavenLocal() mavenCentral() - google() + gradlePluginPortal() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") -} + google()} kotlin { jvm("desktop") diff --git a/experimental/examples/falling-balls-mpp/gradle.properties b/experimental/examples/falling-balls-mpp/gradle.properties index 05c36706e3..5c263e48ca 100644 --- a/experimental/examples/falling-balls-mpp/gradle.properties +++ b/experimental/examples/falling-balls-mpp/gradle.properties @@ -1,5 +1,8 @@ +org.gradle.jvmargs=-Xmx3g +compose.version=1.1.0-beta04 +kotlin.version=1.6.10 +kotlin.code.style=official kotlin.native.cacheKind=none kotlin.native.useEmbeddableCompilerJar=true -org.gradle.jvmargs=-Xmx3g -kotlin.mpp.enableGranularSourceSetsMetadata=true kotlin.native.enableDependencyPropagation=false +kotlin.mpp.enableGranularSourceSetsMetadata=true diff --git a/experimental/examples/falling-balls-mpp/gradle/wrapper/gradle-wrapper.properties b/experimental/examples/falling-balls-mpp/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/experimental/examples/falling-balls-mpp/gradle/wrapper/gradle-wrapper.properties +++ b/experimental/examples/falling-balls-mpp/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/experimental/examples/falling-balls-mpp/settings.gradle.kts b/experimental/examples/falling-balls-mpp/settings.gradle.kts index 1c3a625f81..17b62c9a6c 100644 --- a/experimental/examples/falling-balls-mpp/settings.gradle.kts +++ b/experimental/examples/falling-balls-mpp/settings.gradle.kts @@ -1,12 +1,20 @@ pluginManagement { repositories { mavenLocal() - gradlePluginPortal() mavenCentral() - maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") } + gradlePluginPortal() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") google() } + plugins { + val kotlinVersion = extra["kotlin.version"] as String + kotlin("multiplatform").version(kotlinVersion) + + val composeVersion = extra["compose.version"] as String + id("org.jetbrains.compose").version(composeVersion) + } } + rootProject.name = "falling-balls-mpp" diff --git a/experimental/lwjgl-integration/build.gradle.kts b/experimental/lwjgl-integration/build.gradle.kts index 5a38ca3a1f..5d634fb891 100644 --- a/experimental/lwjgl-integration/build.gradle.kts +++ b/experimental/lwjgl-integration/build.gradle.kts @@ -35,7 +35,6 @@ compose.desktop { mainClass = "MainKt" nativeDistributions { - appResourcesRootDir.set(project.layout.projectDirectory.dir("xxx")) targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "KotlinJvmComposeDesktopApplication" packageVersion = "1.0.0" diff --git a/templates/desktop-template/build.gradle.kts b/templates/desktop-template/build.gradle.kts index 6ea0689457..23b948a759 100644 --- a/templates/desktop-template/build.gradle.kts +++ b/templates/desktop-template/build.gradle.kts @@ -25,7 +25,6 @@ compose.desktop { mainClass = "MainKt" nativeDistributions { - appResourcesRootDir.set(project.layout.projectDirectory.dir("xxx")) targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "KotlinJvmComposeDesktopApplication" packageVersion = "1.0.0" diff --git a/templates/desktop-template/gradle.properties b/templates/desktop-template/gradle.properties index a33aa2d639..7cea32dab0 100644 --- a/templates/desktop-template/gradle.properties +++ b/templates/desktop-template/gradle.properties @@ -1,4 +1,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/templates/desktop-template/gradle/wrapper/gradle-wrapper.properties b/templates/desktop-template/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/templates/desktop-template/gradle/wrapper/gradle-wrapper.properties +++ b/templates/desktop-template/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/templates/multiplatform-template/android/build.gradle.kts b/templates/multiplatform-template/android/build.gradle.kts index acfacd2537..3d06374e92 100644 --- a/templates/multiplatform-template/android/build.gradle.kts +++ b/templates/multiplatform-template/android/build.gradle.kts @@ -15,8 +15,8 @@ android { } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/templates/multiplatform-template/build.gradle.kts b/templates/multiplatform-template/build.gradle.kts index 45172c70e6..bf95fe23b1 100644 --- a/templates/multiplatform-template/build.gradle.kts +++ b/templates/multiplatform-template/build.gradle.kts @@ -1,4 +1,15 @@ -allprojects { +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + kotlin("jvm") apply false + kotlin("multiplatform") apply false + kotlin("android") apply false + id("com.android.application") apply false + id("com.android.library") apply false + id("org.jetbrains.compose") apply false +} + +subprojects { repositories { google() mavenCentral() diff --git a/templates/multiplatform-template/common/build.gradle.kts b/templates/multiplatform-template/common/build.gradle.kts index e95f8fe293..e9dea64bcf 100644 --- a/templates/multiplatform-template/common/build.gradle.kts +++ b/templates/multiplatform-template/common/build.gradle.kts @@ -35,13 +35,11 @@ android { defaultConfig { minSdkVersion(21) targetSdkVersion(31) - versionCode = 1 - versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } sourceSets { diff --git a/templates/multiplatform-template/gradle.properties b/templates/multiplatform-template/gradle.properties index a33aef4645..7ea3403d59 100644 --- a/templates/multiplatform-template/gradle.properties +++ b/templates/multiplatform-template/gradle.properties @@ -3,5 +3,5 @@ android.useAndroidX=true android.enableJetifier=true kotlin.code.style=official kotlin.version=1.6.10 -agp.version=4.2.2 +agp.version=7.0.4 compose.version=1.0.1 diff --git a/templates/multiplatform-template/gradle/wrapper/gradle-wrapper.properties b/templates/multiplatform-template/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/templates/multiplatform-template/gradle/wrapper/gradle-wrapper.properties +++ b/templates/multiplatform-template/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/templates/web-template/gradle.properties b/templates/web-template/gradle.properties index a33aa2d639..7cea32dab0 100644 --- a/templates/web-template/gradle.properties +++ b/templates/web-template/gradle.properties @@ -1,4 +1,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 kotlin.code.style=official kotlin.version=1.6.10 -compose.version=1.0.1-rc2 +compose.version=1.0.1 diff --git a/templates/web-template/gradle/wrapper/gradle-wrapper.properties b/templates/web-template/gradle/wrapper/gradle-wrapper.properties index 05679dc3c1..2e6e5897b5 100644 --- a/templates/web-template/gradle/wrapper/gradle-wrapper.properties +++ b/templates/web-template/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists