Upgrade to gradle 8 (wip)

This commit is contained in:
José Rebelo 2024-04-07 14:55:05 +01:00
parent 75dc546aa9
commit 51be7682f1
4 changed files with 29 additions and 15 deletions

View File

@ -1,5 +1,3 @@
import com.github.spotbugs.SpotBugsTask
import java.nio.file.Files import java.nio.file.Files
apply plugin: "com.android.application" apply plugin: "com.android.application"
@ -202,6 +200,9 @@ android {
includeAndroidResources = true includeAndroidResources = true
} }
} }
buildFeatures {
aidl true
}
} }
pmd { pmd {
@ -317,8 +318,8 @@ task pmd(type: Pmd) {
exclude "**/gen/**" exclude "**/gen/**"
reports { reports {
xml.enabled = false //xml.enabled = false
html.enabled = true //html.enabled = true
xml { xml {
destination file("$project.buildDir/reports/pmd/pmd.xml") destination file("$project.buildDir/reports/pmd/pmd.xml")
} }
@ -336,19 +337,19 @@ sourceSets {
} }
spotbugs { spotbugs {
toolVersion = "3.1.12" toolVersion = "4.8.3"
ignoreFailures = !ABORT_ON_CHECK_FAILURE ignoreFailures = !ABORT_ON_CHECK_FAILURE
effort = "default" //effort = "default"
reportLevel = "medium" //reportLevel = "medium"
} }
tasks.withType(SpotBugsTask) { spotbugsMain {
source = fileTree('src/main/java') sourceDirs = fileTree('src/main/java')
classes = files("${project.rootDir}/app/build/intermediates/javac/debug/classes") classes = files("${project.rootDir}/app/build/intermediates/javac/debug/classes")
excludeFilter = new File("${project.rootDir}/config/findbugs/findbugs-filter.xml") excludeFilter = new File("${project.rootDir}/config/findbugs/findbugs-filter.xml")
reports { reports {
xml.enabled = false //xml.enabled = false
html.enabled = true //html.enabled = true
xml { xml {
destination file("$project.buildDir/reports/spotbugs/spotbugs-output.xml") destination file("$project.buildDir/reports/spotbugs/spotbugs-output.xml")
} }

View File

@ -9,10 +9,10 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.4.2' classpath 'com.android.tools.build:gradle:8.3.0'
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:2.0.0' classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.9'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17' classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }

View File

@ -19,3 +19,16 @@ org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF
# org.gradle.parallel=true # org.gradle.parallel=true
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
#
# AGP 8.x upgrade
#
# We do not use magen-publish
#android.disableAutomaticComponentCreation=true
# Keep the AGP 7.x defaults for now
android.enableR8.fullMode=false
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists