forked from elek/antelope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-app.xml
337 lines (294 loc) · 13.4 KB
/
build-app.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
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
<project name="AntelopeApp" default="dist" basedir=".">
<description>
This build file creates Antelope as an Application.
</description>
<!-- read build.props to override properties set below -->
<property name="build.props" value="build.props"/>
<property file="${build.props}"/>
<!-- version number, override in build.props if necessary -->
<property name="build.num" value="3.2.2"/>
<!-- shouldn't need to override the following properties -->
<!-- source code directory, this is where the .java files live -->
<property name="src.dir" location="src" />
<!-- build directory, all files contained in the src directory are copied
to this directory for processing (tag substitution, mostly) -->
<property name="prep.dir" location="prep"/>
<!-- configuration directory, this is where the configuration files for the
plugin are placed for pre-processing prior to getting jarred. -->
<property name="config.dir" location="${prep.dir}/config" />
<!-- documentation directory, this is where the plugin documentation
files live. Files in this directory will be distributed with the plugin -->
<property name="doc.dir" location="${prep.dir}/docs" />
<!-- the directory for the compiled classes. Files in this directory will be
included in the finished jar file. -->
<property name="classes.dir" location="classes" />
<!-- location for third party library files -->
<property name="lib.dir" location="lib"/>
<!-- where to put the finished distribution file -->
<property name="dist.dir" location="dist"/>
<!-- compiler settings -->
<property name="showDeprecated" value="false"/>
<property name="showDebug" value="true"/>
<property name="showWarnings" value="false"/>
<!-- ========================================================================
Target: set classpath
========================================================================= -->
<target name="setClasspath">
<path id="classpathref">
<pathelement location="${classes.dir}" />
<pathelement path="${java.class.path}"/>
<!--
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
-->
</path>
</target>
<!-- ========================================================================
Target: clean
deletes all files from the build directory
========================================================================= -->
<target name="clean" description="Delete all files from the classes directory.">
<delete>
<fileset dir="${classes.dir}" includes="**/*" />
<fileset dir="${prep.dir}">
<include name="**/*"/>
<exclude name="docs/**/*"/>
</fileset>
</delete>
</target>
<!-- ========================================================================
Target: compile
========================================================================= -->
<target name="compile"
description="Compile"
depends="init,setClasspath,copy_resources">
<condition property="nowarn" value="no">
<istrue value="${showWarnings}"/>
</condition>
<javac deprecation="${showDeprecated}"
debug="${showDebug}"
nowarn="${nowarn}"
destdir="${classes.dir}"
srcdir="${src.dir}"
source="1.6"
target="1.6">
<classpath refid="classpathref" />
<exclude name="testcases/**/*"/>
<exclude name="**/plugin/**/*"/>
<exclude name="**/common/gui/*"/>
<exclude name="**/common/builder/*"/>
<exclude name="**/common/dependency/*"/>
</javac>
<!--
<copy file="${src.dir}/ant.dtd" todir="${classes.dir}/ise/antelope/common/builder"/>
-->
</target>
<!-- ========================================================================
Target: dist
this target does several things:
first, it creates a jar file in the prep directory. This is a finished
jar file suitable for dropping into jEdit.
second, it copies the jar file to $install.dir
third, it zips the jar file and installation docs into $dist.dir
========================================================================= -->
<target name="dist"
description="Compiles, jars, and puts a zip file in the dist directory."
depends="init,clean,compile,prep_files,jar,zip"/>
<target name="jar" description="make jar file">
<!-- make the jar file, put it in $prep.dir -->
<tstamp/>
<jar jarfile="${prep.dir}/antelope_app.jar">
<manifest>
<attribute name="AppName" value="${ant.project.name}" />
<attribute name="AppVersion" value="${build.num}" />
<attribute name="Author" value="Dale Anson" />
<attribute name="Created-By" value="${user.name}"/>
<attribute name="Created-On" value="${TODAY}"/>
</manifest>
<!-- include everything in the build directory -->
<fileset dir="${classes.dir}">
<include name="**/*" />
<exclude name="**/ise/antelope/launcher/**/*"/>
<exclude name="**/com/**/*"/>
<exclude name="**/testcases/**/*"/>
</fileset>
<!-- include everything in the config directory -->
<fileset dir="${config.dir}">
<include name="**/*" />
</fileset>
<!-- include everything in the doc directory -->
<fileset dir="${doc.dir}">
<include name="**/*" />
</fileset>
</jar>
<jar jarfile="${prep.dir}/AntelopeApp.jar">
<manifest>
<attribute name="AppName" value="${ant.project.name}" />
<attribute name="AppVersion" value="${build.num}" />
<attribute name="Author" value="Dale Anson" />
<attribute name="Created-By" value="${user.name}"/>
<attribute name="Created-On" value="${TODAY}"/>
<attribute name="Main-Class" value="ise.antelope.launcher.Launcher"/>
</manifest>
<!-- include just the Launcher files -->
<fileset dir="${classes.dir}">
<include name="**/ise/antelope/launcher/**/*"/>
</fileset>
<fileset dir="${prep.dir}">
<include name="antelope_app.jar"/>
</fileset>
</jar>
<delete>
<fileset dir="${prep.dir}">
<include name="antelope_app.jar"/>
</fileset>
</delete>
</target>
<target name="zip" description="make zip file">
<!-- zip the jar and installation instructions and put the zip file in
the $dist directory -->
<zip destfile="${dist.dir}/${ant.project.name}_${build.num}.zip">
<zipfileset prefix="${ant.project.name}_${build.num}" dir="${prep.dir}">
<include name="${ant.project.name}_${build.num}.jar"/>
<include name="AntelopeApp.jar"/>
</zipfileset>
<zipfileset prefix="${ant.project.name}_${build.num}" dir="${prep.dir}/docs">
<include name="license.txt"/>
<include name="readme.txt"/>
<include name="install.txt"/>
<include name="ChangeLog.txt"/>
</zipfileset>
<!--
<zipfileset prefix="${ant.project.name}_${build.num}/lib" dir="${lib.dir}">
<include name="**/*.jar"/>
</zipfileset>
-->
<zipfileset prefix="${ant.project.name}_${build.num}" dir="${basedir}">
<include name="run.xml"/>
</zipfileset>
</zip>
</target>
<!-- ========================================================================
Target: run
Runs Antelope as a stand-alone application.
========================================================================= -->
<target name="run"
description="Runs Antelope as a standalone app."
depends="setClasspath, copy_resources">
<java classname="ise.antelope.app.Antelope" fork="true">
<classpath refid="classpathref"/>
</java>
</target>
<!-- ========================================================================
Target: run
Runs Antelope as a stand-alone application.
========================================================================= -->
<target name="runBuilder"
description="Runs Antelope Builder as a standalone app."
depends="setClasspath, copy_resources">
<java classname="ise.library.FontDialog" fork="true">
<jvmarg value="-ea"/>
<classpath refid="classpathref"/>
</java>
</target>
<!-- ========================================================================
Target: docs-xalan
Generate docs from docbook format xml files with Xalan. This uses the
files in ${src.dir}/docs and puts the finished files in ${prep.dir}/docs.
The files are NOT ready for distribution until after prep_files is ran.
========================================================================= -->
<target name="docs-xalan"
description="Generate user documentation in hmtl format with xalan"
depends="init,setClasspath,prep_files">
<fail unless="docbook.xsl" message="Please set docbook.xsl property."/>
<delete>
<fileset dir="${doc.dir}" includes="manual/**/*" />
</delete>
<copy todir="${doc.dir}/manual">
<fileset dir="${src.dir}/docs/manual" includes="**/*.gif" />
<fileset dir="${src.dir}/docs/manual" includes="**/*.css" />
</copy>
<property name="docbook-wrapper" location="${doc.dir}/docbook-wrapper.xsl"/>
<delete file="${docbook-wrapper}" />
<echo file="${docbook-wrapper}"
message="<xsl:stylesheet"/>
<echo file="${docbook-wrapper}" append="true"
message=" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'"/>
<echo file="${docbook-wrapper}" append="true"
message=" version='1.0'>"/>
<echo file="${docbook-wrapper}" append="true"
message="<xsl:import href='${docbook.xsl}/html/chunk.xsl'/>"/>
<echo file="${docbook-wrapper}" append="true"
message="</xsl:stylesheet>"/>
<style basedir="${src.dir}/docs/manual"
style="${docbook-wrapper}"
destdir="${doc.dir}/manual"
includes="userguide.xml">
<param name="html.stylesheet" expression="./style.css"/>
</style>
</target>
<!-- ========================================================================
Target: copy_resources
========================================================================= -->
<target name="copy_resources">
<copy todir="${classes.dir}/images">
<fileset dir="${src.dir}/images" includes="**/*" />
</copy>
<copy todir="${classes.dir}/ise/antelope/tasks">
<fileset dir="${src.dir}/ise/antelope/tasks" includes="antelope.taskdefs"/>
<fileset dir="${src.dir}/ise/antelope/tasks" includes="antlib.xml"/>
</copy>
<copy todir="${classes.dir}/ise/antelope/common/builder">
<fileset dir="${src.dir}" includes="ant.dtd" />
</copy>
</target>
<!-- ========================================================================
Target: prep_files
prepares certain files for distribution by doing string replacement.
Assumes that the configuration files and documentation files are ready.
========================================================================= -->
<target name="prep_files"
description="Prepare files for distribution.">
<echo>preparing files ${config.dir} ${build.num}</echo>
<!-- clean out the config directory -->
<delete>
<fileset dir="${config.dir}" includes="**/*"/>
</delete>
<!-- copy the src files to deployment directory -->
<copy todir="${prep.dir}" overwrite="yes">
<fileset dir="${src.dir}">
<include name="config/**/*"/>
<include name="docs/*.txt"/>
<include name="docs/about.html"/>
</fileset>
</copy>
<!-- insert the build number into the documentation and configuration
files -->
<replace dir="${prep.dir}" token="@@build.num@@"
value="${build.num}" />
<tstamp/>
<replace dir="${prep.dir}" token="@@tstamp@@"
value="${TODAY}" />
</target>
<!-- ========================================================================
Target: init
this target creates the directories needed for this project and
only needs to be done once.
========================================================================= -->
<target name="init"
description="Create directory structure."
unless="init.done">
<mkdir dir="${src.dir}" />
<mkdir dir="${classes.dir}" />
<mkdir dir="${prep.dir}"/>
<mkdir dir="${doc.dir}" />
<mkdir dir="${config.dir}" />
<mkdir dir="${dist.dir}"/>
<property name="init.done" value="true"/>
<echo>init done</echo>
</target>
<target name="test">
<echo>just a test</echo>
</target>
</project>