2021-05-11 22:14:56 +02:00
|
|
|
android {
|
2023-04-03 21:51:54 +02:00
|
|
|
compileSdk 33
|
2021-05-11 22:14:56 +02:00
|
|
|
|
|
|
|
defaultConfig {
|
2022-12-18 13:48:31 +01:00
|
|
|
minSdk 21
|
2023-04-03 21:51:54 +02:00
|
|
|
targetSdk 33
|
2021-05-11 22:14:56 +02:00
|
|
|
|
|
|
|
vectorDrawables.useSupportLibrary true
|
|
|
|
vectorDrawables.generatedDensities = []
|
|
|
|
|
|
|
|
testApplicationId "de.danoeh.antennapod.core.tests"
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
release {
|
2021-06-17 08:37:31 +02:00
|
|
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard.cfg"
|
2022-07-18 08:15:09 +02:00
|
|
|
resValue "string", "app_name", "AntennaPod"
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
debug {
|
2022-07-18 08:15:09 +02:00
|
|
|
resValue "string", "app_name", "AntennaPod Debug"
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
2023-04-01 23:16:53 +02:00
|
|
|
resources {
|
|
|
|
excludes += ["META-INF/LICENSE.txt",
|
|
|
|
"META-INF/NOTICE.txt",
|
|
|
|
"META-INF/CHANGES",
|
|
|
|
"META-INF/README.md"]
|
|
|
|
}
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
2023-04-01 23:16:53 +02:00
|
|
|
sourceCompatibility JavaVersion.VERSION_11
|
|
|
|
targetCompatibility JavaVersion.VERSION_11
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
testOptions {
|
|
|
|
animationsDisabled = true
|
|
|
|
unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-01 23:16:53 +02:00
|
|
|
lint {
|
2021-05-11 22:14:56 +02:00
|
|
|
disable "GradleDependency"
|
|
|
|
checkDependencies true
|
|
|
|
warningsAsErrors true
|
|
|
|
abortOnError true
|
|
|
|
checkGeneratedSources = true
|
|
|
|
}
|
|
|
|
|
2021-07-22 22:48:48 +02:00
|
|
|
buildFeatures {
|
|
|
|
viewBinding true
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-25 13:39:44 +01:00
|
|
|
tasks.withType(Test).configureEach {
|
2021-05-11 22:14:56 +02:00
|
|
|
testLogging {
|
|
|
|
exceptionFormat "full"
|
|
|
|
events "skipped", "passed", "failed"
|
|
|
|
showStandardStreams true
|
|
|
|
displayGranularity 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gradle.projectsEvaluated {
|
2024-02-25 13:39:44 +01:00
|
|
|
tasks.withType(JavaCompile).tap {
|
|
|
|
configureEach {
|
|
|
|
options.compilerArgs << "-Xlint"
|
|
|
|
}
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'com.github.spotbugs'
|
|
|
|
|
|
|
|
spotbugs {
|
|
|
|
effort = 'max'
|
|
|
|
reportLevel = 'medium'
|
|
|
|
excludeFilter = rootProject.file('config/spotbugs/exclude.xml')
|
|
|
|
ignoreFailures = true // Handled by printing task
|
|
|
|
}
|
|
|
|
|
2024-02-25 13:39:44 +01:00
|
|
|
gradle.taskGraph.whenReady { taskGraph ->
|
|
|
|
taskGraph.allTasks.each { task ->
|
|
|
|
if (task.name.toLowerCase().contains('spotbugs')) {
|
|
|
|
task.doLast {
|
|
|
|
def reportFile = task.project.file("build/reports/spotbugs/playDebug.xml")
|
|
|
|
if (!reportFile.exists()) return
|
|
|
|
def slurped = new groovy.xml.XmlSlurper().parse(reportFile)
|
2021-05-11 22:14:56 +02:00
|
|
|
|
2024-02-25 13:39:44 +01:00
|
|
|
def foundErrors = false
|
|
|
|
slurped['BugInstance'].each { bug ->
|
|
|
|
logger.error "[SpotBugs] ${bug['LongMessage']} [${bug.@'type'}]"
|
|
|
|
bug['SourceLine'].each { line ->
|
|
|
|
logger.error "[SpotBugs] ${line['Message']}"
|
|
|
|
foundErrors = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (foundErrors) {
|
|
|
|
throw new TaskExecutionException(task,
|
|
|
|
new Exception("SpotBugs violations were found. See output above for details."))
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|