-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsubstituicao.xml
69 lines (59 loc) · 2.65 KB
/
substituicao.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:jacoco="antlib:org.jacoco.ant" name="substituicao" default="substituicao" basedir=".">
<!-- XML based on http://www.eclemma.org/jacoco/trunk/doc/examples/build/build.xml -->
<description>Builds and tests the project substituicao.</description>
<!-- Importing the references from a NetBeans project. -->
<property name="base" value="lib"/>
<property file="./lib/nblibraries.properties" />
<property file="./nbproject/project.properties" />
<!-- Defining some JaCoCo properties -->
<property name="result.dir" location="${build.test.results.dir}"/>
<property name="result.report.dir" location="${result.dir}/jacoco"/>
<property name="result.exec.file" location="${result.dir}/jacoco.exec"/>
<!-- Building this porject calling the rigth build.xml from a NetBeans project -->
<target name="sub-init" description="Calling build-impl.xml from NetBeans">
<ant antfile="build.xml" target="default" />
</target>
<!-- Step 1: Import JaCoCo Ant tasks -->
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="./lib/jacocoant.jar"/>
</taskdef>
<target name="sub-junit" depends="sub-init" description="Run unit tests and code coverage">
<jacoco:coverage destfile="${result.dir}/jacoco.exec" xmlns:jacoco="antlib:org.jacoco.ant">
<junit haltonfailure="yes" fork="true" forkmode="once" description="Rerunning JUnit with JaCoCo Coverage">
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<formatter type="xml"/>
<batchtest todir="${result.dir}">
<fileset dir="${test.src.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
</target>
<target name="sub-report" depends="sub-junit" description="Creating JaCoCo report">
<jacoco:report>
<executiondata>
<file file="${result.exec.file}"/>
</executiondata>
<structure name="JaCoCo Ant for substituicao">
<classfiles>
<fileset dir="${build.classes.dir}"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src.dir}"/>
</sourcefiles>
</structure>
<!-- to produce reports in different formats. -->
<html destdir="${result.report.dir}"/>
<csv destfile="${result.report.dir}/report.csv"/>
<xml destfile="${result.report.dir}/report.xml"/>
</jacoco:report>
</target>
<target name="clean">
<ant antfile="build.xml" target="clean" />
</target>
<target name="substituicao" depends="sub-report" description="Build substituicao project."/>
</project>