-
Notifications
You must be signed in to change notification settings - Fork 22
/
findbugs.gradle
34 lines (26 loc) · 867 Bytes
/
findbugs.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
apply plugin: 'findbugs'
afterEvaluate {
def variants = plugins.hasPlugin('com.android.application') ?
android.applicationVariants : android.libraryVariants
variants.each { variant ->
def task = tasks.create("findBugs${variant.name.capitalize()}", FindBugs)
task.group = 'verification'
task.description = "Run FindBugs for the ${variant.description}."
task.effort = 'max'
task.reportLevel = 'high'
task.reports {
xml {
enabled = false
}
html {
enabled = true
}
}
def variantCompile = variant.javaCompile
task.classes = fileTree(variantCompile.destinationDir)
task.source = variantCompile.source
task.classpath = variantCompile.classpath.plus(project.files(android.bootClasspath))
task.dependsOn(variantCompile)
tasks.getByName('check').dependsOn(task)
}
}