forked from bethrobson/Head-First-Design-Patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·100 lines (74 loc) · 2.91 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
93
94
95
96
97
98
99
100
<project name="hfj_chap15" default="all" basedir=".">
<!-- The following line gives us access to environment variables
such as HOME, USER, HOSTNAME etc. through env.HOME, env.USER, etc. -->
<property environment="env" />
<!-- Set global properties for this build -->
<property name="app.name" value="hfj_chap15" />
<property name="dir.src" value="src"/>
<property name="dir.build" value="build" />
<property name="dir.javadocs" location="javadoc" />
<property name="main.class" location="TBD" />
<!-- all is the default target (specified in the project open tag).
It is what happens when we just type "ant" at the command line -->
<target name="all"
depends="compile, javadoc, test"
description="compile, javadoc and test"/>
<target name="prepare" >
<mkdir dir="${dir.build}"/>
</target>
<!-- Specify what to compile -->
<target name="compile" depends="prepare" description="compile the code">
<javac srcdir="${dir.src}"
destdir="${dir.build}"
includeantruntime="False" >
<compilerarg value="-Xlint:unchecked"/>
<classpath>
<pathelement location="lib/javax.servlet.jar"/>
</classpath>
</javac>
</target>
<target name="javadoc" description="make the javadoc">
<mkdir dir="${dir.javadocs}"/>
<javadoc
destdir="${dir.javadocs}"
classpath="${dir.build}"
windowtitle="${app.name} compiled by ${env.USER}"
doctitle="<h1>${app.name} compiled by ${env.USER}</h1>">
<fileset dir="${dir.src}" >
<include name="*.java"/>
</fileset>
<classpath>
<pathelement location="lib/javax.servlet.jar"/>
</classpath>
</javadoc>
</target>
<target name="clean" description="clean up everything">
<delete dir="${dir.javadocs}" failonerror="false"/>
<delete failonerror="false">
<fileset dir="${dir.build}" includes="**/*.class"/>
</delete>
</target>
<target name="test" depends="prepare,compile" description="run JUnit tests">
<junit haltonerror="no" haltonfailure="no">
<classpath>
<pathelement location="javax.servlet.jar"/>
<pathelement location="${dir.build}"/>
</classpath>
<batchtest fork="yes">
<fileset dir="${dir.src}">
<!-- this will pick up every class with a name ending in Test -->
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
<!-- the type="plain" usefile="false" gives us
detailed output on the screen when tests fail.
An shorter alterantive is printsummary="yes" on the junit open tag -->
<formatter type="plain" usefile="false" />
</junit>
</target>
<target name="run" depends="compile,test" description="instructions for running" >
<echo>
Please consult the README.md for instructions to run programs in this repo
</echo>
</target>
</project>