-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathjava-setup.gradle
43 lines (39 loc) · 1.21 KB
/
java-setup.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
35
36
37
38
39
40
41
42
43
//////////
// JAVA //
//////////
// setup java
apply plugin: 'java'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release = Integer.parseInt(VER_JAVA)
}
//////////////
// SPOTBUGS //
//////////////
apply plugin: 'com.github.spotbugs'
spotbugs {
ignoreFailures = false // bug free or it doesn't ship!
// LOW|MEDIUM|DEFAULT|HIGH (low = sensitive to even minor mistakes).
reportLevel = com.github.spotbugs.snom.Confidence.valueOf('MEDIUM')
omitVisitors = [
// https://spotbugs.readthedocs.io/en/latest/detectors.html#constructorthrow
'ConstructorThrow',
// https://spotbugs.readthedocs.io/en/latest/detectors.html#findreturnref
'FindReturnRef',
]
}
tasks.named('spotbugsTest') {
enabled = false
}
tasks.withType(com.github.spotbugs.snom.SpotBugsTask).configureEach {
outputs.file(project.layout.buildDirectory.file("reports/spotbugs/${it.name}.html"))
outputs.file(project.layout.buildDirectory.file("spotbugs/auxclasspath/${it.name}"))
reports {
html.enabled = true
}
}
dependencies {
compileOnly 'net.jcip:jcip-annotations:1.0'
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}"
compileOnly "com.google.code.findbugs:jsr305:${VER_JSR_305}"
}