Here's how I do it in a smal project of mine:
checkstyleMain << {
ant.xslt(in: reports.xml.destination,
style: new File('config/checkstyle-noframes-sorted.xsl'),
out: new File(reports.xml.destination.parent, 'main.html'))
}
This requires that you store the checkstyle-noframes-sorted.xsl file, from the contrib directory of the checksyle binary distribution, in the config
directory of your project.
If you can afford running a SonarQube server, using the sonar plugin leads to a much better user experience, though.
EDIT: The above won't work if there are violations. This should in all cases:
task checkstyleHtml << {
ant.xslt(in: checkstyleMain.reports.xml.destination,
style: file('/config/checkstyle-noframes-sorted.xsl'),
out: new File(checkstyleMain.reports.xml.destination.parent, 'main.html'))
}
checkstyleMain.finalizedBy checkstyleHtml