From c22345b9ffddd69acf365929dc3ffe0c7694be5c Mon Sep 17 00:00:00 2001 From: Florina Muntenescu <2998890+florina-muntenescu@users.noreply.github.com> Date: Thu, 28 Jul 2022 09:27:17 +0100 Subject: [PATCH] [All] Updating to Compose 1.2 (#905) * [All] Update to Compose 1.2 snapshot (#901) * [All] Update to Compose 1.2 snapshot * [All] Update to Compose 1.2 snapshot * [Reply] Updated to Compose 1.2 snapshot * Upgrade spotless and downgrade ktlint * Remove unneccessary gradle task for Reply Co-authored-by: Simona Stojanovic * [All] Update to Compose 1.2 stable and 1.3.rc01 Compiler * [All] Update to Compose 1.2 stable and 1.3.rc01 Compiler * [All] Reverting 1.3.0-rc01 Compiler version * [Reply, scripts] Addressing PR comments Co-authored-by: Simona Stojanovic --- .../example/crane/buildsrc/Dependencies.kt | 2 +- JetNews/build.gradle | 6 ++++-- .../jetcaster/buildsrc/dependencies.kt | 4 ++-- .../compose/jetchat/buildsrc/dependencies.kt | 2 +- .../example/jetsnack/buildsrc/Dependencies.kt | 4 ++-- .../jetsurvey/buildsrc/dependencies.kt | 4 ++-- .../com/example/owl/buildsrc/Dependencies.kt | 12 ++--------- Reply/build.gradle | 9 ++------- scripts/upgrade_samples.sh | 20 +++++++++---------- 9 files changed, 25 insertions(+), 38 deletions(-) diff --git a/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt b/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt index 872517664..1f666529a 100644 --- a/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt +++ b/Crane/buildSrc/src/main/java/com/example/crane/buildsrc/Dependencies.kt @@ -59,7 +59,7 @@ object Libs { object Compose { const val compilerVersion = "1.2.0" const val snapshot = "" - const val version = "1.2.0-rc03" + const val version = "1.2.0" const val runtime = "androidx.compose.runtime:runtime:$version" const val runtimeLivedata = "androidx.compose.runtime:runtime-livedata:$version" diff --git a/JetNews/build.gradle b/JetNews/build.gradle index e1d01095b..9c952366c 100644 --- a/JetNews/build.gradle +++ b/JetNews/build.gradle @@ -17,14 +17,15 @@ buildscript { ext.kotlin_version = '1.7.0' ext.compose_compiler_version = '1.2.0' - ext.compose_version = '1.2.0-rc03' + ext.compose_version = '1.2.0' ext.compose_snapshot_version = '' ext.coroutines_version = '1.6.0' - ext.accompanist_version = '0.24.13-rc' + ext.accompanist_version = '0.25.0' repositories { google() mavenCentral() + maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } } dependencies { @@ -46,6 +47,7 @@ subprojects { maven { url "https://androidx.dev/snapshots/builds/" + "${compose_snapshot_version}/artifacts/repository/" } } + maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } } apply plugin: 'com.diffplug.spotless' diff --git a/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt b/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt index e677cb098..ac11d3b07 100644 --- a/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt +++ b/Jetcaster/buildSrc/src/main/java/com/example/jetcaster/buildsrc/dependencies.kt @@ -25,7 +25,7 @@ object Libs { const val jdkDesugar = "com.android.tools:desugar_jdk_libs:1.1.5" object Accompanist { - const val version = "0.24.13-rc" + const val version = "0.25.0" const val pager = "com.google.accompanist:accompanist-pager:$version" } @@ -71,7 +71,7 @@ object Libs { object Compose { const val compilerVersion = "1.2.0" const val snapshot = "" - const val version = "1.2.0-rc03" + const val version = "1.2.0" @get:JvmStatic val snapshotUrl: String diff --git a/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt b/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt index 2ca763499..1b52b84c2 100644 --- a/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt +++ b/Jetchat/buildSrc/src/main/java/com/example/compose/jetchat/buildsrc/dependencies.kt @@ -53,7 +53,7 @@ object Libs { object Compose { const val compilerVersion = "1.2.0" const val snapshot = "" - const val version = "1.2.0-rc03" + const val version = "1.2.0" const val foundation = "androidx.compose.foundation:foundation:$version" const val layout = "androidx.compose.foundation:foundation-layout:$version" diff --git a/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt b/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt index 28682a9a0..6ccd8197d 100644 --- a/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt +++ b/Jetsnack/buildSrc/src/main/java/com/example/jetsnack/buildsrc/Dependencies.kt @@ -24,7 +24,7 @@ object Libs { const val androidGradlePlugin = "com.android.tools.build:gradle:7.2.1" object Accompanist { - const val version = "0.24.13-rc" + const val version = "0.25.0" const val systemuicontroller = "com.google.accompanist:accompanist-systemuicontroller:$version" const val flowlayouts = "com.google.accompanist:accompanist-flowlayout:$version" } @@ -49,7 +49,7 @@ object Libs { object Compose { const val compilerVersion = "1.2.0" const val snapshot = "" - const val version = "1.2.0-rc03" + const val version = "1.2.0" const val foundation = "androidx.compose.foundation:foundation:${version}" const val layout = "androidx.compose.foundation:foundation-layout:${version}" diff --git a/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt b/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt index b1b73f4d3..d925c2ea1 100644 --- a/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt +++ b/Jetsurvey/buildSrc/src/main/java/com/example/compose/jetsurvey/buildsrc/dependencies.kt @@ -27,7 +27,7 @@ object Libs { const val junit = "junit:junit:4.13.2" object Accompanist { - const val version = "0.24.13-rc" + const val version = "0.25.0" const val permissions = "com.google.accompanist:accompanist-permissions:$version" } @@ -62,7 +62,7 @@ object Libs { object Compose { const val compilerVersion = "1.2.0" const val snapshot = "" - const val version = "1.2.0-rc03" + const val version = "1.2.0" @get:JvmStatic val snapshotUrl: String diff --git a/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt b/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt index 124685a2b..3c691ac2b 100644 --- a/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt +++ b/Owl/buildSrc/src/main/java/com/example/owl/buildsrc/Dependencies.kt @@ -19,29 +19,24 @@ package com.example.owl.buildsrc object Versions { const val ktlint = "0.45.2" } - object Libs { const val androidGradlePlugin = "com.android.tools.build:gradle:7.2.1" - object Kotlin { private const val version = "1.7.0" const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version" const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version" const val extensions = "org.jetbrains.kotlin:kotlin-android-extensions:$version" } - object Coroutines { private const val version = "1.6.0" const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version" const val android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:$version" const val test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$version" } - object JUnit { private const val version = "4.13" const val junit = "junit:junit:$version" } - object AndroidX { const val coreKtx = "androidx.core:core-ktx:1.7.0" const val navigation = "androidx.navigation:navigation-compose:2.4.2" @@ -49,11 +44,10 @@ object Libs { object Activity { const val activityCompose = "androidx.activity:activity-compose:1.4.0" } - object Compose { const val compilerVersion = "1.2.0" const val snapshot = "" - const val version = "1.2.0-rc03" + const val version = "1.2.0" const val animation = "androidx.compose.animation:animation:$version" const val foundation = "androidx.compose.foundation:foundation:$version" @@ -73,7 +67,6 @@ object Libs { const val constraintLayoutCompose = "androidx.constraintlayout:constraintlayout-compose:1.0.0" } - object Test { private const val version = "1.4.0" const val core = "androidx.test:core:$version" @@ -85,8 +78,7 @@ object Libs { } } } - object Coil { - const val coilCompose = "io.coil-kt:coil-compose:2.0.0" + const val coilCompose = "io.coil-kt:coil-compose:2.1.0" } } diff --git a/Reply/build.gradle b/Reply/build.gradle index 7a5b564ea..ee5ee3095 100644 --- a/Reply/build.gradle +++ b/Reply/build.gradle @@ -17,7 +17,7 @@ buildscript { ext { kotlin_version = '1.7.0' - compose_version = '1.2.0-rc03' + compose_version = '1.2.0' compose_compiler_version = '1.2.0' material3_version = "1.0.0-alpha14" coroutines_version = '1.6.0' @@ -30,7 +30,7 @@ plugins { id 'com.android.application' version "$agp_version" apply false id 'com.android.library' version "$agp_version" apply false id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false - id 'com.diffplug.spotless' version '6.4.2' + id 'com.diffplug.spotless' version '6.7.0' } subprojects { @@ -50,9 +50,4 @@ subprojects { licenseHeaderFile rootProject.file('spotless/copyright.kt') } } -} - - -task clean(type: Delete) { - delete rootProject.buildDir } \ No newline at end of file diff --git a/scripts/upgrade_samples.sh b/scripts/upgrade_samples.sh index fbb50b18e..4adbf3a3a 100755 --- a/scripts/upgrade_samples.sh +++ b/scripts/upgrade_samples.sh @@ -48,8 +48,8 @@ read ktlint_version; echo "Version to change Accompanist to (e.g 0.24.9-beta): "; read accompanist_version; -echo "Version to change Kotlin to (e.g 1.7.0): "; -read kotlin_version; +echo "Version to change AGP to (e.g. 7.2.1): "; +read androidGradlePlugin_version; if [ -z "$snapshot_version" ]; then echo "Changing Compose version to $compose_version" @@ -61,7 +61,6 @@ fi for DEPENDENCIES_FILE in `find . -type f -iname "dependencies.kt"` ; do COMPOSE_BLOCK=false; ACCOMPANIST_BLOCK=false; - KOTLIN_BLOCK=false; MADE_CHANGE=false; TEMP_FILENAME="${DEPENDENCIES_FILE}_new"; while IFS= read -r line; do @@ -74,23 +73,20 @@ for DEPENDENCIES_FILE in `find . -type f -iname "dependencies.kt"` ; do elif [[ $line == *"val version ="* && "$accompanist_version" != "" ]] && $ACCOMPANIST_BLOCK = true; then echo "$line" | sed -En 's/".*"/"'$accompanist_version'"/p' MADE_CHANGE=true; - elif [[ $line == *"val version ="* && "$kotlin_version" != "" ]] && $KOTLIN_BLOCK = true; then - echo "$line" | sed -En 's/".*"/"'$kotlin_version'"/p' - MADE_CHANGE=true; elif [[ $line == *"val ktlint ="* && "$ktlint_version" != "" ]]; then echo "$line" | sed -En 's/".*"/"'$ktlint_version'"/p' MADE_CHANGE=true; + elif [[ $line == *"val androidGradlePlugin ="* && "$androidGradlePlugin_version" != "" ]]; then + echo "$line" | sed -En 's/".*"/"com.android.tools.build:gradle:'$androidGradlePlugin_version'"/p' + MADE_CHANGE=true; else if [[ $line == *"object Compose {"* ]]; then COMPOSE_BLOCK=true; elif [[ $line == *"object Accompanist {"* ]]; then ACCOMPANIST_BLOCK=true; - elif [[ $line == *"object Kotlin {"* ]]; then - KOTLIN_BLOCK=true; elif [[ $line == *"}"* ]]; then COMPOSE_BLOCK=false; ACCOMPANIST_BLOCK=false; - KOTLIN_BLOCK=false; fi echo "$line"; fi @@ -101,7 +97,7 @@ for DEPENDENCIES_FILE in `find . -type f -iname "dependencies.kt"` ; do else rm $TEMP_FILENAME; fi - + done # Change build.gradle versions @@ -118,6 +114,9 @@ for DEPENDENCIES_FILE in `find . -type f -iname "build.gradle"` ; do elif [[ $line == *"ext.accompanist_version ="* && "$accompanist_version" != "" ]]; then echo "$line" | sed -En "s/\'.*'/\'$accompanist_version\'/p" MADE_CHANGE=true; + elif [[ $line == *"ext.androidGradlePlugin_version ="* && "$androidGradlePlugin_version" != "" ]]; then + echo "$line" | sed -En "s/\'.*'/\'com.android.tools.build:gradle:$androidGradlePlugin_version\'/p" + MADE_CHANGE=true; elif [[ $line == *"'com.diffplug.spotless' version"* && "$spotless_version" != "" ]]; then echo "$line" | sed -En "s/\'.*'/\'com.diffplug.spotless\' version \'$spotless_version\'/p" MADE_CHANGE=true; @@ -135,4 +134,3 @@ for DEPENDENCIES_FILE in `find . -type f -iname "build.gradle"` ; do rm $TEMP_FILENAME; fi done -