Skip to content

Commit

Permalink
[All] Updating to Compose 1.2 (#905)
Browse files Browse the repository at this point in the history
* [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 <anomis@google.com>

* [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 <anomis@google.com>
  • Loading branch information
florina-muntenescu and simona-anomis committed Jul 28, 2022
1 parent 4b62197 commit c22345b
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions JetNews/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,35 @@ 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"

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"
Expand All @@ -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"
Expand All @@ -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"
}
}
9 changes: 2 additions & 7 deletions Reply/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 {
Expand All @@ -50,9 +50,4 @@ subprojects {
licenseHeaderFile rootProject.file('spotless/copyright.kt')
}
}
}


task clean(type: Delete) {
delete rootProject.buildDir
}
20 changes: 9 additions & 11 deletions scripts/upgrade_samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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;
Expand All @@ -135,4 +134,3 @@ for DEPENDENCIES_FILE in `find . -type f -iname "build.gradle"` ; do
rm $TEMP_FILENAME;
fi
done

0 comments on commit c22345b

Please sign in to comment.