1
0
Fork 0
mirror of https://github.com/MatomoCamp/matomocamp-companion-android.git synced 2024-09-19 16:13:46 +02:00

update Gradle plugin, Hilt, Desugar libs and various libraries to their latest stable version

change compile and target SDK version to 32
This commit is contained in:
Christophe Beyls 2022-09-06 22:31:25 +02:00
parent ad9ff4fc83
commit 7b4dd70b41
5 changed files with 14 additions and 16 deletions

View file

@ -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

View file

@ -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'

View file

@ -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<CharSequence?>
get() = callbackFlow {
val textWatcher = doOnTextChanged { text, _, _, _ -> trySend(text) }

View file

@ -5,7 +5,7 @@ import androidx.drawerlayout.widget.DrawerLayout
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlin.coroutines.resume
suspend fun DrawerLayout.awaitCloseDrawer(drawerView: View) = suspendCancellableCoroutine<Unit> { cont ->
suspend fun DrawerLayout.awaitCloseDrawer(drawerView: View) = suspendCancellableCoroutine { cont ->
val listener = object : DrawerLayout.SimpleDrawerListener() {
override fun onDrawerStateChanged(newState: Int) {
if (newState == DrawerLayout.STATE_DRAGGING) {

View file

@ -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"
}