Project: clover
Issue CLOV-1617: Automatic Clover integration does not work for <groovyc> task
*Problem:* Automatic Clover integration in Bamboo does now work for Ant Tasks containing the task. *Root cause:* When automatic Clover integration is enabled in Bamboo, it uses Clover's AntIntegrationListener: {noformat} ant ... -lib clover.jar -listener com.atlassian.clover.ci.AntIntegrationListener {noformat} This listener listens to Ant's build events and intercepts Ant tasks such as: , , , However, it does not intercept the one. Integration with task is performed by the task, which calls: {code:java} GroovycSupport.ensureAddedTo(antProject); {code} Note that GroovycSupport implements Ant's BuildListener. However, it cannot be passed via command line, like this: {noformat} ant ... -lib clover.jar -listener com.atlassian.clover.ant.groovy.GroovycSupport {noformat} because the GroovycSupport does not have a default constructor. *Workaround:* Call the from an Ant script. For example, add the following target: {code:xml} {code} Clover's initialization will occur only if '-Dwith.clover=true' is set. Therefore, modify the Ant Task in Bamboo, for instance: {noformat} clean test -Dwith.clover=true {noformat} *Possible fixes:* 1) Add default constructor for GroovycSupport. Pass it as a second '-listener' to ant command in Bamboo. 2) Change the AntIntegrationListener so that it will intercept all tasks as well.
Story points: 5