understanding gradle jacocoReport

22 views
Skip to first unread message

rdatl...@gmail.com

unread,
May 26, 2020, 10:34:07 AM5/26/20
to JaCoCo and EclEmma Users

We have gradle project that uses jacocoReport with ant libraries. We have lot of junit tests that were run under custom tasks which use the jacocoReport. 


 I want to remove ant libraries and use gradle jacocoReport for coverage. Can you point me to documentation on how to tell gradle to use junit jar file that comes with gradle and not use ant libraries. I want to basically point junit ant jar to junit jar file which comes with gradle. Any help is appreciated.


Thank you.


test.gradle:


configurations {

 junitAnt

}

dependencies {

  junitAnt "junit:junit:${Version.junit}"

  junitAnt("org.apache.ant:ant-junit:${Version.antJunit}") {

    transitive = false

  }

  junitAnt("org.apache.ant:ant-junit4:${Version.antJunit}") {

    transitive = false

  }

}


ant.taskdef(name: 'jacocoCoverageTask', classname: 'org.jacoco.ant.CoverageTask',

           classpath: configurations.jacocoAnt.asPath)

ant.taskdef(name: 'jacocoMergeTask', classname: 'org.jacoco.ant.MergeTask',

           classpath: configurations.jacocoAnt.asPath)

ant.taskdef(name: 'jacocoReportTask', classname: 'org.jacoco.ant.ReportTask',

           classpath: configurations.jacocoAnt.asPath)

ant.taskdef(name: 'junit', classname: 'org.apache.tools.ant.taskdefs.optional.junit.JUnitTask',

            classpath: configurations.junitAnt.asPath)

Marc Hoffmann

unread,
May 28, 2020, 2:46:53 AM5/28/20
to jac...@googlegroups.com
Hi,

Gradle plug-in is maintained and documented by the Gradle project, please see: https://docs.gradle.org/current/userguide/jacoco_plugin.html

Regards,
-marc

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/9ba81b04-0ef1-4f57-84ce-835add25fa78%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages