mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 05:02:26 -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: '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
|
||||||
}
|
}
|
||||||
|
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: '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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user