Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code quality plugins to build.gradle (jacoco, findbugs) #2937

Merged
merged 1 commit into from
May 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,49 @@ description = 'RxJava: Reactive Extensions for the JVM – a library for composi

apply plugin: 'rxjava-project'
apply plugin: 'java'
apply plugin: 'findbugs'
apply plugin: 'jacoco'

dependencies {
testCompile 'junit:junit-dep:4.10'
testCompile 'org.mockito:mockito-core:1.8.5'
}

////////////////////////////////////////////////////////////////////
// to run findbugs:
// ./gradlew check
// then open build/reports/findbugs/main.html
////////////////////////////////////////////////////////////////////

findbugs {
ignoreFailures = true
toolVersion = "+"
sourceSets = [sourceSets.main]
reportsDir = file("$project.buildDir/reports/findbugs")
effort = "max"
}

//////////////////////////////////////////////////////////////////
// to run jacoco:
// ./gradlew test jacocoTestReport
// to run jacoco on a single test (matches OperatorRetry to OperatorRetryTest in test code base):
// ./gradlew -Dtest.single=OperatorRetry test jacocoTestReport
// then open build/reports/jacoco/index.html
/////////////////////////////////////////////////////////////////

jacoco {
toolVersion = "+"
reportsDir = file("$buildDir/customJacocoReportDir")
}

jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/reports/jacoco"
}
}

javadoc {
exclude "**/rx/internal/**"
}
Expand All @@ -30,3 +67,10 @@ if (project.hasProperty('release.useLastTag')) {
test{
maxHeapSize = "2g"
}

tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}