From 26c66359a592137bcdc176118478e94aec739090 Mon Sep 17 00:00:00 2001 From: Stefan Niedermann Date: Wed, 17 Jan 2024 13:07:37 +0100 Subject: [PATCH] chore(deps): Upgrade to AGP 8.5 Signed-off-by: Stefan Niedermann --- build.gradle | 4 +- exception/build.gradle | 22 +++++----- exception/src/main/AndroidManifest.xml | 2 +- gradle.properties | 6 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- markdown/build.gradle | 22 +++++----- markdown/src/main/AndroidManifest.xml | 2 +- sample/build.gradle | 19 +++++--- .../nextcloud/sample/MainActivity.kt | 5 +++ sample/src/main/res/layout/activity_main.xml | 44 ++++++++++++------- sso-glide/build.gradle | 20 +++++---- sso-glide/src/main/AndroidManifest.xml | 2 +- 12 files changed, 89 insertions(+), 61 deletions(-) diff --git a/build.gradle b/build.gradle index c5a61f3..96235b1 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { ext.version_code = 1008002 ext.version_name = '1.8.2' - ext.kotlin_version = '1.8.22' + ext.kotlin_version = '1.9.22' ext.sso_version = '0.8.1' repositories { @@ -12,7 +12,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22" } } diff --git a/exception/build.gradle b/exception/build.gradle index 50aaf3f..218ecfb 100644 --- a/exception/build.gradle +++ b/exception/build.gradle @@ -3,14 +3,12 @@ apply plugin: 'kotlin-android' apply plugin: 'maven-publish' // needed for JitPack.io android { - compileSdkVersion 33 - buildToolsVersion "33.0.1" + compileSdk 34 + namespace 'it.niedermann.nextcloud.exception' defaultConfig { - minSdkVersion 22 - targetSdkVersion 33 - versionCode version_code - versionName version_name + minSdk 22 + targetSdk 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -18,8 +16,12 @@ android { compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = '17' } testOptions { @@ -55,11 +57,11 @@ dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' api "com.github.nextcloud:Android-SingleSignOn:$sso_version" - implementation 'com.github.stefan-niedermann:android-commons:0.2.9' + implementation 'com.github.stefan-niedermann:android-commons:0.3.2' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.13.2' - testImplementation "io.mockk:mockk:1.13.7" + testImplementation "io.mockk:mockk:1.13.9" testImplementation 'org.robolectric:robolectric:4.11.1' } diff --git a/exception/src/main/AndroidManifest.xml b/exception/src/main/AndroidManifest.xml index a756252..cc947c5 100644 --- a/exception/src/main/AndroidManifest.xml +++ b/exception/src/main/AndroidManifest.xml @@ -1 +1 @@ - + diff --git a/gradle.properties b/gradle.properties index 468e9ab..5c50f9c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx4096m +org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects @@ -17,4 +17,6 @@ org.gradle.jvmargs=-Xmx4096m android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX # Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL. -android.disableAutomaticComponentCreation=true \ No newline at end of file +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 070cb70..15de902 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/markdown/build.gradle b/markdown/build.gradle index b824ab9..9004604 100644 --- a/markdown/build.gradle +++ b/markdown/build.gradle @@ -3,14 +3,12 @@ apply plugin: 'kotlin-android' apply plugin: 'maven-publish' // needed for JitPack.io android { - compileSdkVersion 33 - buildToolsVersion "33.0.1" + compileSdk 34 + namespace 'it.niedermann.android.markdown' defaultConfig { - minSdkVersion 22 - targetSdkVersion 33 - versionCode version_code - versionName version_name + minSdk 22 + targetSdk 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -18,8 +16,12 @@ android { compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = '17' } testOptions { @@ -46,10 +48,10 @@ dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' api "com.github.nextcloud:Android-SingleSignOn:$sso_version" - implementation 'com.github.stefan-niedermann:android-commons:0.2.9' + implementation 'com.github.stefan-niedermann:android-commons:0.3.2' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.lifecycle:lifecycle-livedata:2.6.2' + implementation 'androidx.lifecycle:lifecycle-livedata:2.7.0' implementation 'org.jsoup:jsoup:1.17.2' diff --git a/markdown/src/main/AndroidManifest.xml b/markdown/src/main/AndroidManifest.xml index b4ee796..44008a4 100644 --- a/markdown/src/main/AndroidManifest.xml +++ b/markdown/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/sample/build.gradle b/sample/build.gradle index f82563c..bc8858a 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -4,13 +4,13 @@ plugins { } android { + compileSdk 34 namespace 'it.niedermann.nextcloud.sample' - compileSdk 33 defaultConfig { applicationId "it.niedermann.nextcloud.sample" minSdk 24 - targetSdk 33 + targetSdk 34 versionCode version_code versionName version_name @@ -24,23 +24,28 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + coreLibraryDesugaringEnabled true + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } + kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '17' } } dependencies { + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' implementation project(path: ':exception') implementation project(path: ':markdown') implementation project(path: ':sso-glide') - implementation 'androidx.core:core-ktx:1.10.1' + + implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.9.0' + implementation 'com.google.android.material:material:1.11.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' diff --git a/sample/src/main/java/it/niedermann/nextcloud/sample/MainActivity.kt b/sample/src/main/java/it/niedermann/nextcloud/sample/MainActivity.kt index 13bc1d8..9dffdea 100644 --- a/sample/src/main/java/it/niedermann/nextcloud/sample/MainActivity.kt +++ b/sample/src/main/java/it/niedermann/nextcloud/sample/MainActivity.kt @@ -2,6 +2,7 @@ package it.niedermann.nextcloud.sample import android.content.Intent import android.os.Bundle +import android.view.View import android.widget.Button import android.widget.TextView import androidx.appcompat.app.AppCompatActivity @@ -16,6 +17,7 @@ import it.niedermann.nextcloud.exception.ExceptionUtil class MainActivity : AppCompatActivity() { private lateinit var signOn: Button + private lateinit var currentUser: TextView private lateinit var sampleException: TextView private lateinit var markdownEditor: MarkdownEditor private lateinit var markdownViewer: MarkdownEditor @@ -26,6 +28,7 @@ class MainActivity : AppCompatActivity() { setContentView(R.layout.activity_main) signOn = findViewById(R.id.signOn) + currentUser = findViewById(R.id.currentUser) sampleException = findViewById(R.id.sampleException) markdownEditor = findViewById(R.id.markdown_editor) markdownViewer = findViewById(R.id.markdown_viewer) @@ -47,6 +50,8 @@ class MainActivity : AppCompatActivity() { AccountImporter.onActivityResult(requestCode, resultCode, data, this) { SingleAccountHelper.commitCurrentAccount(this, it.name) mentions[it.userId] = it.name + currentUser.text = it.name + currentUser.visibility = View.VISIBLE } } } \ No newline at end of file diff --git a/sample/src/main/res/layout/activity_main.xml b/sample/src/main/res/layout/activity_main.xml index cd3dc8f..f2c8d38 100644 --- a/sample/src/main/res/layout/activity_main.xml +++ b/sample/src/main/res/layout/activity_main.xml @@ -11,23 +11,33 @@ android:orientation="vertical" tools:context=".MainActivity"> - - + android:layout_height="wrap_content" + android:text="@string/sign_on" /> + + + + - - - @@ -54,8 +64,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - @@ -65,8 +75,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> - diff --git a/sso-glide/build.gradle b/sso-glide/build.gradle index 5b08f2c..94c04df 100644 --- a/sso-glide/build.gradle +++ b/sso-glide/build.gradle @@ -4,14 +4,12 @@ apply plugin: 'kotlin-kapt' apply plugin: 'maven-publish' // needed for JitPack.io android { - compileSdkVersion 33 - buildToolsVersion "33.0.1" + compileSdk 34 + namespace 'it.niedermann.nextcloud.sso.glide' defaultConfig { - minSdkVersion 22 - targetSdkVersion 33 - versionCode version_code - versionName version_name + minSdk 22 + targetSdk 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -19,8 +17,12 @@ android { compileOptions { coreLibraryDesugaringEnabled true - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = '17' } testOptions { @@ -61,7 +63,7 @@ dependencies { kapt 'com.github.bumptech.glide:compiler:4.16.0' testImplementation 'androidx.test:core:1.5.0' - testImplementation "io.mockk:mockk:1.13.7" + testImplementation "io.mockk:mockk:1.13.9" testImplementation 'junit:junit:4.13.2' testImplementation 'org.robolectric:robolectric:4.11.1' } diff --git a/sso-glide/src/main/AndroidManifest.xml b/sso-glide/src/main/AndroidManifest.xml index 32013a2..cc947c5 100644 --- a/sso-glide/src/main/AndroidManifest.xml +++ b/sso-glide/src/main/AndroidManifest.xml @@ -1 +1 @@ - +