1
0
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:
cketti 2014-12-18 07:51:34 +01:00
parent fd02085946
commit 3f7fc83d58
4 changed files with 41 additions and 1 deletions

View File

@ -12,6 +12,7 @@ buildscript {
apply plugin: 'android-sdk-manager' apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'checkstyle' apply plugin: 'checkstyle'
apply plugin: 'findbugs'
repositories { repositories {
jcenter() jcenter()
@ -106,11 +107,25 @@ task checkstyle(type: Checkstyle) {
ignoreFailures = true ignoreFailures = true
configFile file("config/checkstyle/checkstyle.xml") configFile file("config/checkstyle/checkstyle.xml")
source 'src' source = project.android.sourceSets.main.java.getSrcDirs() +
project.android.sourceSets.androidTest.java.getSrcDirs()
include '**/*.java' include '**/*.java'
classpath = files() 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')) { if (project.hasProperty('keyAlias')) {
android.signingConfigs.release.keyAlias = keyAlias android.signingConfigs.release.keyAlias = keyAlias
} }

View File

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<FindBugsFilter>
<Match>
<Class name="~com\.fsck\.k9\.R.*" />
</Match>
<Match>
<Class name="~android\..*" />
</Match>
</FindBugsFilter>

View File

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<FindBugsFilter>
<Match>
<Package name="~com\.fsck\.k9.*" />
</Match>
</FindBugsFilter>

View File

@ -3,6 +3,7 @@ repositories {
} }
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'findbugs'
dependencies { dependencies {
testCompile project(':') 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' test.dependsOn ':compileDebugJava'
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {