AntennaPod/common.gradle

105 lines
2.7 KiB
Groovy
Raw Normal View History

android {
2022-02-09 17:28:40 +01:00
compileSdk 31
defaultConfig {
2022-12-18 13:48:31 +01:00
minSdk 21
2022-11-26 16:06:02 +01:00
targetSdk 31
2022-02-26 19:00:39 +01:00
multiDexEnabled true
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"
}
debug {
2022-07-18 08:15:09 +02:00
resValue "string", "app_name", "AntennaPod Debug"
}
}
packagingOptions {
exclude "META-INF/LICENSE.txt"
exclude "META-INF/NOTICE.txt"
2022-05-26 09:59:10 +02:00
// Extraneous jsoup files
exclude "META-INF/CHANGES"
exclude "META-INF/README.md"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
animationsDisabled = true
unitTests {
includeAndroidResources = true
}
}
lintOptions {
disable "GradleDependency"
checkDependencies true
warningsAsErrors true
abortOnError true
checkGeneratedSources = true
}
2021-07-22 22:48:48 +02:00
buildFeatures {
viewBinding true
}
}
tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "skipped", "passed", "failed"
showStandardStreams true
displayGranularity 2
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint"
}
}
apply plugin: 'com.github.spotbugs'
spotbugs {
effort = 'max'
reportLevel = 'medium'
excludeFilter = rootProject.file('config/spotbugs/exclude.xml')
ignoreFailures = true // Handled by printing task
}
gradle.taskGraph.beforeTask { task ->
if (task.name.toLowerCase().contains('spotbugs')) {
task.doLast {
def reportFile = task.project.file("build/reports/spotbugs/playDebug.xml")
if (!reportFile.exists()) return
2021-12-28 19:55:21 +01:00
def slurped = new groovy.xml.XmlSlurper().parse(reportFile)
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."))
}
}
}
}