Instrumenting (using emma) dependent classes from another project

How would I instrument (with emma) dependency jars/classes which are in different projects than the tests using gradle? This applies to end-to-end / acceptance projects having tests using the production projects/classes. Result would be full coverage instead of project specific coverage.

How are you doing it for classes in the same project, and why wouldn’t this work for classes in other projects?

I’m using emma plugin from https://raw.github.com/breskeby/gradleplugins/master/emmaPlugin/emma.gradle to instrument classes in the same project when running the tests. How would I extend this outside of one project scope or above use case of instrumenting dependent classes?

I’m applyling that emma plugin in a subprojects scope in my build.gradle

The plugin you mention doesn’t currently support this. It is aimed at the classical use case of measuring coverage of your unit tests. Personally I think that’s where measuring test coverage makes the most sense.

Instead of instrumenting the project’s compiled code, you could instrument (selected parts of) the configured class path of each ‘Test’ task. The quickest way to get there is to fork the existing plugin and make the necessary changes. Alternatively, you could make a feature request for the plugin.