2021-05-11 22:14:56 +02:00
|
|
|
android {
|
2021-10-28 23:20:23 +02:00
|
|
|
compileSdkVersion 31
|
2021-05-11 22:14:56 +02:00
|
|
|
|
|
|
|
defaultConfig {
|
2021-11-02 21:26:13 +01:00
|
|
|
minSdkVersion 19
|
2021-05-11 22:14:56 +02:00
|
|
|
targetSdkVersion 30
|
|
|
|
|
|
|
|
multiDexEnabled false
|
|
|
|
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"
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
debug {
|
|
|
|
// debug build has method count over 64k single-dex threshold.
|
|
|
|
// For building debug build to use on Android < 21 (pre-Android 5) devices,
|
|
|
|
// you need to manually change class
|
|
|
|
// de.danoeh.antennapod.PodcastApp to extend MultiDexApplication .
|
|
|
|
// See Issue #2813
|
|
|
|
multiDexEnabled true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
packagingOptions {
|
|
|
|
exclude "META-INF/LICENSE.txt"
|
|
|
|
exclude "META-INF/NOTICE.txt"
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2021-05-11 22:14:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
2021-05-11 22:14:56 +02: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."))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|