mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 03:32:16 -05:00
Add findbugs to Gradle build
This commit is contained in:
parent
fd02085946
commit
3f7fc83d58
17
build.gradle
17
build.gradle
@ -12,6 +12,7 @@ buildscript {
|
||||
apply plugin: 'android-sdk-manager'
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'checkstyle'
|
||||
apply plugin: 'findbugs'
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
@ -106,11 +107,25 @@ task checkstyle(type: Checkstyle) {
|
||||
ignoreFailures = true
|
||||
configFile file("config/checkstyle/checkstyle.xml")
|
||||
|
||||
source 'src'
|
||||
source = project.android.sourceSets.main.java.getSrcDirs() +
|
||||
project.android.sourceSets.androidTest.java.getSrcDirs()
|
||||
include '**/*.java'
|
||||
classpath = files()
|
||||
}
|
||||
|
||||
check.dependsOn 'findbugs'
|
||||
task findbugs(type: FindBugs, dependsOn: [':compileDebugJava', ':compileDebugTestJava']) {
|
||||
ignoreFailures = true
|
||||
classes = fileTree('build/intermediates/classes/debug/') +
|
||||
fileTree('build/intermediates/classes/test/debug/')
|
||||
source = project.android.sourceSets.main.java.getSrcDirs() +
|
||||
project.android.sourceSets.androidTest.java.getSrcDirs()
|
||||
classpath = files()
|
||||
effort = 'max'
|
||||
includeFilter = file("$rootProject.projectDir/config/findbugs/include_filter.xml")
|
||||
excludeFilter = file("$rootProject.projectDir/config/findbugs/exclude_filter.xml")
|
||||
}
|
||||
|
||||
if (project.hasProperty('keyAlias')) {
|
||||
android.signingConfigs.release.keyAlias = keyAlias
|
||||
}
|
||||
|
9
config/findbugs/exclude_filter.xml
Normal file
9
config/findbugs/exclude_filter.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<FindBugsFilter>
|
||||
<Match>
|
||||
<Class name="~com\.fsck\.k9\.R.*" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Class name="~android\..*" />
|
||||
</Match>
|
||||
</FindBugsFilter>
|
6
config/findbugs/include_filter.xml
Normal file
6
config/findbugs/include_filter.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<FindBugsFilter>
|
||||
<Match>
|
||||
<Package name="~com\.fsck\.k9.*" />
|
||||
</Match>
|
||||
</FindBugsFilter>
|
@ -3,6 +3,7 @@ repositories {
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'findbugs'
|
||||
|
||||
dependencies {
|
||||
testCompile project(':')
|
||||
@ -27,6 +28,15 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
findbugs {
|
||||
ignoreFailures = true
|
||||
effort = 'max'
|
||||
includeFilter = file("$rootProject.projectDir/config/findbugs/include_filter.xml")
|
||||
excludeFilter = file("$rootProject.projectDir/config/findbugs/exclude_filter.xml")
|
||||
}
|
||||
|
||||
check.dependsOn 'findbugsTest'
|
||||
|
||||
test.dependsOn ':compileDebugJava'
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
|
Loading…
Reference in New Issue
Block a user