JaCoCo agent path problem with multi-module project


(Peter Lajko) #1

Hi,

JaCoCo agent path is invalid in the jvm args with multi-module project.:

-javaagent:build/tmp/expandedArchives/org.jacoco.agent-0.6.2.201302030002.jar_q2a0mtv8q5rq9ajosjjoali9o/jacocoagent.jar…

Paths need to use the $projectDir as root of the relative path, or did I miss some configuration here?

-javaagent:$projectDir/build/tmp/expandedArchives/org.jacoco.agent-0.6.2.201302030002.jar_q2a0mtv8q5rq9ajosjjoali9o/jacocoagent.jar…

Peter


(Luke Daley) #2

Hi,

Any chance you could put together a sample project with the problem?


(Peter Lajko) #3

Hi,

I created a small sample project, gradle 1.6 was used.

https://www.dropbox.com/s/xq0ti8u9waqm9ml/jacoco-sample.zip


(Luke Daley) #4

I raised GRADLE-2859 for this. I found the problem (details on linked issue to that issue).

As a workaround, you need to do this for the test task:

systemProperties[‘user.dir’] = workingDir


(Peter Lajko) #5

Thanks for the solution!


(Mark Petrovic) #6

I tried flowing this assignment down to all test tasks, which would include intTest-type tasks, in my multiproject build with

allprojects {

tasks.withType(Test) {

systemProperties[‘user.dir’] = workingDir

} }

but the jacocoagent problem persists.