-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
187 lines (150 loc) · 5.11 KB
/
build.xml
File metadata and controls
187 lines (150 loc) · 5.11 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<project name="ogp-java" default="all" basedir=".">
<property file="build.properties" />
<path id="compile.classpath">
<fileset dir="${lib}" includes="**/*.jar"/>
</path>
<path id="run.classpath">
<path refid="compile.classpath" />
<pathelement path="${bin}"/>
</path>
<!-- convention: targets which are externally available have descriptions -->
<!-- inits target -->
<target name="init" description="Display title message">
<echo message="Build file: ${project.name}-${project.version}"/>
</target>
<target name="clean.all" depends="compile.clean, dist.clean, javadoc.clean, test.clean" description="Clean all build directories">
</target>
<!-- compile targets -->
<!-- Cleans compile directories and files -->
<target name="compile.clean" depends="init">
<delete dir="${compile.bin}" />
</target>
<!-- Prepares compile directories -->
<target name="compile.prepare" depends="init">
<mkdir dir="${compile.bin}" />
</target>
<target name="compile" depends="init, compile.clean, compile.prepare" description="Compiles the source code">
<javac
includeantruntime="false"
srcdir="${src}"
destdir="${compile.bin}"
debug="${compile.debug}"
classpathref="compile.classpath"
/>
</target>
<!-- dist targets -->
<!-- Cleans distribution directories and files -->
<target name="dist.clean" depends="init">
<delete dir="${dist}" />
<delete dir="${build}" />
</target>
<!-- Cleans distribution directories and files -->
<target name="dist.prepare" depends="init">
<mkdir dir="${dist}" />
<mkdir dir="${build}" />
</target>
<target name="dist" depends="init, dist.clean, dist.prepare" description="Assemble distributable scomponents">
<delete dir="${build}" failonerror="false" />
<copy todir="${build}">
<fileset dir="${compile.bin}" />
</copy>
<jar jarfile="${dist}/${dist.app}-${dist.version}.jar"
basedir="${compile.bin}"
includes="**">
</jar>
</target>
<!-- test targets -->
<property name="test.xsl" value="test/xsl" />
<path id="test.classpath">
<path refid="compile.classpath" />
<pathelement path="${compile.bin}"/>
</path>
<path id="test.run.classpath">
<path refid="test.classpath" />
<pathelement path="${test.bin}"/>
</path>
<!-- Clean unit test directories and files -->
<target name="test.clean" depends="init">
<delete dir="${test.bin}" />
<delete dir="${reports}"/>
<delete dir="${reports}/xml"/>
<delete dir="${reports}/html"/>
</target>
<!-- Prepare the unit test directories and files -->
<target name="test.prepare" depends="init">
<mkdir dir="${test.bin}" />
</target>
<!-- Compile the unit test classes -->
<target name="test.compile" depends="init, compile, test.clean, test.prepare">
<javac
includeantruntime="false"
srcdir="${test.src}"
destdir="${test.bin}"
debug="${compile.debug}"
optimize="${compile.optimize}"
deprecation="${compile.deprecation}">
<classpath refid="test.classpath" />
</javac>
<copy todir="${test.bin}">
<fileset dir="${test.src}" excludes="**/*.java" />
</copy>
<copy todir="${test.bin}" filtering="on">
<fileset dir="${test.src}" includes="**/*.properties" />
</copy>
<copy todir="${test.bin}" filtering="on">
<fileset dir="${test.src}" includes="**/*.html" />
</copy>
</target>
<target name="test.run" depends="init, test.compile">
<mkdir dir="${reports}"/>
<mkdir dir="${reports}/xml"/>
<mkdir dir="${reports}/html"/>
<junit printsummary="yes" haltonfailure="no" haltonerror="no">
<classpath>
<path refid="test.run.classpath" />
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="${reports}/xml">
<fileset dir="${test.bin}">
<include name="**/*Test*.class"/>
</fileset>
</batchtest>
</junit>
<!-- TODO:
<junitreport todir="${reports}/html">
<fileset dir="${reports}/xml">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" styledir="${test.xsl}" todir="${reports}/html" />
</junitreport>
-->
</target>
<target name="test" depends="init, test.compile, test.run" description="Compiles and runs tests" />
<!-- deploy targets -->
<target name="deploy" description="" />
<!-- javadoc targets -->
<!-- Clean unit test directories and files -->
<target name="javadoc.clean">
<delete dir="${javadoc}" />
</target>
<!-- Prepare the javadoc directories and files -->
<target name="javadoc.prepare">
<mkdir dir="${javadoc}" />
</target>
<target name="javadoc" depends="javadoc.clean, javadoc.prepare" description="Generates the JavaDoc API for this project">
<javadoc packagenames="com.github.*"
sourcepath="${src}"
destdir="${javadoc}"
author="true"
version="true"
use="true"
windowtitle="ogp-java">
<doctitle><![CDATA[<h1>ogp-java</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2013 Jeff D. Conrad.</i>]]></bottom>
</javadoc>
</target>
<!-- all target -->
<target name="all"
depends="compile, dist, javadoc, test, deploy"
description="Compiles, assembles, runs javadoc, and deploys" />
</project>