From 94dbfff8e13ed1310e77a98901e3d1f40bac913f Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Sat, 20 Jul 2024 17:02:49 +0200 Subject: [PATCH 1/6] Upgrade to Android SDK 35, AGP 8.5, Build tools 35, by @gsantner, closes #2346, closes #2305 --- app/build.gradle | 19 ++++---- app/src/flavorGplay/AndroidManifest.xml | 1 - app/src/main/AndroidManifest.xml | 1 - .../QuadFlask-colorpicker/build.gradle | 8 ++-- .../src/main/AndroidManifest.xml | 2 +- build.gradle | 44 +++++++------------ gradle.properties | 3 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- 8 files changed, 33 insertions(+), 47 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 20a16c89eb..590156b72d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,8 +35,8 @@ android { buildConfigField "boolean", "IS_GPLAY_BUILD", "false" buildConfigField "String[]", "DETECTED_ANDROID_LOCALES", "${findUsedAndroidLocales()}" buildConfigField "String", "BUILD_DATE", "\"${getBuildDate()}\"" - buildConfigField "String", "GITHASH", "\"${getGitHash()}\"" - buildConfigField "String", "GITMSG", "\"${getGitLastCommitMessage()}\"" + buildConfigField "String", "GITHASH", "\"${getGitHash}\"" + buildConfigField "String", "GITMSG", "\"${getGitLastCommitMessage}\"" setProperty("archivesBaseName", applicationId + "-v" + versionCode + "-" + versionName) } @@ -71,23 +71,24 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } - packagingOptions { - exclude 'META-INF/LICENSE-LGPL-2.1.txt' - exclude 'META-INF/LICENSE-LGPL-3.txt' - exclude 'META-INF/LICENSE-W3C-TEST' + resources { + excludes += ['META-INF/LICENSE-LGPL-2.1.txt', 'META-INF/LICENSE-LGPL-3.txt', 'META-INF/LICENSE-W3C-TEST'] + } } + compileOptions { encoding = 'UTF-8' sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - - lintOptions { - disable 'MissingTranslation', 'InvalidPackage', 'ObsoleteLintCustomCheck', 'DefaultLocale', 'UnusedAttribute', 'VectorRaster', 'InflateParams', 'IconLocation', 'UnusedResources', 'TypographyEllipsis' + namespace 'net.gsantner.markor' + lint { abortOnError false + disable 'MissingTranslation', 'InvalidPackage', 'ObsoleteLintCustomCheck', 'DefaultLocale', 'UnusedAttribute', 'VectorRaster', 'InflateParams', 'IconLocation', 'UnusedResources', 'TypographyEllipsis' } + } dependencies { diff --git a/app/src/flavorGplay/AndroidManifest.xml b/app/src/flavorGplay/AndroidManifest.xml index d72c0bd4e3..fa3212606e 100644 --- a/app/src/flavorGplay/AndroidManifest.xml +++ b/app/src/flavorGplay/AndroidManifest.xml @@ -11,7 +11,6 @@ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 99e65806cc..ce51fec55a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,7 +12,6 @@ diff --git a/app/thirdparty-lib-src/QuadFlask-colorpicker/build.gradle b/app/thirdparty-lib-src/QuadFlask-colorpicker/build.gradle index eefb417506..fa244b77e6 100644 --- a/app/thirdparty-lib-src/QuadFlask-colorpicker/build.gradle +++ b/app/thirdparty-lib-src/QuadFlask-colorpicker/build.gradle @@ -7,8 +7,6 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion rootProject.ext.version_compileSdk - versionCode 11 - versionName "0.0.11" } buildTypes { release { @@ -16,11 +14,11 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } - lintOptions { - disable 'MissingTranslation', 'InvalidPackage', 'ObsoleteLintCustomCheck', 'DefaultLocale', 'UnusedAttribute', 'VectorRaster', 'InflateParams', 'IconLocation', 'UnusedResources', 'TypographyEllipsis' + namespace 'com.flask.colorpicker' + lint { abortOnError false checkReleaseBuilds false - tasks.lint.enabled = false + disable 'MissingTranslation', 'InvalidPackage', 'ObsoleteLintCustomCheck', 'DefaultLocale', 'UnusedAttribute', 'VectorRaster', 'InflateParams', 'IconLocation', 'UnusedResources', 'TypographyEllipsis' } } diff --git a/app/thirdparty-lib-src/QuadFlask-colorpicker/src/main/AndroidManifest.xml b/app/thirdparty-lib-src/QuadFlask-colorpicker/src/main/AndroidManifest.xml index 804b8ac15e..695cf9443a 100644 --- a/app/thirdparty-lib-src/QuadFlask-colorpicker/src/main/AndroidManifest.xml +++ b/app/thirdparty-lib-src/QuadFlask-colorpicker/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ - + diff --git a/build.gradle b/build.gradle index c7cb42ac49..474c598198 100644 --- a/build.gradle +++ b/build.gradle @@ -10,12 +10,12 @@ import java.text.SimpleDateFormat buildscript { ext { - version_gradle_tools = "7.2.2" + version_gradle_tools = '8.5.1' version_plugin_kotlin = "1.3.72" enable_plugin_kotlin = false - version_compileSdk = 33 - version_buildTools = "33.0.0" + version_compileSdk = 35 + version_buildTools = "35.0.0" version_minSdk = 17 } @@ -54,8 +54,10 @@ allprojects { tasks.matching { it instanceof Test }.all { // Enable unit test output, html+xml output testLogging.events "passed", "skipped", "failed", "standardOut", "standardError" testLogging.showStandardStreams = true - reports.junitXml.enabled = true - reports.html.enabled = true + reports{ + junitXml { enabled true } + html { enabled true } + } } } @@ -88,31 +90,15 @@ static String findUsedAndroidLocales() { return '{' + langs.sort().collect { "\"${it}\"" }.join(",") + '}' } -ext.getGitHash = { -> - try { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'rev-parse', 'HEAD' - standardOutput = stdout - } - return stdout.toString().trim() - } catch (Exception ignored) { - return 'unknown' - } -} -ext.getGitLastCommitMessage = { -> - try { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'log', '--oneline', '-1', '--format="%s"' - standardOutput = stdout - } - return stdout.toString().replace("\"", "").replace("\\", "").trim() - } catch (Exception ignored) { - return 'unknown' - } -} + +ext.getGitHash = providers.exec { + commandLine('git', 'rev-parse', 'HEAD') +}.standardOutput.asText.get().trim() + +ext.getGitLastCommitMessage = providers.exec { + commandLine('git', 'log', '--oneline', '-1', '--format="%s"') +}.standardOutput.asText.get().replace("\"", "").replace("\\", "").trim() @SuppressWarnings(["UnnecessaryQualifiedReference", "SpellCheckingInspection", "GroovyUnusedDeclaration"]) // Returns the build date in a RFC3339 compatible format. TZ is always converted to UTC diff --git a/gradle.properties b/gradle.properties index f4bf98fb81..b9403ec1fe 100755 --- a/gradle.properties +++ b/gradle.properties @@ -29,4 +29,7 @@ org.gradle.configureondemand=true # androidX android.useAndroidX=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false #android.enableJetifier=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5b4312d37d..148fca95d1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Thu Dec 02 03:48:33 CET 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From 525674691458d289a9672f2a5ec9fc9448ea8004 Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Sat, 20 Jul 2024 17:06:35 +0200 Subject: [PATCH 2/6] ci use java 21 --- .github/workflows/build-android-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-android-project.yml b/.github/workflows/build-android-project.yml index c2da451111..1639b07438 100644 --- a/.github/workflows/build-android-project.yml +++ b/.github/workflows/build-android-project.yml @@ -34,7 +34,7 @@ jobs: - name: "Setup: Java" uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 21 distribution: "temurin" - name: "Setup: Install additional dependencies" From 7ea304232cf96d0b1efc3787c858cc3386334e44 Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Sat, 20 Jul 2024 17:08:10 +0200 Subject: [PATCH 3/6] java maxpermsize remove --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b9403ec1fe..ef2bf8b0a5 100755 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ org.gradle.daemon=true # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m -org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -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 From a39805fbacfda3277ec2b09a2f19b501e96288a4 Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Sat, 20 Jul 2024 17:16:23 +0200 Subject: [PATCH 4/6] 17 --- .github/workflows/build-android-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-android-project.yml b/.github/workflows/build-android-project.yml index 1639b07438..8344d444bb 100644 --- a/.github/workflows/build-android-project.yml +++ b/.github/workflows/build-android-project.yml @@ -34,7 +34,7 @@ jobs: - name: "Setup: Java" uses: actions/setup-java@v4 with: - java-version: 21 + java-version: 17 distribution: "temurin" - name: "Setup: Install additional dependencies" From dd6acac2689e576fafebf2b5192898e3b7e5f094 Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Sat, 20 Jul 2024 17:22:08 +0200 Subject: [PATCH 5/6] java maxpermsize remove --- .github/workflows/build-android-project.yml | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-android-project.yml b/.github/workflows/build-android-project.yml index 8344d444bb..1639b07438 100644 --- a/.github/workflows/build-android-project.yml +++ b/.github/workflows/build-android-project.yml @@ -34,7 +34,7 @@ jobs: - name: "Setup: Java" uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: "temurin" - name: "Setup: Install additional dependencies" diff --git a/gradle.properties b/gradle.properties index ef2bf8b0a5..25e0cbcdc9 100755 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ org.gradle.daemon=true # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m -org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xms2048m -Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -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 From c6927b80797ba3e9d2d66b986530a2027713400d Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Sat, 20 Jul 2024 17:24:34 +0200 Subject: [PATCH 6/6] java maxpermsize remove --- app/proguard-rules.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 206a4aa194..f3db83b2bd 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -15,3 +15,9 @@ #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} + + +# > Task :app:minifyFlavorAtestReleaseWithR8 FAILED +# ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /home/runner/work/markor/markor/app/build/outputs/mapping/flavorAtestRelease/missing_rules.txt. +# ERROR: R8: Missing class java.awt.AlphaComposite (referenced from: java.awt.image.BufferedImage com.vladsch.flexmark.util.ImageUtils.makeRoundedCorner(java.awt.image.BufferedImage, int, int) and 1 other context) +-ignorewarnings