stevesaliman/gradle-cobertura-plugin — pull request #1 by davejsmith (2012-11-02 16:52:04+00:00)
Title: Handle multi-project builds

The taskGraph.whenReady() is fired once for the entire project. This patch prevents multiple whenReady() closures from being registered. Without the patch, an instance of the closure is registered as each subproject is configured causing it to run once for each subproject. This causes the extension of the last project to be applied to every project and multiple afterTask() closures to be registered

Lacking a thorough understanding of gradle's internals, I set a gradle.ext property to indicate the whenReady() closure has been registered. Seems like there ought to be a cleaner way of doing one-time initialization, but I haven't worked it out..

thanks
-djs