Task control multi project

I have a two module build. A protocol module and a server module. Nothing very fancy. I wan’t code coverage (with emma currently) to be managed by our build server only (i think developers should use an ide plugin for coverage and I don’t want to clutter the build script).

Here is the problem: I use the emma plugin (applied from script) but that fails for the “container/parent” project, which has no source and hence no build/classes, and this trips an error in the emma plugin.

I see two possibilities: 1: fix the emma plugin to skip if build/classes are missing 2: have jenkins call: gradle build -x test (but only for container/parent) <- is that possible?

Did you make sure not to apply the ‘emma’ plugin to the ‘container/parent’ project?

WOW you respond so fast :slight_smile:

Thats exactly what i did, since jenkins does it (in ~/.gradle/init.gradle)

Why? Since i want code coverage “out of the box” and only on jenkins (aka without cluttering build.gradle with emma stuff)

I just got it working by adding

if ( sourceSets.main.output.classesDir.exists() )

to the emma plugin, herby skipping emma if nothing to instrument exist.

Thanks again for the lightning fast respons!

I’d only apply the ‘emma’ (and ‘java’ etc.) plugin to projects which are supposed to contain code. Anyway, glad you found a solution.