From 7b4dd70b41d8d98bbc5a660577cfba7994665bb9 Mon Sep 17 00:00:00 2001 From: Christophe Beyls Date: Tue, 6 Sep 2022 22:31:25 +0200 Subject: [PATCH] update Gradle plugin, Hilt, Desugar libs and various libraries to their latest stable version change compile and target SDK version to 32 --- .travis.yml | 4 ++-- app/build.gradle | 18 +++++++++--------- .../fosdem/activities/SearchResultActivity.kt | 2 -- .../digitalia/fosdem/utils/DrawerLayoutExt.kt | 2 +- build.gradle | 4 ++-- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index db6f385..d018dd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,13 @@ dist: focal jdk: openjdk11 env: - - ANDROID_SDK_ROOT=$HOME/android-sdk COMMAND_LINE_TOOLS_ARCHIVE=commandlinetools-linux-8092744_latest.zip + - ANDROID_SDK_ROOT=$HOME/android-sdk COMMAND_LINE_TOOLS_ARCHIVE=commandlinetools-linux-8512546_latest.zip install: # Download latest Android command line tools if not already in cache and replace the previous ones, if any - if test ! -e $ANDROID_SDK_ROOT/$COMMAND_LINE_TOOLS_ARCHIVE ; then rm -rf $ANDROID_SDK_ROOT && mkdir -p $ANDROID_SDK_ROOT && curl https://dl.google.com/android/repository/$COMMAND_LINE_TOOLS_ARCHIVE -o $ANDROID_SDK_ROOT/$COMMAND_LINE_TOOLS_ARCHIVE && unzip -qq -n $ANDROID_SDK_ROOT/$COMMAND_LINE_TOOLS_ARCHIVE -d $ANDROID_SDK_ROOT ; fi # Install or update Android SDK components (no-op if already up-to-date and cached) - - echo y | $ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT 'platforms;android-31' 'build-tools;31.0.0' > /dev/null + - echo y | $ANDROID_SDK_ROOT/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT 'platforms;android-32' 'build-tools;32.0.0' > /dev/null before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock diff --git a/app/build.gradle b/app/build.gradle index 59d1a34..b6eee3d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,13 +7,13 @@ plugins { } android { - compileSdkVersion 31 - buildToolsVersion "31.0.0" + compileSdkVersion 32 + buildToolsVersion "32.0.0" defaultConfig { applicationId "be.digitalia.fosdem" minSdkVersion 19 - targetSdkVersion 31 + targetSdkVersion 32 multiDexEnabled = true versionCode 1900210 versionName "2.1.0" @@ -99,20 +99,20 @@ afterEvaluate { } dependencies { - def lifecycle_version = "2.5.0" - def room_version = "2.4.2" + def lifecycle_version = "2.5.1" + def room_version = "2.4.3" def okhttp_version = "3.12.13" - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6' + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.8' implementation "androidx.multidex:multidex:2.0.1" implementation "com.google.dagger:hilt-android:$hilt_version" kapt "com.google.dagger:hilt-compiler:$hilt_version" implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' implementation 'androidx.core:core-ktx:1.8.0' - implementation 'androidx.activity:activity-ktx:1.5.0' - implementation 'androidx.fragment:fragment-ktx:1.5.0' - implementation 'androidx.appcompat:appcompat:1.4.2' + implementation 'androidx.activity:activity-ktx:1.5.1' + implementation 'androidx.fragment:fragment-ktx:1.5.2' + implementation 'androidx.appcompat:appcompat:1.5.0' implementation 'com.google.android.material:material:1.6.1' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' diff --git a/app/src/main/java/be/digitalia/fosdem/activities/SearchResultActivity.kt b/app/src/main/java/be/digitalia/fosdem/activities/SearchResultActivity.kt index fd74ac0..e4b9003 100644 --- a/app/src/main/java/be/digitalia/fosdem/activities/SearchResultActivity.kt +++ b/app/src/main/java/be/digitalia/fosdem/activities/SearchResultActivity.kt @@ -17,7 +17,6 @@ import be.digitalia.fosdem.fragments.SearchResultListFragment import be.digitalia.fosdem.utils.trimNonAlpha import be.digitalia.fosdem.viewmodels.SearchViewModel import dagger.hilt.android.AndroidEntryPoint -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.callbackFlow @@ -96,7 +95,6 @@ class SearchResultActivity : AppCompatActivity(R.layout.search_result) { overridePendingTransition(R.anim.fade_in, R.anim.fade_out) } - @OptIn(ExperimentalCoroutinesApi::class) private val EditText.textChangeEvents: Flow get() = callbackFlow { val textWatcher = doOnTextChanged { text, _, _, _ -> trySend(text) } diff --git a/app/src/main/java/be/digitalia/fosdem/utils/DrawerLayoutExt.kt b/app/src/main/java/be/digitalia/fosdem/utils/DrawerLayoutExt.kt index 8ef5a74..cb803ad 100644 --- a/app/src/main/java/be/digitalia/fosdem/utils/DrawerLayoutExt.kt +++ b/app/src/main/java/be/digitalia/fosdem/utils/DrawerLayoutExt.kt @@ -5,7 +5,7 @@ import androidx.drawerlayout.widget.DrawerLayout import kotlinx.coroutines.suspendCancellableCoroutine import kotlin.coroutines.resume -suspend fun DrawerLayout.awaitCloseDrawer(drawerView: View) = suspendCancellableCoroutine { cont -> +suspend fun DrawerLayout.awaitCloseDrawer(drawerView: View) = suspendCancellableCoroutine { cont -> val listener = object : DrawerLayout.SimpleDrawerListener() { override fun onDrawerStateChanged(newState: Int) { if (newState == DrawerLayout.STATE_DRAGGING) { diff --git a/build.gradle b/build.gradle index 13d1579..c0e50cd 100644 --- a/build.gradle +++ b/build.gradle @@ -2,14 +2,14 @@ buildscript { ext { kotlin_version = '1.7.10' - hilt_version = '2.42' + hilt_version = '2.43.2' } repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' + classpath 'com.android.tools.build:gradle:7.2.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version" }