forked from cjwizard/cjwizard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
170 lines (140 loc) · 4.43 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?xml version="1.0" encoding="utf-8" ?>
<project name="CJWizards" default="build" basedir=".">
<description>
Ciscavate Java Wizards
</description>
<!-- *************************** -->
<!-- Variables: -->
<property name="src.dir" value="src" />
<property name="test.dir" value="test" />
<property name="bin.dir" value="bin" />
<property name="lib.dir" value="lib" />
<property name="etc.dir" value="etc" />
<property name="dist.dir" value="dist"/>
<property name="doc.dir" value="doc" />
<property name="api.dir" value="${doc.dir}/api" />
<!-- ************************************************************-->
<!-- Set up some classpaths: -->
<!-- Set up a shared classpath that all targets will use: -->
<path id="shared.classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
<pathelement location="${etc.dir}" />
</path>
<!-- Set up a classpath for use when building the project: -->
<path id="build.classpath">
<path refid="shared.classpath"/>
</path>
<!-- Set up a classpath for use when running the project: -->
<path id="run.classpath">
<pathelement location="${bin.dir}" />
<path refid="shared.classpath"/>
</path>
<!-- Set up a classpath for use when testing the project: -->
<path id="test.classpath">
<pathelement location="${bin.dir}" />
<path refid="shared.classpath"/>
<fileset dir="${lib.dir}/testing">
<include name="*.jar" />
<include name="*.zip" />
</fileset>
</path>
<!-- END CLASSPATHS -->
<!-- *********************************************************** -->
<!-- *************************** -->
<!-- Public targets: -->
<target name="build"
depends="create.bin.dir"
description="Builds CJWizards">
<javac srcdir="${src.dir}"
destdir="${bin.dir}"
debug="on"
debuglevel="lines,vars,source"
source="1.6">
<classpath refid="build.classpath" />
</javac>
</target>
<target name="build.tests"
depends="build"
description="Builds the Test suite.">
<javac srcdir="${test.dir}"
destdir="${bin.dir}"
debug="on"
debuglevel="lines,vars,source"
source="1.6">
<classpath refid="test.classpath" />
</javac>
</target>
<target name="test"
depends="build.tests"
description="Runs the test suite.">
<junit printsummary="yes" haltonfailure="no" fork="yes">
<classpath>
<path refid="test.classpath"/>
</classpath>
<assertions enableSystemAssertions="true"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${test.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="jar"
depends="build, create.dist.dir"
description="Creates a jar for the package">
<jar destfile="${dist.dir}/${ant.project.name}.jar"
basedir="${bin.dir}"
/>
</target>
<target name="src-jar"
depends="create.dist.dir"
description="Creates a source jar for the package, usefull in eclipse.">
<jar destfile="${dist.dir}/${ant.project.name}-src.jar"
basedir="${src.dir}"
/>
</target>
<target name="javadoc"
depends="create.api.dir"
description="Generates the java docs for this package.">
<javadoc
destdir="${api.dir}"
author="true"
version="true"
use="true"
windowtitle="${ant.project.name}"
linksource="yes">
<packageset dir="src">
<include name="**"/>
</packageset>
<link href="http://java.sun.com/javase/6/docs/api/"/>
</javadoc>
</target>
<target name="clean"
description="Removes the ephemeral files/directories.">
<delete dir="${bin.dir}"/>
<delete dir="${test.out}"/>
<delete dir="${dist.dir}"/>
<delete dir="${doc.dir}"/>
</target>
<!-- *************************** -->
<!-- Private targets: -->
<target name="create.bin.dir">
<mkdir dir="${bin.dir}"/>
</target>
<target name="create.dist.dir">
<mkdir dir="${dist.dir}"/>
</target>
<target name="create.test.out.dir">
<mkdir dir="${test.out}/results"/>
</target>
<target name="create.doc.dir">
<mkdir dir="${doc.dir}"/>
</target>
<target name="create.api.dir"
depends="create.doc.dir">
<mkdir dir="${api.dir}"/>
</target>
</project>