annotate jacoco-ant.xml @ 251:969e33b82a99

USASR-2891: Change version of sonar gradle plugin to 2.6 when using Gradle version >= 4.2.1
author Christopher Springer <springer@nwoca.org>
date Sat, 11 Nov 2017 02:38:26 +0000
parents 9dcb429eea14
children
rev   line source
27
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
2 <project name="jacoco-project-tasks" default="" basedir="."
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
3 xmlns:ivy="antlib:fr.jayasoft.ivy.ant"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
4 xmlns:ssdt="http://www.ssdt-ohio.org/ant/common"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
5 xmlns:jacoco="antlib:org.jacoco.ant">
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
6
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
7 <description>jacoco Ant tasks</description>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
8
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
9 <property name="jacoco.report.dir" value="build/jacoco"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
10 <property name="jacoco.data.file" value="build/jacoco/jacoco.exec"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
11
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
12 <target name="-check.jacoco" depends="project.init,ivy-info">
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
13 <property name="jacoco.ant.jar.file"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
14 value="${user.home.ant.lib}/jacoco-ant.jar"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
15 <property name="jacoco.agent.jar.file"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
16 value="${ssdt.devel.kit}/jacoco-agent.jar"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
17 <property name="ssdt.jacoco.ant.jar.src"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
18 value="http://ivy.ssdt.nwoca.org/repository/jacoco/jacocoant.jar"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
19 <property name="ssdt.jacoco.agent.jar.src"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
20 value="http://ivy.ssdt.nwoca.org/repository/jacoco/jacocoagent.jar"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
21 <ssdt:fetch dest="${jacoco.ant.jar.file}"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
22 src="${ssdt.jacoco.ant.jar.src}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
23 <ssdt:fetch dest="${jacoco.agent.jar.file}"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
24 src="${ssdt.jacoco.agent.jar.src}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
25 <property name="jacoco.installed" value="true"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
26 <property name="jacoco.dir" value="${build.dir}/jacoco"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
27
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
28 </target>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
29
67
9dcb429eea14 USPSR-346: clean up groovy script and allow jacoco to be disabled.
smith@nwoca.org
parents: 43
diff changeset
30 <target name="with.coverage" depends="-check.jacoco" if="jacoco.installed" unless="jacoco.disabled">
27
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
31 <property name="coverage.run.with.jacoco" value="true"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
32 <mkdir dir="${jacoco.dir}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
33 <copy file="${jacoco.agent.jar.file}" tofile="${jacoco.dir}/jacocoagent.jar"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
34 <property name="_jacoco.agentFile" value="${jacoco.dir}/jacocoagent.jar"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
35 <taskdef uri="antlib:org.jacoco.ant"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
36 classpath="${jacoco.ant.jar.file}"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
37 resource="org/jacoco/ant/antlib.xml"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
38 <jacoco:agent property="jacoco.coverage.agent"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
39 destfile="${jacoco.data.file}"/>
43
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
40 <if><isset property="runmain.jvmargs"/>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
41 <then>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
42 <var name="runmain.jvmargs.jacoco" value="${runmain.jvmargs}"/>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
43 <var name="runmain.jvmargs" value="${jacoco.coverage.agent} ${runmain.jvmargs.jacoco}"/>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
44 </then>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
45 </if>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
46 <if><isset property="run.jvmargs"/>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
47 <then>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
48 <var name="run.jvmargs.jacoco" value="${run.jvmargs}"/>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
49 <var name="run.jvmargs" value="${jacoco.coverage.agent} ${run.jvmargs.jacoco}"/>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
50 </then>
c1619b87800e CM-127: Improve handling of differnt styles of NB projects jvmargs
smith@nwoca.org
parents: 41
diff changeset
51 </if>
27
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
52 </target>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
53
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
54 <target name="coverage.xml"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
55 description="Generates an XML converage report."
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
56 depends="-check.jacoco,project.init"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
57 if="jacoco.installed">
31
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
58 <if><available file="${jacoco.data.file}"/>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
59 <then>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
60 <mkdir dir="${jacoco.report.dir}"/>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
61 <jacoco:report>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
62 <executiondata>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
63 <file file="${jacoco.data.file}"/>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
64 </executiondata>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
65 <structure name="${ivy.project.module}">
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
66 <classfiles>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
67 <fileset dir="${build.classes.dir}"/>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
68 </classfiles>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
69 <sourcefiles encoding="UTF-8">
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
70 <fileset dir="${src.dir}"/>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
71 </sourcefiles>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
72 </structure>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
73 <xml destfile="${jacoco.report.dir}/jacoco.xml"/>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
74 </jacoco:report>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
75 </then>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
76 <else>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
77 <echo message="Coverage data not available. coverage.xml skipped"/>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
78 </else>
0cbc383e341b TL-34: Handle case of missing coverage data file under sonar
smith@nwoca.org
parents: 27
diff changeset
79 </if>
27
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
80
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
81 </target>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
82
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
83 <target name="coverage.html"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
84 description="Generates an HTML converage report."
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
85 depends="-check.jacoco"
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
86 if="jacoco.installed">
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
87 <mkdir dir="${jacoco.report.dir}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
88 <jacoco:report>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
89 <executiondata>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
90 <file file="${jacoco.data.file}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
91 </executiondata>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
92 <structure name="${ivy.project.module}">
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
93 <classfiles>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
94 <fileset dir="${build.classes.dir}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
95 </classfiles>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
96 <sourcefiles encoding="UTF-8">
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
97 <fileset dir="${src.dir}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
98 </sourcefiles>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
99 </structure>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
100 <html destdir="${jacoco.report.dir}"/>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
101 </jacoco:report>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
102 </target>
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
103
ea29594bb799 TL-34: Switch to Jacoco for coverage analysis.
smith@nwoca.org
parents:
diff changeset
104 </project>