forked from clopezno/refactoring-fowler-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
92 lines (84 loc) · 3.2 KB
/
build.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<project name="RefactorFowlerExample" default="dist" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
<description>
Practica 1 de desarrollo avanzado de sistemas software
</description>
<property name="main.build.dir" value="build/"/>
<property name="main.src.dir" value="src"/>
<property name="test.build.dir" value="build"/>
<property name="test.src.dir" value="src"/>
<property name="dist" location="dist"/>
<path id="classpath.test">
<pathelement location="lib/junit-4.12.jar"/>
<pathelement location="lib/jacocoant.jar"/>
<pathelement location="lib/hamcrest-core-1.3.jar"/>
<pathelement location="${main.build.dir}"/>
</path>
<path id="classpath.main">
<pathelement location="lib/junit-4.12.jar"/>
</path>
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="lib/jacocoant.jar"/>
</taskdef>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${main.build.dir}"/>
<mkdir dir="${test.build.dir}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${main.src.dir}" destdir="${main.build.dir}" includeantruntime="false" debug="true">
<classpath refid="classpath.main"/>
</javac>
</target>
<target name="test-compile" depends="compile">
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" includeantruntime="false" debug="true">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="test" depends="test-compile">
<jacoco:coverage>
<junit printsummary="on" haltonfailure="no" fork="true">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.build.dir}"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.src.dir}" includes="**/*Test.java" />
</batchtest>
</junit>
</jacoco:coverage>
<jacoco:report>
<executiondata>
<file file="jacoco.exec"/>
</executiondata>
<structure name="Example of Refactoring (Fowler) ">
<classfiles>
<fileset dir="${main.build.dir}"/>
<fileset dir="${test.build.dir}"/>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${main.src.dir}" includes="**/*.java"/>
<fileset dir="${test.src.dir}" includes="**/*Test.java"/>
</sourcefiles>
</structure>
<html destdir="report"/>
<xml destfile="report.xml"/>
</jacoco:report>
</target>
<target name="dist" depends="compile" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the ExampleFowlerRefactoring-${DSTAMP}.jar file -->
<jar jarfile="${dist}/ExampleFowlerRefactoring-${DSTAMP}.jar" basedir="${main.build.dir}"/>
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${main.build.dir}"/>
<delete dir="${test.build.dir}"/>
<delete dir="${dist}"/>
<delete dir="report"/>
<delete file="jacoco.exec"/>
</target>
</project>