From 6ca1f2792fc1c139777c0739cd089679314d18a7 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Thu, 3 Aug 2023 00:41:27 +0800 Subject: [PATCH] Bump to AGP and Gradle 8.x Disable new R8 mode and resource namespacing for now to avoid build failures. These needs to be worked on before they can be enabled. Signed-off-by: Aayush Gupta --- .github/workflows/client.yml | 2 +- app/build.gradle | 2 +- build.gradle | 6 +++--- gradle.properties | 2 ++ gradle/wrapper/gradle-wrapper.properties | 4 ++-- storage/demo/build.gradle | 17 ++++++++++++----- storage/lib/build.gradle | 2 +- storage/lib/proguard-rules.pro | 3 +++ 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml index 6164d693..370d72d3 100644 --- a/.github/workflows/client.yml +++ b/.github/workflows/client.yml @@ -29,7 +29,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Build run: ./gradlew compileDebugAndroidTestSources check assemble ktlintCheck diff --git a/app/build.gradle b/app/build.gradle index cdba3720..4dd63698 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,7 +31,7 @@ android { } } - lintOptions { + lint { disable "DialogFragmentCallbacksDetector", "InvalidFragmentVersionForActivityResult", "CheckedExceptions" diff --git a/build.gradle b/build.gradle index b25c5dd0..2a1fe90f 100644 --- a/build.gradle +++ b/build.gradle @@ -10,9 +10,9 @@ buildscript { } plugins { - id 'com.android.application' version '7.4.2' apply false - id 'com.android.library' version '7.4.2' apply false - id 'com.google.protobuf' version '0.8.17' apply false + id 'com.android.application' version '8.1.0' apply false + id 'com.android.library' version '8.1.0' apply false + id 'com.google.protobuf' version '0.9.4' apply false id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false id 'org.jetbrains.kotlin.kapt' version "$kotlin_version" apply false id 'org.jetbrains.dokka' version "$kotlin_version" apply false diff --git a/gradle.properties b/gradle.properties index 38138b6a..c6adc6da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,3 +3,5 @@ org.gradle.configureondemand=true android.useAndroidX=true android.enableJetifier=false kotlin.code.style=official +android.nonTransitiveRClass=false +android.enableR8.fullMode=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f94e57ef..457baeb2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ #Fri Aug 19 10:56:09 IST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionSha256Sum=03ec176d388f2aa99defcadc3ac6adf8dd2bce5145a129659537c0874dea5ad1 diff --git a/storage/demo/build.gradle b/storage/demo/build.gradle index 75aa450e..ead579ac 100644 --- a/storage/demo/build.gradle +++ b/storage/demo/build.gradle @@ -39,15 +39,22 @@ android { jvmTarget = JavaVersion.VERSION_11.toString() freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" } - lintOptions { + lint { disable "DialogFragmentCallbacksDetector", "InvalidFragmentVersionForActivityResult" } packagingOptions { - exclude 'META-INF/*.kotlin_module' - exclude 'META-INF/androidx.*.version' - exclude 'META-INF/services/kotlin*' - exclude 'kotlin/internal/internal.kotlin_builtins' + jniLibs { + excludes += ['META-INF/services/kotlin*'] + } + resources { + excludes += [ + 'META-INF/*.kotlin_module', + 'META-INF/androidx.*.version', + 'META-INF/services/kotlin*', + 'kotlin/internal/internal.kotlin_builtins' + ] + } } } diff --git a/storage/lib/build.gradle b/storage/lib/build.gradle index 3df7ed72..861ca2ab 100644 --- a/storage/lib/build.gradle +++ b/storage/lib/build.gradle @@ -62,7 +62,7 @@ android { } } } - lintOptions { + lint { disable "DialogFragmentCallbacksDetector", "InvalidFragmentVersionForActivityResult", "CheckedExceptions" diff --git a/storage/lib/proguard-rules.pro b/storage/lib/proguard-rules.pro index 689bda54..a310d663 100644 --- a/storage/lib/proguard-rules.pro +++ b/storage/lib/proguard-rules.pro @@ -24,3 +24,6 @@ #-renamesourcefileattribute SourceFile -keep class org.calyxos.backup.storage.** {*;} + +# Ignore StringConcatFactory +-dontwarn java.lang.invoke.StringConcatFactory