Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="ISO-8859-1" ?>
|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
| 4 | <head>
|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
| 6 | <link rel="stylesheet" href=".resources/doc.css" charset="ISO-8859-1" type="text/css" />
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 7 | <link rel="stylesheet" href="../coverage/.resources/prettify.css" charset="ISO-8859-1" type="text/css" />
|
| 8 | <script type="text/javascript" src="../coverage/.resources/prettify.js"></script>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 9 | <title>JaCoCo - Ant Tasks</title>
|
| 10 | </head>
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 11 | <body onload="prettyPrint()">
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 12 |
|
| 13 | <div class="breadcrumb">
|
| 14 | <a href="../index.html" class="el_session">JaCoCo</a> >
|
| 15 | <a href="index.html" class="el_group">Documentation</a> >
|
| 16 | <span class="el_source">Ant Tasks</span>
|
| 17 | </div>
|
Marc R. Hoffmann | 17be269 | 2010-02-02 05:44:47 +0000 | [diff] [blame] | 18 | <div id="content">
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 19 |
|
| 20 | <h1>Ant Tasks</h1>
|
| 21 |
|
| 22 | <p>
|
| 23 | JaCoCo comes with Ant tasks to launch Java programs with execution recording
|
Marc R. Hoffmann | b8a7746 | 2009-08-21 14:53:50 +0000 | [diff] [blame] | 24 | and for creating coverage reports from the recorded data. The JaCoCo Ant tasks
|
| 25 | require
|
| 26 | </p>
|
| 27 |
|
| 28 | <ul>
|
| 29 | <li>Ant 1.7.0 or higher and</li>
|
| 30 | <li>Java 1.5 or higher (for both, the Ant runner and the test executor).</li>
|
| 31 | </ul>
|
| 32 |
|
| 33 |
|
Marc R. Hoffmann | 57f9ab4 | 2009-08-24 10:52:42 +0000 | [diff] [blame] | 34 | <p>All tasks are defined in <code>jacocoant.jar</code> (which is part of the
|
| 35 | distribution) and can be included in your Ant scripts with the usual
|
| 36 | <code>taskdef</code> declaration:
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 37 | </p>
|
| 38 |
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 39 | <pre class="source lang-xml">
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 40 | <span class="nr"> 1</span><project name="Example" xmlns:jacoco="antlib:org.jacoco.ant">
|
| 41 | <span class="nr"> 2</span>
|
| 42 | <span class="nr"> 3</span> <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
|
| 43 | <span class="nr"> 4</span> <classpath>
|
Marc R. Hoffmann | db93077 | 2009-08-20 17:17:37 +0000 | [diff] [blame] | 44 | <span class="nr"> 5</span> <pathelement location="<i>path_to_jacoco</i>/lib/jacocoant.jar"/>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 45 | <span class="nr"> 6</span> </classpath>
|
| 46 | <span class="nr"> 7</span> </taskdef>
|
| 47 | <span class="nr"> 8</span>
|
| 48 | <span class="nr"> 9</span> ...
|
| 49 | <span class="nr"> 10</span>
|
| 50 | <span class="nr"> 11</span></project>
|
| 51 | </pre>
|
| 52 |
|
| 53 | <p>
|
Marc R. Hoffmann | db3e7d0 | 2009-08-12 10:57:39 +0000 | [diff] [blame] | 54 | Alternatively you might also place the <code>jacocoant.jar</code> in your
|
| 55 | Ant <code><i>ANT_HOME</i>/lib</code> folder. If you use the name space URI
|
| 56 | <code>antlib:org.jacoco.ant</code> for JaCoCo tasks Ant will find them
|
| 57 | automatically without the <code>taskdef</code> declaration above.
|
| 58 | </p>
|
| 59 |
|
| 60 | <p>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 61 | Declaring a XML namespace for JaCoCo tasks is optional but always recommended
|
| 62 | if you mix tasks from different libraries. All subsequent examples use the
|
| 63 | <code>jacoco</code> prefix declared above.
|
| 64 | </p>
|
| 65 |
|
| 66 |
|
Brock Janiczak | d267c57 | 2010-01-28 09:53:54 +0000 | [diff] [blame] | 67 | <h2><a name="coverage">Task <code>coverage</code></a></h2>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 68 |
|
| 69 | <p>
|
| 70 | The standard Ant tasks to launch Java programs are <code>java</code> and
|
| 71 | <code>junit</code>. To add code coverage recording to these tasks they can
|
| 72 | simply be wrapped with the <code>coverage</code> task as shown in the
|
| 73 | following examples:
|
| 74 | </p>
|
| 75 |
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 76 | <pre class="source lang-xml">
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 77 | <span class="nr"> 1</span><jacoco:coverage>
|
| 78 | <span class="nr"> 2</span> <java classname="org.jacoco.examples.HelloJaCoCo" fork="true">
|
| 79 | <span class="nr"> 3</span> <classpath>
|
| 80 | <span class="nr"> 4</span> <pathelement location="./bin"/>
|
| 81 | <span class="nr"> 5</span> </classpath>
|
| 82 | <span class="nr"> 6</span> </java>
|
| 83 | <span class="nr"> 7</span></jacoco:coverage>
|
| 84 | <span class="nr"> 8</span>
|
| 85 | <span class="nr"> 9</span>
|
| 86 | <span class="nr"> 10</span><jacoco:coverage>
|
| 87 | <span class="nr"> 11</span> <junit fork="true" forkmode="once">
|
| 88 | <span class="nr"> 12</span> <test name="org.jacoco.examples.HelloJaCoCoTest"/>
|
| 89 | <span class="nr"> 13</span> <classpath>
|
| 90 | <span class="nr"> 14</span> <pathelement location="./bin"/>
|
| 91 | <span class="nr"> 15</span> </classpath>
|
| 92 | <span class="nr"> 16</span> </junit>
|
| 93 | <span class="nr"> 17</span></jacoco:coverage>
|
| 94 | </pre>
|
| 95 |
|
| 96 | <p>
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 97 | Resulting coverage information is collected during execution and written
|
| 98 | to a file when the process terminates. Note the <code>fork</code> attribute
|
| 99 | above in the wrapped <code>java</code> task.
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 100 | </p>
|
| 101 |
|
| 102 | <p class="hint">
|
| 103 | The nested task always has to declare <code>fork="true"</code>, otherwise the
|
| 104 | <code>coverage</code> task can't record coverage information and will fail.
|
| 105 | In addition the <code>junit</code> task should declare
|
| 106 | <code>forkmode="once"</code> to avoid starting a new JVM for every single test
|
| 107 | case and decreasing execution performance dramatically (unless this is
|
| 108 | required by the nature of the test cases).
|
| 109 | </p>
|
| 110 |
|
| 111 | <p>
|
| 112 | The coverage task must wrap exactly one task. While it typically works without
|
| 113 | any configuration, the behavior can be adjusted with some optional attributes:
|
| 114 | </p>
|
| 115 |
|
| 116 | <table class="coverage">
|
| 117 | <thead>
|
| 118 | <tr>
|
| 119 | <td>Attribute</td>
|
| 120 | <td>Description</td>
|
| 121 | <td>Default</td>
|
| 122 | </tr>
|
| 123 | </thead>
|
| 124 | <tbody>
|
| 125 | <tr>
|
Brock Janiczak | d267c57 | 2010-01-28 09:53:54 +0000 | [diff] [blame] | 126 | <td><code>enabled</code></td>
|
| 127 | <td>If set to <code>true</code> coverage data will be collected for the contained task.</td>
|
| 128 | <td><code>true</code></td>
|
| 129 | </tr>
|
Marc R. Hoffmann | e3ef2f3 | 2010-01-28 18:17:46 +0000 | [diff] [blame] | 130 | <tr>
|
Brock Janiczak | 003d47c | 2010-01-15 00:45:17 +0000 | [diff] [blame] | 131 | <td><code>destfile</code></td>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 132 | <td>Path to the output file for execution data.</td>
|
| 133 | <td><code>jacoco.exec</code></td>
|
| 134 | </tr>
|
| 135 | <tr>
|
Brock Janiczak | 003d47c | 2010-01-15 00:45:17 +0000 | [diff] [blame] | 136 | <td><code>append</code></td>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 137 | <td>If set to <code>true</code> and the execution data file already
|
Brock Janiczak | 003d47c | 2010-01-15 00:45:17 +0000 | [diff] [blame] | 138 | exists, coverage data is appended to the existing file. If set to
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 139 | <code>false</code>, an existing execution data file will be replaced.
|
| 140 | </td>
|
| 141 | <td><code>true</code></td>
|
| 142 | </tr>
|
| 143 | <tr>
|
Marc R. Hoffmann | cf5345f | 2009-09-10 15:01:24 +0000 | [diff] [blame] | 144 | <td><code>includes</code></td>
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 145 | <td>A list of class names that should be included in execution analysis.
|
Marc R. Hoffmann | cf5345f | 2009-09-10 15:01:24 +0000 | [diff] [blame] | 146 | The list entries are separated by a vertical bar (<code>|</code>) and
|
| 147 | may use wildcard characters (<code>*</code> and <code>?</code>).
|
| 148 | Except for performance optimization or technical corner cases this
|
| 149 | option is normally not required.
|
| 150 | </td>
|
| 151 | <td><code>*</code> (all classes)</td>
|
| 152 | </tr>
|
| 153 | <tr>
|
| 154 | <td><code>excludes</code></td>
|
| 155 | <td>A list of class names that should be excluded from execution analysis.
|
| 156 | The list entries are separated by a vertical bar (<code>|</code>) and
|
| 157 | may use wildcard characters (<code>*</code> and <code>?</code>).
|
| 158 | Except for performance optimization or technical corner cases this
|
| 159 | option is normally not required.
|
| 160 | </td>
|
| 161 | <td><i>empty</i> (no excluded classes)</td>
|
| 162 | </tr>
|
| 163 | <tr>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 164 | <td><code>exclclassloader</code></td>
|
Marc R. Hoffmann | 2a6b5bf | 2009-08-11 12:54:36 +0000 | [diff] [blame] | 165 | <td>A list of class loader names, that should be excluded from execution
|
| 166 | analysis. The list entries are separated by a vertical bar
|
| 167 | (<code>|</code>) and may use wildcard characters (<code>*</code> and
|
| 168 | <code>?</code>). This option might be required in case of special
|
Marc R. Hoffmann | 57f9ab4 | 2009-08-24 10:52:42 +0000 | [diff] [blame] | 169 | frameworks that conflict with JaCoCo code instrumentation, in
|
| 170 | particular class loaders that do not have access to the Java runtime
|
| 171 | classes.
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 172 | </td>
|
| 173 | <td><code>sun.reflect.DelegatingClassLoader</code></td>
|
| 174 | </tr>
|
| 175 | </tbody>
|
| 176 | </table>
|
| 177 |
|
| 178 |
|
Brock Janiczak | d267c57 | 2010-01-28 09:53:54 +0000 | [diff] [blame] | 179 | <h2><a name="agent">Task <code>agent</code></a></h2>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 180 |
|
Marc R. Hoffmann | d519add | 2009-08-11 11:09:29 +0000 | [diff] [blame] | 181 | <p>
|
| 182 | If the <code>coverage</code> task is not suitable for your launch target, you
|
| 183 | might alternatively use the <code>agent</code> task to create the Java agent
|
| 184 | parameter. The following example defines a Ant property with the name
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 185 | <code>agentvmparam</code> that can be directly used as a Java VM parameter:
|
Marc R. Hoffmann | d519add | 2009-08-11 11:09:29 +0000 | [diff] [blame] | 186 | </p>
|
| 187 |
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 188 | <pre class="source lang-xml">
|
Marc R. Hoffmann | d519add | 2009-08-11 11:09:29 +0000 | [diff] [blame] | 189 | <span class="nr"> 1</span><jacoco:agent property="agentvmparam"/>
|
| 190 | </pre>
|
| 191 |
|
| 192 | <p>
|
| 193 | This task has the same attributes as the <code>coverage</code> task plus an
|
| 194 | additional property to specify the target property name:
|
| 195 | </p>
|
| 196 |
|
| 197 | <table class="coverage">
|
| 198 | <thead>
|
| 199 | <tr>
|
| 200 | <td>Attribute</td>
|
| 201 | <td>Description</td>
|
| 202 | <td>Default</td>
|
| 203 | </tr>
|
| 204 | </thead>
|
| 205 | <tbody>
|
| 206 | <tr>
|
Brock Janiczak | d267c57 | 2010-01-28 09:53:54 +0000 | [diff] [blame] | 207 | <td><code>enabled</code></td>
|
| 208 | <td>When this variable is set to <code>false</code> the value of <code>property</code> will be set to an empty string, effectively
|
Marc R. Hoffmann | e3ef2f3 | 2010-01-28 18:17:46 +0000 | [diff] [blame] | 209 | disabling coverage instrumentation for any tasks that used the value.</td>
|
Brock Janiczak | d267c57 | 2010-01-28 09:53:54 +0000 | [diff] [blame] | 210 | <td><code>true</code></td>
|
| 211 | </tr>
|
| 212 | <tr>
|
Marc R. Hoffmann | d519add | 2009-08-11 11:09:29 +0000 | [diff] [blame] | 213 | <td><code>property</code></td>
|
| 214 | <td>Name of the Ant property to set.</td>
|
| 215 | <td><i>none (required)</i></td>
|
| 216 | </tr>
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 217 | <tr>
|
| 218 | <td colspan="3"><i>All attributes of the <code>coverage</code> task.</i></td>
|
| 219 | </tr>
|
Marc R. Hoffmann | d519add | 2009-08-11 11:09:29 +0000 | [diff] [blame] | 220 | </tbody>
|
| 221 | </table>
|
| 222 |
|
Brock Janiczak | 74c1659 | 2010-01-29 21:34:14 +0000 | [diff] [blame] | 223 |
|
| 224 | <h2><a name="merge">Task <code>merge</code></a></h2>
|
| 225 |
|
| 226 | <p>
|
| 227 | This task can be used to merge the execution data from multiple test runs
|
| 228 | into a single data store.
|
| 229 | </p>
|
| 230 |
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 231 | <pre class="source lang-xml">
|
Marc R. Hoffmann | 5c8a703 | 2010-02-25 11:15:54 +0000 | [diff] [blame] | 232 | <span class="nr"> 1</span><jacoco:merge destfile="merged.exec">
|
| 233 | <span class="nr"> 2</span> <fileset dir="executionData" includes="*.exec"/>
|
| 234 | <span class="nr"> 3</span></jacoco:merge>
|
Brock Janiczak | 74c1659 | 2010-01-29 21:34:14 +0000 | [diff] [blame] | 235 | </pre>
|
| 236 |
|
| 237 | <p>
|
| 238 | The task definition can contain any number of resource collection types and
|
| 239 | has the following mandatory attribute:
|
| 240 | </p>
|
| 241 |
|
| 242 | <table class="coverage">
|
| 243 | <thead>
|
| 244 | <tr>
|
| 245 | <td>Attribute</td>
|
| 246 | <td>Description</td>
|
| 247 | <td>Default</td>
|
| 248 | </tr>
|
| 249 | </thead>
|
| 250 | <tbody>
|
| 251 | <tr>
|
| 252 | <td><code>destfile</code></td>
|
| 253 | <td>Location to write the merged execution data.</td>
|
| 254 | <td><i>none (required)</i></td>
|
| 255 | </tr>
|
| 256 | </tbody>
|
| 257 | </table>
|
| 258 |
|
| 259 |
|
Brock Janiczak | d267c57 | 2010-01-28 09:53:54 +0000 | [diff] [blame] | 260 | <h2><a name="report">Task <code>report</code></a></h2>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 261 |
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 262 | <p>
|
| 263 | Finally different reports can be created with the <code>report</code> task.
|
| 264 | A report task declaration consists of different sections, two specify the
|
| 265 | input data, additional ones specify the output formats:
|
| 266 | </p>
|
| 267 |
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 268 | <pre class="source lang-xml">
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 269 | <span class="nr"> 1</span><jacoco:report>
|
| 270 | <span class="nr"> 2</span>
|
| 271 | <span class="nr"> 3</span> <executiondata>
|
| 272 | <span class="nr"> 4</span> <file file="jacoco.exec"/>
|
| 273 | <span class="nr"> 5</span> </executiondata>
|
| 274 | <span class="nr"> 6</span>
|
| 275 | <span class="nr"> 7</span> <structure name="Example Project">
|
| 276 | <span class="nr"> 8</span> <classfiles>
|
| 277 | <span class="nr"> 9</span> <fileset dir="bin"/>
|
| 278 | <span class="nr"> 10</span> </classfiles>
|
| 279 | <span class="nr"> 11</span> <sourcefiles encoding="UTF-8">
|
| 280 | <span class="nr"> 12</span> <fileset dir="src"/>
|
| 281 | <span class="nr"> 13</span> </sourcefiles>
|
| 282 | <span class="nr"> 14</span> </structure>
|
| 283 | <span class="nr"> 15</span>
|
| 284 | <span class="nr"> 16</span> <html destdir="report"/>
|
| 285 | <span class="nr"> 17</span>
|
| 286 | <span class="nr"> 18</span></jacoco:report>
|
| 287 | </pre>
|
| 288 |
|
| 289 | <p>
|
| 290 | As you can see from the example above the <code>report</code> task is based
|
| 291 | on several nested elements:
|
| 292 | </p>
|
| 293 |
|
| 294 | <h3>Element <code>executiondata</code></h3>
|
| 295 |
|
| 296 | <p>
|
| 297 | Within this element Ant resources and resource collections can be specified,
|
| 298 | that represent JaCoCo execution data files. If more than one execution data
|
| 299 | file is specified, execution data is combined. A particular piece of code is
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 300 | considered executed when it is marked as such in any of the input files.
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 301 | </p>
|
| 302 |
|
| 303 | <h3>Element <code>structure</code></h3>
|
| 304 |
|
| 305 | <p>
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 306 | This element defines the report structure. It might contain the following
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 307 | nested elements:
|
| 308 | </p>
|
| 309 |
|
| 310 | <ul>
|
| 311 | <li><code>classfiles</code>: Container element for Ant resources and resource
|
Marc R. Hoffmann | ff7cd3a | 2010-04-06 08:54:29 +0000 | [diff] [blame] | 312 | collections that can specify Java class files, ZIP archive files (jar, war,
|
| 313 | ear etc.) or folders containing class files. Archives and folders are
|
| 314 | searched recursively for class files.</li>
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 315 | <li><code>sourcefiles</code>: Optional container element for Ant resources and
|
| 316 | resource collections that specify corresponding source files. The element
|
| 317 | has an optional attribute <code>encoding</code> to specify the character
|
| 318 | encoding of the source files. If no encoding is given, the platform default
|
| 319 | is used. If source files are specified, some report formats include
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 320 | highlighted source code.</li>
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 321 | </ul>
|
| 322 |
|
| 323 | <p>
|
| 324 | The structure can be refined with a hierarchy of <code>group</code> elements.
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 325 | This way the coverage report can reflect different modules of a software
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 326 | project. For each group element the corresponding class and source files can
|
Radek Liba | ad5fbc9 | 2009-10-26 13:26:53 +0000 | [diff] [blame] | 327 | be specified separately. For example, the build script of JaCoCo itself
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 328 | contains the following declaration to separate the different bundles in the
|
| 329 | report (see the <a href="../coverage/index.html">resulting report</a>):
|
| 330 | </p>
|
| 331 |
|
Marc R. Hoffmann | a760f32 | 2010-03-10 22:23:52 +0000 | [diff] [blame] | 332 | <pre class="source lang-xml">
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 333 | <span class="nr"> 1</span><structure name="JaCoCo">
|
| 334 | <span class="nr"> 2</span> <group name="org.jacoco.core">
|
| 335 | <span class="nr"> 3</span> <classfiles>
|
| 336 | <span class="nr"> 4</span> <path refid="bundle-org.jacoco.core"/>
|
| 337 | <span class="nr"> 5</span> </classfiles>
|
| 338 | <span class="nr"> 6</span> <sourcefiles>
|
| 339 | <span class="nr"> 7</span> <fileset dir="${workspace.dir}/org.jacoco.core/src"/>
|
| 340 | <span class="nr"> 8</span> </sourcefiles>
|
| 341 | <span class="nr"> 9</span> </group>
|
| 342 | <span class="nr"> 10</span> <group name="org.jacoco.report">
|
| 343 | <span class="nr"> 11</span> <classfiles>
|
| 344 | <span class="nr"> 12</span> <path refid="bundle-org.jacoco.report"/>
|
| 345 | <span class="nr"> 13</span> </classfiles>
|
| 346 | <span class="nr"> 14</span> <sourcefiles>
|
| 347 | <span class="nr"> 15</span> <fileset dir="${workspace.dir}/org.jacoco.report/src"/>
|
| 348 | <span class="nr"> 16</span> </sourcefiles>
|
| 349 | <span class="nr"> 17</span> </group>
|
| 350 | <span class="nr"> 18</span>
|
| 351 | <span class="nr"> 19</span> ...
|
| 352 | <span class="nr"> 20</span>
|
| 353 | <span class="nr"> 21</span></structure>
|
| 354 | </pre>
|
| 355 |
|
Marc R. Hoffmann | 722cad8 | 2010-03-09 18:22:33 +0000 | [diff] [blame] | 356 | <p>
|
| 357 | Both <code>structure</code> and <code>group</code> elements have the following
|
| 358 | mandatory attribute:
|
| 359 | </p>
|
| 360 |
|
| 361 | <table class="coverage">
|
| 362 | <thead>
|
| 363 | <tr>
|
| 364 | <td>Attribute</td>
|
| 365 | <td>Description</td>
|
| 366 | <td>Default</td>
|
| 367 | </tr>
|
| 368 | </thead>
|
| 369 | <tbody>
|
| 370 | <tr>
|
| 371 | <td><code>name</code></td>
|
| 372 | <td>Name of the structure or group.</td>
|
| 373 | <td><i>none (required)</i></td>
|
| 374 | </tr>
|
| 375 | </tbody>
|
| 376 | </table>
|
| 377 |
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 378 | <h3>Element <code>html</code></h3>
|
| 379 |
|
| 380 | <p>
|
Marc R. Hoffmann | 81f7920 | 2010-03-12 07:36:50 +0000 | [diff] [blame] | 381 | Create a multi-page report in HTML format. The report can either be written as
|
| 382 | multiple files into a directory or compressed into a single ZIP file.
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 383 | </p>
|
| 384 |
|
| 385 | <table class="coverage">
|
| 386 | <thead>
|
| 387 | <tr>
|
| 388 | <td>Attribute</td>
|
| 389 | <td>Description</td>
|
| 390 | <td>Default</td>
|
| 391 | </tr>
|
| 392 | </thead>
|
| 393 | <tbody>
|
| 394 | <tr>
|
| 395 | <td><code>destdir</code></td>
|
Marc R. Hoffmann | 81f7920 | 2010-03-12 07:36:50 +0000 | [diff] [blame] | 396 | <td>Directory to create the report in. Either this property or
|
| 397 | <code>destfile</code> has to be supplied.</td>
|
| 398 | <td><i>none (required)</i></td>
|
| 399 | </tr>
|
| 400 | <tr>
|
| 401 | <td><code>destfile</code></td>
|
| 402 | <td>Zip file to create the report in. Either this property or
|
| 403 | <code>destdir</code> has to be supplied.</td>
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 404 | <td><i>none (required)</i></td>
|
| 405 | </tr>
|
Marc R. Hoffmann | 2ecbea5 | 2009-09-03 14:19:11 +0000 | [diff] [blame] | 406 | <tr>
|
| 407 | <td><code>footer</code></td>
|
| 408 | <td>Footer text for each report page.</td>
|
| 409 | <td><i>No footer</i></td>
|
| 410 | </tr>
|
Marc R. Hoffmann | 2becd33 | 2009-10-07 16:13:17 +0000 | [diff] [blame] | 411 | <tr>
|
| 412 | <td><code>encoding</code></td>
|
| 413 | <td>Encoding of the generated HTML pages.</td>
|
| 414 | <td><code>UTF-8</code></td>
|
| 415 | </tr>
|
| 416 | </tbody>
|
| 417 | </table>
|
| 418 |
|
| 419 | <h3>Element <code>xml</code></h3>
|
| 420 |
|
| 421 | <p>
|
| 422 | Create a single-file report in XML format.
|
| 423 | </p>
|
| 424 |
|
| 425 | <table class="coverage">
|
| 426 | <thead>
|
| 427 | <tr>
|
| 428 | <td>Attribute</td>
|
| 429 | <td>Description</td>
|
| 430 | <td>Default</td>
|
| 431 | </tr>
|
| 432 | </thead>
|
| 433 | <tbody>
|
| 434 | <tr>
|
Marc R. Hoffmann | 88b3f2f | 2009-10-19 16:10:35 +0000 | [diff] [blame] | 435 | <td><code>destfile</code></td>
|
| 436 | <td>Location to write the report file to.</td>
|
Marc R. Hoffmann | 2becd33 | 2009-10-07 16:13:17 +0000 | [diff] [blame] | 437 | <td><i>none (required)</i></td>
|
| 438 | </tr>
|
| 439 | <tr>
|
| 440 | <td><code>encoding</code></td>
|
| 441 | <td>Encoding of the generated XML document.</td>
|
| 442 | <td><code>UTF-8</code></td>
|
| 443 | </tr>
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 444 | </tbody>
|
| 445 | </table>
|
| 446 |
|
| 447 | <h3>Element <code>csv</code></h3>
|
| 448 |
|
| 449 | <p>
|
Marc R. Hoffmann | 2becd33 | 2009-10-07 16:13:17 +0000 | [diff] [blame] | 450 | Create single-file report in CSV format.
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 451 | </p>
|
| 452 |
|
| 453 | <table class="coverage">
|
| 454 | <thead>
|
| 455 | <tr>
|
| 456 | <td>Attribute</td>
|
| 457 | <td>Description</td>
|
| 458 | <td>Default</td>
|
| 459 | </tr>
|
| 460 | </thead>
|
| 461 | <tbody>
|
| 462 | <tr>
|
Marc R. Hoffmann | 88b3f2f | 2009-10-19 16:10:35 +0000 | [diff] [blame] | 463 | <td><code>destfile</code></td>
|
| 464 | <td>Location to write the report file to.</td>
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 465 | <td><i>none (required)</i></td>
|
| 466 | </tr>
|
Marc R. Hoffmann | e17fd11 | 2009-10-19 15:27:04 +0000 | [diff] [blame] | 467 | <tr>
|
| 468 | <td><code>encoding</code></td>
|
| 469 | <td>Encoding of the generated CSV document.</td>
|
| 470 | <td><code>UTF-8</code></td>
|
| 471 | </tr>
|
Marc R. Hoffmann | 2bb6fca | 2009-08-13 14:04:21 +0000 | [diff] [blame] | 472 | </tbody>
|
| 473 | </table>
|
| 474 |
|
Marc R. Hoffmann | 17be269 | 2010-02-02 05:44:47 +0000 | [diff] [blame] | 475 | </div>
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 476 | <div class="footer">
|
Marc R. Hoffmann | df6ff96 | 2010-04-09 15:31:22 +0000 | [diff] [blame^] | 477 | <div class="versioninfo"><a href="@jacoco.home.url@">JaCoCo</a> @qualified.bundle.version@</div>
|
| 478 | <a href="license.html">Copyright</a> © @copyright.years@ Mountainminds GmbH & Co. KG and Contributors
|
Marc R. Hoffmann | f7d1752 | 2009-08-07 11:21:23 +0000 | [diff] [blame] | 479 | </div>
|
| 480 |
|
| 481 | </body>
|
| 482 | </html> |