-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
78 lines (64 loc) · 2.32 KB
/
build.xml
File metadata and controls
78 lines (64 loc) · 2.32 KB
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
<project name="verifier" default="dist" basedir=".">
<target name="defs">
<property name="src.dir" value="src" />
<property name="tests.src.dir" value="testsrc" />
<property name="build.dir" value="build" />
<property name="dist.dir" value="dist"/>
<property name="jar.file" value="${dist.dir}/${ant.project.name}.jar"/>
<property name="junit.reports.dir" value="reports"/>
<path id="project.classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<pathelement location="${build.dir}"/>
</path>
</target>
<target name="compile" depends="defs, clean" description="Compile the project">
<mkdir dir="${build.dir}" />
<javac destdir="${build.dir}" srcdir="${src.dir}" debug="true">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="compile-tests" depends="compile" description="Compile the tests in the project">
<javac destdir="${build.dir}" srcdir="${tests.src.dir}" debug="true">
<classpath refid="project.classpath"/>
</javac>
</target>
<target name="test" depends="compile-tests" description="Run the tests of the project">
<mkdir dir="${junit.reports.dir}" />
<junit fork="yes" failureproperty="junit.failed" printsummary="yes" showoutput="yes">
<classpath refid="project.classpath" />
<formatter type="plain" usefile="false"/>
<batchtest todir="${junit.reports.dir}">
<fileset dir="${build.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
<fail if="junit.failed" message="Tests failed" />
</target>
<target name="dist" depends="compile" description="Make a JAR file for the project">
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.dir}/lib"/>
<copy todir="${dist.dir}/lib">
<fileset dir="lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</copy>
<copy todir="${dist.dir}">
<fileset dir="scripts">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- Make the jar file -->
<jar jarfile="${jar.file}">
<fileset dir="${build.dir}"/>
<fileset dir="${src.dir}" excludes="**/*.java"/>
</jar>
</target>
<target name="clean" depends="defs">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${junit.reports.dir}"/>
</target>
</project>