|
@@ -17,6 +17,7 @@ buildscript {
|
|
|
|
|
|
plugins {
|
|
plugins {
|
|
id "com.diffplug.spotless" version "6.20.0"
|
|
id "com.diffplug.spotless" version "6.20.0"
|
|
|
|
+ id 'com.google.devtools.ksp' version '1.8.22-1.0.11' apply false
|
|
}
|
|
}
|
|
|
|
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'com.android.application'
|
|
@@ -30,11 +31,13 @@ apply from: "$rootProject.projectDir/jacoco.gradle"
|
|
apply plugin: 'com.github.spotbugs'
|
|
apply plugin: 'com.github.spotbugs'
|
|
apply plugin: 'io.gitlab.arturbosch.detekt'
|
|
apply plugin: 'io.gitlab.arturbosch.detekt'
|
|
apply plugin: 'shot'
|
|
apply plugin: 'shot'
|
|
|
|
+apply plugin: 'com.google.devtools.ksp'
|
|
|
|
+
|
|
|
|
|
|
println "Gradle uses Java ${Jvm.current()}"
|
|
println "Gradle uses Java ${Jvm.current()}"
|
|
|
|
|
|
configurations {
|
|
configurations {
|
|
- all {
|
|
|
|
|
|
+ configureEach {
|
|
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly
|
|
exclude group: 'org.jetbrains', module: 'annotations-java5' // via prism4j, already using annotations explicitly
|
|
|
|
|
|
// check for updates every build
|
|
// check for updates every build
|
|
@@ -71,8 +74,6 @@ file("$project.rootDir/ndk.env").readLines().each() {
|
|
def perfAnalysis = project.hasProperty('perfAnalysis')
|
|
def perfAnalysis = project.hasProperty('perfAnalysis')
|
|
|
|
|
|
android {
|
|
android {
|
|
-
|
|
|
|
- compileSdkVersion 33
|
|
|
|
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
|
|
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
|
|
ndkVersion "${ndkEnv.get("NDK_VERSION")}"
|
|
ndkVersion "${ndkEnv.get("NDK_VERSION")}"
|
|
|
|
|
|
@@ -84,6 +85,7 @@ android {
|
|
defaultConfig {
|
|
defaultConfig {
|
|
minSdkVersion 24
|
|
minSdkVersion 24
|
|
targetSdkVersion 33
|
|
targetSdkVersion 33
|
|
|
|
+ compileSdk 33
|
|
|
|
|
|
buildConfigField 'boolean', 'CI', ciBuild.toString()
|
|
buildConfigField 'boolean', 'CI', ciBuild.toString()
|
|
buildConfigField 'boolean', 'RUNTIME_PERF_ANALYSIS', perfAnalysis.toString()
|
|
buildConfigField 'boolean', 'RUNTIME_PERF_ANALYSIS', perfAnalysis.toString()
|
|
@@ -116,7 +118,7 @@ android {
|
|
// adapt structure from Eclipse to Gradle/Android Studio expectations;
|
|
// adapt structure from Eclipse to Gradle/Android Studio expectations;
|
|
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
|
|
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
|
|
|
|
|
|
- flavorDimensions "default"
|
|
|
|
|
|
+ flavorDimensions += "default"
|
|
|
|
|
|
buildTypes {
|
|
buildTypes {
|
|
debug {
|
|
debug {
|
|
@@ -191,8 +193,8 @@ android {
|
|
exclude '**/gen/**'
|
|
exclude '**/gen/**'
|
|
|
|
|
|
reports {
|
|
reports {
|
|
- xml.enabled = false
|
|
|
|
- html.enabled = true
|
|
|
|
|
|
+ //xml.enabled = false
|
|
|
|
+ //html.enabled = true
|
|
xml {
|
|
xml {
|
|
destination = file("$project.buildDir/reports/pmd/pmd.xml")
|
|
destination = file("$project.buildDir/reports/pmd/pmd.xml")
|
|
}
|
|
}
|
|
@@ -379,7 +381,7 @@ dependencies {
|
|
implementation 'com.github.nextcloud.android-common:ui:0.12.0'
|
|
implementation 'com.github.nextcloud.android-common:ui:0.12.0'
|
|
|
|
|
|
implementation "androidx.room:room-runtime:$roomVersion"
|
|
implementation "androidx.room:room-runtime:$roomVersion"
|
|
- kapt "androidx.room:room-compiler:$roomVersion"
|
|
|
|
|
|
+ ksp "androidx.room:room-compiler:$roomVersion"
|
|
androidTestImplementation "androidx.room:room-testing:$roomVersion"
|
|
androidTestImplementation "androidx.room:room-testing:$roomVersion"
|
|
|
|
|
|
implementation "io.coil-kt:coil:2.4.0"
|
|
implementation "io.coil-kt:coil:2.4.0"
|
|
@@ -388,7 +390,7 @@ dependencies {
|
|
implementation 'androidx.core:core-splashscreen:1.0.1'
|
|
implementation 'androidx.core:core-splashscreen:1.0.1'
|
|
}
|
|
}
|
|
|
|
|
|
-configurations.all {
|
|
|
|
|
|
+configurations.configureEach {
|
|
resolutionStrategy {
|
|
resolutionStrategy {
|
|
cacheChangingModulesFor 0, 'seconds'
|
|
cacheChangingModulesFor 0, 'seconds'
|
|
force 'org.objenesis:objenesis:2.6'
|
|
force 'org.objenesis:objenesis:2.6'
|
|
@@ -400,15 +402,15 @@ configurations.all {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-tasks.withType(Test) {
|
|
|
|
|
|
+tasks.withType(Test).configureEach {
|
|
// increased logging for tests
|
|
// increased logging for tests
|
|
testLogging {
|
|
testLogging {
|
|
events "passed", "skipped", "failed"
|
|
events "passed", "skipped", "failed"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-android.applicationVariants.all { variant ->
|
|
|
|
- variant.outputs.all { output ->
|
|
|
|
|
|
+android.applicationVariants.configureEach { variant ->
|
|
|
|
+ variant.outputs.configureEach { output ->
|
|
outputFileName = "${output.baseName}-${variant.versionCode}.apk"
|
|
outputFileName = "${output.baseName}-${variant.versionCode}.apk"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -421,12 +423,7 @@ spotless {
|
|
}
|
|
}
|
|
|
|
|
|
detekt {
|
|
detekt {
|
|
- reports {
|
|
|
|
- xml {
|
|
|
|
- enabled = false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- config = files("detekt.yml")
|
|
|
|
|
|
+ config.setFrom("detekt.yml")
|
|
}
|
|
}
|
|
|
|
|
|
shot {
|
|
shot {
|
|
@@ -446,13 +443,13 @@ spotbugs {
|
|
reportLevel = "medium"
|
|
reportLevel = "medium"
|
|
}
|
|
}
|
|
|
|
|
|
-tasks.withType(SpotBugsTask) { task ->
|
|
|
|
|
|
+tasks.withType(SpotBugsTask).configureEach { task ->
|
|
String variantNameCap = task.name.replace("spotbugs", "")
|
|
String variantNameCap = task.name.replace("spotbugs", "")
|
|
String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1)
|
|
String variantName = variantNameCap.substring(0, 1).toLowerCase() + variantNameCap.substring(1)
|
|
|
|
|
|
dependsOn "compile${variantNameCap}Sources"
|
|
dependsOn "compile${variantNameCap}Sources"
|
|
|
|
|
|
- excludeFilter = file("${project.rootDir}/spotbugs-filter.xml")
|
|
|
|
|
|
+ excludeFilter.set(file("${project.rootDir}/spotbugs-filter.xml"))
|
|
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
|
|
classes = fileTree("$project.buildDir/intermediates/javac/${variantName}/classes/")
|
|
reports {
|
|
reports {
|
|
xml {
|
|
xml {
|
|
@@ -465,3 +462,7 @@ tasks.withType(SpotBugsTask) { task ->
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ksp {
|
|
|
|
+ arg('room.schemaLocation', "$projectDir/schemas")
|
|
|
|
+}
|