-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·360 lines (306 loc) · 15.4 KB
/
build.xml
File metadata and controls
executable file
·360 lines (306 loc) · 15.4 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
<!-- $Id: build.xml,v 2.x 2015/01/01 wolfpaulus Exp $ -->
<!--
For instructions on how to build Swixml, please view the README.txt file.
-->
<project name="swixml" default="package" basedir=".">
<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init">
<tstamp/>
<!--
Gives users a chance to override without editing this file
(and without using -D arguments each time they build).
The build properties a user is likely to override include:
- lib.dir The directory where to look for the default JAR
files. Defaults to ./lib
- mac_ui.jar The JAR containing the MAC OS X UI classes.
Defaults to ${lib.dir}/ui.jar
-->
<property file="../swixml.build.properties"/>
<property file="${basedir}/build.properties"/>
<property name="java.docs" location="/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/docs"/>
<property name="Name" value="SWIXML"/>
<property name="name" value="swixml"/>
<property name="build.id" value="240"/>
<property name="version" value="2.4 (#${build.id})"/>
<property name="version.impl" value="${version}"/>
<property name="version.spec" value="2.4"/>
<property name="year" value="2015"/>
<property name="ant.build.javac.source" value="1.6"/>
<property name="ant.build.javac.target" value="1.6"/>
<echo message="----------- ${Name} ${version} ------------"/>
<property name="compile.debug" value="false"/>
<property name="compile.optimize" value="true"/>
<property name="compile.deprecation" value="true"/>
<property name="src.dir" location="src"/>
<property name="tagdocs.dir" location="tagdocs"/>
<property name="samples.dir" location="samples"/>
<property name="samples.dest" location="build/samples"/>
<property name="lib.dir" location="lib"/>
<property name="packages" value="org.swixml.*"/>
<property name="main.class" value="org.swixml.SwingEngine"/>
<property name="build.dir" location="build"/>
<property name="build.src" location="build/src"/>
<property name="build.dest" location="build/classes"/>
<property name="build.javadocs" location="build/apidocs"/>
<property name="build.tagdocs" location="build/tagdocs"/>
<property name="build.xsd" location="build/2007"/>
<property name="dist.dir" location="dist"/>
<property name="package.dir" location="package"/>
<filter token="year" value="${year}"/>
<filter token="version" value="${version}"/>
<filter token="date" value="${TODAY}"/>
<filter token="log" value="true"/>
<filter token="verbose" value="true"/>
<!-- Default JAR libraries -->
<!-- Libraries used at compile time only -->
<property name="forms.jar" location="${lib.dir}/jgoodies-forms-1.8.0.jar"/>
<property name="mac_ui.jar" location="${lib.dir}/ui.jar"/>
<!-- Libraries used for sample code only -->
<property name="jcalendar.jar" location="${lib.dir}/jcalendar-1.4.jar"/>
<property name="substance.jar" location="${lib.dir}/substance-7.2.1.jar"/>
<property name="j2h.jar" location="${lib.dir}/j2h.jar"/>
<property name="swixml-core" location="${build.dest}"/>
<!-- Compilation class path -->
<path id="compile.class.path">
<pathelement location="${forms.jar}"/>
<pathelement location="${mac_ui.jar}"/>
<pathelement location="${jcalendar.jar}"/>
<pathelement location="${substance.jar}"/>
</path>
<path id="run.class.path">
<path refid="compile.class.path"/>
<pathelement location="${swixml-core}"/>
</path>
</target>
<!-- =================================================================== -->
<!-- Help on usage -->
<!-- =================================================================== -->
<target name="usage">
<echo message=""/>
<echo message=""/>
<echo message="SWIXML Build file"/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
<echo message=" package --> generates the swixml.jar file (default)"/>
<echo message=" compile --> compiles the source code"/>
<echo message=" javadoc --> generates the API documentation"/>
<echo message=" clean --> cleans up the directory"/>
<echo message=""/>
<echo message=" See the comments inside the build.xml file for more details."/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=""/>
</target>
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare" depends="init">
<mkdir dir="${build.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Prepares the source code -->
<!-- =================================================================== -->
<target name="prepare-src" depends="prepare">
<!-- create directories -->
<mkdir dir="${build.src}"/>
<mkdir dir="${build.dest}"/>
<!-- copy src files -->
<copy todir="${build.src}" filtering="yes">
<fileset dir="${src.dir}" excludes="**/*.png"/>
</copy>
<!-- copy swixml doc images -->
<copy todir="${build.src}" filtering="no">
<fileset dir="${src.dir}" includes="**/*.png"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Prepares the example code -->
<!-- =================================================================== -->
<target name="prepare-samples" depends="prepare">
<!-- create directories -->
<mkdir dir="${samples.dest}"/>
<mkdir dir="${samples.dest}/html"/>
<!-- copy src files -->
<copy todir="${samples.dest}" filtering="yes">
<fileset dir="${samples.dir}" excludes="**/*.gif **/*.png"/>
</copy>
<!-- copy swixml doc images -->
<copy todir="${samples.dest}" filtering="no">
<fileset dir="${samples.dir}" includes="**/*.gif **/*.png"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="prepare-src" description="Compiles the source code">
<javac
srcdir="${build.src}"
destdir="${build.dest}"
debug="${compile.debug}"
optimize="${compile.optimize}"
deprecation="${compile.deprecation}"
includeantruntime="false">
<classpath refid="compile.class.path"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Compiles the samples directory -->
<!-- =================================================================== -->
<target name="samples" depends="prepare-samples,package" description="Compiles the samples directory">
<javac
srcdir="${samples.dest}"
destdir="${samples.dest}"
debug="${compile.debug}"
optimize="${compile.optimize}"
deprecation="${compile.deprecation}"
includeantruntime="false">
<classpath refid="run.class.path"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Creates the class package -->
<!-- =================================================================== -->
<target name="package" depends="compile" description="Creates the class package">
<fixcrlf srcdir="." includes="**/*.bat" excludes="build*.*" eol="crlf"/>
<fixcrlf srcdir="." includes="**/*.sh" excludes="build*.*" eol="lf"/>
<!-- Create Manifest -->
<mkdir dir="${build.dest}/META-INF"/>
<manifest file="${build.dest}/META-INF/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}"/>
<section name="common">
<attribute name="Specification-Title" value="${ant.project.name}"/>
<attribute name="Specification-Vendor" value="swixml.org"/>
<attribute name="Specification-Version" value="${version.spec}"/>
<attribute name="Implementation-Title" value="org.swixml"/>
<attribute name="Implementation-Vendor" value="swixml.org"/>
<attribute name="Implementation-Version" value="${version.impl}"/>
</section>
</manifest>
<jar jarfile="${build.dir}/${name}.jar"
basedir="${build.dest}"
excludes="META-INF/MANIFEST.MF"
manifest="${build.dest}/META-INF/MANIFEST.MF"/>
</target>
<!-- =================================================================== -->
<!-- Decode Java code in HTML depends="javadoc" -->
<!-- =================================================================== -->
<taskdef name="java2html" classname="com.java2html.Java2HTMLTask">
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="./lib/j2h.jar"/>
</classpath>
</taskdef>
<target name="j2h" depends="init">
<java2html
title="Swixml Sample Code"
simple="no"
tabsize="2"
marginsize="2"
header="true"
footer="true"
destination="${samples.dest}/html">
<fileset dir="${samples.dest}/">
<include name="**.java"/>
</fileset>
<javadoc localRef="${java.docs}" httpRef="http://docs.oracle.com/javase/8/docs/api/"/>
<javadoc localRef="./build/apidocs" httpRef="http://www.swixml.org/apidocs"/>
</java2html>
</target>
<!-- =================================================================== -->
<!-- Creates the TAG documentation -->
<!-- =================================================================== -->
<target name="tagdoc" depends="compile" description="Creates the TAG documentation">
<mkdir dir="${build.tagdocs}"/>
<!-- copy src files -->
<copy todir="${build.tagdocs}" filtering="yes">
<fileset dir="${tagdocs.dir}" excludes="**/*.java **/*.gif **/*.png"/>
</copy>
<!-- copy images -->
<copy todir="${build.tagdocs}" filtering="no">
<fileset dir="${tagdocs.dir}" includes="**/*.gif **/*.png" excludes="**/*.java"/>
</copy>
<javac
srcdir="${tagdocs.dir}"
destdir="${build.dest}"
debug="${compile.debug}"
optimize="${compile.optimize}"
deprecation="${compile.deprecation}"
includeantruntime="false">
<classpath refid="run.class.path"/>
</javac>
<java classpath="${build.dest};tagdocs" classname="doclet.Documenter"/>
</target>
<!-- =================================================================== -->
<!-- Creates the XML-Schema TAG documentation -->
<!-- =================================================================== -->
<target name="xsd" depends="compile" description="Creates the XSD documentation">
<mkdir dir="${build.xsd}"/>
<java classpath="${build.dest};tagdocs" classname="org.swixml.SchemaGenerator">
<arg value="${build.xsd}/swixml.xsd"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadoc" depends="prepare-src" description="Creates the API documentation">
<mkdir dir="${build.javadocs}"/>
<javadoc
breakiterator="true"
packagenames="${packages}"
sourcepath="${build.src}"
destdir="${build.javadocs}"
author="true"
version="true"
use="true"
splitindex="true"
noindex="false"
windowtitle="${Name} API v${version}"
doctitle="${Name} v${version}<br>API Specification"
header="<b>${Name}<br><font size='-1'>${version}</font></b>"
bottom="Copyright (c) 2002 - ${year} - Wolf Paulus - <a href='http://wolfpaulus.com' target='_blank'>wolfpaulus.com</a>. All rights reserved.">
<classpath refid="run.class.path"/>
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Clean targets -->
<!-- =================================================================== -->
<target name="clean" depends="init" description="Removes build the distribution files">
<delete dir="./classes"/>
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
<delete file="${Name}-${version}.tar.gz"/>
<delete file="${Name}-${version}.tar"/>
<delete file="${Name}-${version}.zip"/>
</target>
<!-- =================================================================== -->
<!-- Create Distribution -->
<!-- =================================================================== -->
<target name="distribution" depends="clean,package,javadoc,tagdoc,xsd,samples,j2h">
<mkdir dir="${dist.dir}"/>
<!-- Copy needed files -->
<copy todir="${dist.dir}" filtering="no">
<fileset dir="." includes="**/*.*"/>
</copy>
<!-- Remove compiled stuff and duplicates -->
<delete dir="${dist.dir}/build/classes"/>
<delete dir="${dist.dir}/build/samples"/>
<delete dir="${dist.dir}/build/src"/>
<delete dir="${dist.dir}/tagdocs"/>
<delete dir="${dist.dir}/classes"/>
<delete>
<fileset dir="." includes="**/*.class"/>
</delete>
<!-- Create ZIP file -->
<delete file="../${name}_${build.id}.zip"/>
<zip destfile="../${name}_${build.id}.zip">
<zipfileset dir="${dist.dir}" prefix="${name}_${build.id}"/>
</zip>
<!-- Delete copy -->
<delete dir="${dist.dir}"/>
</target>
</project>