Although the documentation claims that jacocoTestReport will trigger test, I don’t see that. I have to specify both the test and jacocoTestReport targets.
The report is generated properly, except that you can’t navigate to the source listing; you can only see the overview of the class and its methods, but the method (and constructor) names are not clickable.
Gradle build time: Tuesday, May 7, 2013 9:12:14 AM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.4 compiled on May 22 2012 Ivy: 2.2.0 JVM: 1.7.0_12-ea (Oracle Corporation 24.0-b28) OS: Mac OS X 10.7.5 x86_64
~/lib/gradle/samples/testing/jacoco/quickstart $ gr jTR :compileJava :processResources UP-TO-DATE :classes :jacocoTestReport SKIPPED
BUILD SUCCESSFUL
Total time: 8.552 secs ~/lib/gradle/samples/testing/jacoco/quickstart $
So you can see that JTR is not triggering test correctly.
Building test and jTR generates a report … without source links.
So I think this is a problem with the plugin, and not with my build script.