forked from ypzheng/Build_Analyzer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
81 lines (71 loc) · 2.9 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
<?xml version="1.0" encoding="utf-8"?>
<project name="Build-Analyzer" default="jar" basedir=".">
<property name="dir.src.classes" value="src"/>
<property name="dir.src.tests" value="test"/>
<property name="dir.target" value="bin"/>
<property name="dir.target.classes" value="${dir.target}/classes"/>
<property name="dir.target.tests" value="${dir.target}/tests"/>
<property name="version" value="0.0.2-SNAPSHOT"/>
<property name="dist.jar" value="${dir.target}/build-analyzer-${version}.jar"/>
<!-- Base compile classpath -->
<path id="compile.classpath">
<!-- Add libraries if necessary -->
<pathelement location="${dir.target.classes}" />
<pathelement location="lib/ant-launcher-1.9.1.jar"/>
<pathelement location="lib/ant-1.9.1.jar"/>
</path>
<!-- Test classpath -->
<path id="test.classpath">
<pathelement location="${dir.target.classes}"/>
<pathelement location="${dir.target.tests}"/>
<pathelement location="lib/junit-4.11.jar"/>
<pathelement location="lib/commons-io-2.6.jar"/>
</path>
<target name="clean" description="Clean the project">
<delete dir="${dir.target}" />
<delete file="failing-tests.txt" />
</target>
<target name="init" description="Init directories">
<mkdir dir="${dir.target.classes}" />
<mkdir dir="${dir.target.tests}" />
</target>
<target name="compile" depends="init" description="Compile the sources">
<javac srcdir="${dir.src.classes}"
destdir="${dir.target.classes}"
includeantruntime="true"
debug="true"
source="1.7"
target="1.7">
<classpath refid="compile.classpath" />
</javac>
</target>
<target name="compile.tests" depends="compile" description="Compile the tests">
<javac srcdir="${dir.src.tests}"
destdir="${dir.target.tests}"
includeantruntime="false"
debug="true"
source="1.7"
target="1.7">
<classpath refid="test.classpath" />
</javac>
</target>
<target name="jar" depends="test" description="Build jar for this project">
<jar destfile="${dist.jar}" basedir="${dir.target.classes}">
<manifest>
<attribute name="Main-Class" value="Driver"/>
</manifest>
<zipgroupfileset dir="lib" includes="*.jar"/>
</jar>
</target>
<target name="test" depends="compile.tests">
<junit fork="yes" showoutput="true" haltonerror="yes" haltonfailure="yes">
<classpath refid="test.classpath" />
<formatter type="xml"/>
<batchtest todir="${dir.target}">
<fileset dir="${dir.src.tests}">
<include name="Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>