Skip to content

Commit ecc2014

Browse files
Merge pull request #2937 from davidmoten/findbugs
Add code quality plugins to build.gradle (jacoco, findbugs)
2 parents 0855972 + fa0dba2 commit ecc2014

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

build.gradle

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,49 @@ description = 'RxJava: Reactive Extensions for the JVM – a library for composi
77

88
apply plugin: 'rxjava-project'
99
apply plugin: 'java'
10+
apply plugin: 'findbugs'
11+
apply plugin: 'jacoco'
1012

1113
dependencies {
1214
testCompile 'junit:junit-dep:4.10'
1315
testCompile 'org.mockito:mockito-core:1.8.5'
1416
}
1517

18+
////////////////////////////////////////////////////////////////////
19+
// to run findbugs:
20+
// ./gradlew check
21+
// then open build/reports/findbugs/main.html
22+
////////////////////////////////////////////////////////////////////
23+
24+
findbugs {
25+
ignoreFailures = true
26+
toolVersion = "+"
27+
sourceSets = [sourceSets.main]
28+
reportsDir = file("$project.buildDir/reports/findbugs")
29+
effort = "max"
30+
}
31+
32+
//////////////////////////////////////////////////////////////////
33+
// to run jacoco:
34+
// ./gradlew test jacocoTestReport
35+
// to run jacoco on a single test (matches OperatorRetry to OperatorRetryTest in test code base):
36+
// ./gradlew -Dtest.single=OperatorRetry test jacocoTestReport
37+
// then open build/reports/jacoco/index.html
38+
/////////////////////////////////////////////////////////////////
39+
40+
jacoco {
41+
toolVersion = "+"
42+
reportsDir = file("$buildDir/customJacocoReportDir")
43+
}
44+
45+
jacocoTestReport {
46+
reports {
47+
xml.enabled false
48+
csv.enabled false
49+
html.destination "${buildDir}/reports/jacoco"
50+
}
51+
}
52+
1653
javadoc {
1754
exclude "**/rx/internal/**"
1855
}
@@ -30,3 +67,10 @@ if (project.hasProperty('release.useLastTag')) {
3067
test{
3168
maxHeapSize = "2g"
3269
}
70+
71+
tasks.withType(FindBugs) {
72+
reports {
73+
xml.enabled = false
74+
html.enabled = true
75+
}
76+
}

0 commit comments

Comments
 (0)