CheckstyleMain task does not fail if warnings are detected

Description

This is related to the ticket: https://github.com/gradle/gradle/issues/881.

In the comments, there is already a workaround provided:

tasks.withType(Checkstyle).each { checkstyleTask ->

checkstyleTask.doLast {

reports.all { report ->

def outputFile = report.destination

if (outputFile.exists() && outputFile.text.contains("<error ")) {

throw new GradleException("There were checkstyle warnings! For more info check $outputFile")

}

}

}

}

Environment

None

Activity

Show:
Technical User
August 17, 2017, 12:13 PM

SUCCESS: Integrated in

inspectIT - Integration #340
INSPECTIT-2516: CheckstyleMain task does not fail if warnings are (ivan.senic: cb1d15904e44ed8ecae9bb43165c2cf737eb3f72)

  • (edit) inspectit.root.gradle

Fixed

Assignee

Tobias Angerstein

Reporter

Tobias Angerstein

Labels

Integrator

Ivan Senic