Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Android SDK 35, AGP 8.5, Build tools 35, by @gsantner, closes #2346, closes #2305 #2355

Merged
merged 6 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-android-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 10 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion app/src/flavorGplay/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<!-- Do NOT run auto format on this file -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.gsantner.markor"
tools:ignore="ObsoleteSdkInt"
tools:targetApi="jelly_bean">

Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<!-- Do NOT run auto format on this file -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.gsantner.markor"
tools:targetApi="jelly_bean">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Expand Down
8 changes: 3 additions & 5 deletions app/thirdparty-lib-src/QuadFlask-colorpicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion rootProject.ext.version_compileSdk
versionCode 11
versionName "0.0.11"
}
buildTypes {
release {
minifyEnabled false
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'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest package="com.flask.colorpicker">
<manifest>

<application/>

Expand Down
44 changes: 15 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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 }
}
}
}

Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=-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
Expand All @@ -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
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Loading