-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
316 lines (243 loc) · 10.2 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
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
<?xml version="1.0"?>
<!--
=================================================
rakiura-jfern build file
================================================= -->
<project name="jfern" default="main" basedir=".">
<property name="name" value="rakiura-jfern"/>
<property name="Name" value="Rakiura JFern Petri Net Simulator"/>
<property name="version" value="4.0.0"/>
<property name="copyright" value="Copyright (C) 1999-2009 by Mariusz Nowostawski and others." />
<property name="copyright_note" value="Please read README and LICENSE before using this software [http://www.sf.net/projects/jfern]"/>
<property file="${user.home}/.ant.properties" />
<property name="etc.dir" value="etc"/>
<property name="src.dir" value="src"/>
<property name="src.main" value="${src.dir}/main"/>
<property name="src.test" value="${src.dir}/test"/>
<property name="src.doc" value="${src.dir}/doc"/>
<property name="lib.dir" value="lib"/>
<property name="docs.dir" value="doc"/>
<property name="build.dir" value="../build/${name}"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.javadocs" value="${build.dir}/api"/>
<property name="maindist.dir" value="../dist"/>
<property name="dist.dir" value="${maindist.dir}/${name}-${version}"/>
<property name="javadoc.src" value="${dist.dir}/${src.main}" />
<!-- pre-requisite jars -->
<property name="checkstyle.jar" value="${ext.dir}/checkstyle-all.jar"/>
<path id="classpath">
<pathelement location="${build.classes}" />
<pathelement location="${lib.dir}/junit.jar" />
<pathelement location="${lib.dir}/log4j-full.jar" />
<pathelement location="${lib.dir}/graham-kirby-compiler.jar" />
<pathelement location="${lib.dir}/bsh.jar" />
<pathelement location="${lib.dir}/clojure.jar" />
<pathelement location="${lib.dir}/kawa-1.9.1.jar" />
<pathelement location="${lib.dir}/rakiura-jrio.jar" />
</path>
<property name="packages" value="org.rakiura.cpn, org.rakiura.cpn.event, org.rakiura.cpn.gui" />
<property name="manifest" value="etc/manifest"/>
<property name="versionfile" value="src/main/org/rakiura/cpn/Version.java"/>
<property name="moduleinfo" value="${etc.dir}/rakiura-jfern.rak"/>
<property name="build.compiler" value="modern"/>
<target name="main" depends="jar" />
<target name="all" depends="jar,javadocs" />
<!--
=================================================
Prepares the build directory
================================================= -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
</target>
<!--
=================================================
Checkstyles the source code
================================================= -->
<target name="checkstyle" description="source code style audit">
<apply executable="java" parallel="yes">
<arg value="-classpath"/> <arg value="${checkstyle.jar}"/>
<arg value="-Dcheckstyle.maxlinelen=120"/>
<arg value="com.puppycrawl.tools.checkstyle.Main"/>
<fileset dir="${src.main}" includes="**/*.java" />
</apply>
</target>
<!--
=================================================
Compiles the source code
================================================= -->
<target name="compile" depends="version,prepare">
<mkdir dir="${build.classes}"/>
<javac srcdir="${src.main}"
destdir="${build.classes}"
debug="on"
deprecation="on"
optimize="off" >
<classpath refid="classpath" />
</javac>
<javac srcdir="${src.test}"
destdir="${build.classes}"
debug="on"
deprecation="on"
optimize="off" >
<classpath refid="classpath" />
</javac>
<copy todir="${build.classes}" >
<fileset dir="${src.main}">
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<!--
=================================================
Tests the source code
================================================= -->
<target name="tests" depends="jar">
<junit printsummary="no" fork="no" haltonfailure="yes">
<classpath>
<pathelement location="${lib.dir}/${name}.jar" />
<pathelement location="/home/projects/Apache/CVS/jakarta-ant/lib/ant.jar" />
<path refid="classpath" />
</classpath>
<formatter type="plain" usefile="false" />
<batchtest>
<fileset dir="${src.test}">
<include name="**/*TestAll*" />
</fileset>
</batchtest>
</junit>
</target>
<!--
=================================================
Creates the jar archive
================================================= -->
<target name="jar" depends="compile">
<copy file="ChangeLog" todir="${build.classes}" />
<copy file="${docs.dir}/COPYING-LESSER" todir="${build.classes}" />
<copy file="${docs.dir}/LICENSE" todir="${build.classes}" />
<copy file="${docs.dir}/README" todir="${build.classes}" />
<copy file="${docs.dir}/THANKS" todir="${build.classes}" />
<copy file="${docs.dir}/AUTHORS" todir="${build.classes}" />
<copy file="${moduleinfo}" tofile="${build.classes}/META-INF/MODULEINFO" />
<mkdir dir="${lib.dir}"/>
<jar jarfile="${lib.dir}/${name}.jar"
basedir="${build.classes}"
manifest="${manifest}"/>
</target>
<!--
=====================================
Version Target
===================================== -->
<target name="version" description="updates the Version files">
<filter token="version" value="${version}" />
<filter token="name" value="${name}" />
<filter token="Name" value="${Name}" />
<filter token="copyright" value="${copyright}" />
<copy file="${manifest}.in" tofile="${manifest}" filtering="yes" overwrite="yes" />
<copy file="${moduleinfo}.in" tofile="${moduleinfo}" filtering="yes" overwrite="yes" />
<copy file="${versionfile}.in" tofile="${versionfile}" filtering="yes" overwrite="yes" />
</target>
<!--
=================================================
Creates the API documentation
================================================= -->
<target name="javadocs" depends="prepare">
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${javadoc.src}"
destdir="${build.javadocs}"
author="true"
version="true"
windowtitle="${Name} API"
doctitle="${Name}"
bottom="Copyright © 2001-2009 Praeteritio Limited. All Rights Reserved." >
<classpath refid="classpath" />
</javadoc>
<!--
<javadoc packagenames="${packages}"
sourcepath="${basedir}/${src.main}"
doclet="org.rakiura.util.doclet.TodoList"
docletpath="../util/lib/rakiura-util.jar">
<classpath refid="classpath" />
</javadoc>
-->
</target>
<!--
=====================================
Changelog Target
===================================== -->
<target name="changelog" description="regenerates the change log">
<exec executable="cvs2cl" dir="${basedir}">
<arg line="--utc -g -z9 -F TRUNK -S -W 3600 --usermap ChangeLog.usermap -I ChangeLog"/>
</exec>
</target>
<!--
=================================================
Creates the distribution
================================================= -->
<target name="dist-prep" depends="main,jar">
<filter token="version" value="${version}" />
<filter token="copyright" value="${copyright}" />
<filter token="copyright_note" value="${copyright_note}" />
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/lib"/>
<mkdir dir="${dist.dir}/docs"/>
<mkdir dir="${dist.dir}/docs/api"/>
<mkdir dir="${dist.dir}/src"/>
<mkdir dir="${dist.dir}/example"/>
<copy todir="${dist.dir}" filtering="yes" overwrite="yes">
<fileset dir="${basedir}" includes="*.xml, *.scm, ChangeLog" /></copy>
<copy todir="${dist.dir}/src" filtering="yes" overwrite="yes">
<fileset dir="src" includes="**">
<exclude name="doc/**" />
<exclude name="**/mca/*" />
</fileset>
</copy>
<copy todir="${dist.dir}/lib">
<fileset dir="${lib.dir}" >
<exclude name="**/tools.jar" />
</fileset>
</copy>
<copy todir="${dist.dir}/docs" ><fileset dir="${docs.dir}" excludes="**/htdocs/**" /></copy>
<copy todir="${dist.dir}/docs/api"><fileset dir="${build.javadocs}" /></copy>
<copy todir="${dist.dir}/example"><fileset dir="${basedir}/example" /></copy>
<copy todir="${dist.dir}/docs" >
<fileset dir="${src.doc}" >
<include name="*.pdf"/>
<include name="*.ps"/>
<include name="*.html"/>
</fileset>
</copy>
</target>
<!--
=================================================
Packages the distribution with ZIP
================================================= -->
<target name="dist" depends="dist-prep,javadocs" description="Prepares a binary+sources distribution in .zip and .tar.gz formats" >
<tar tarfile="${name}-${version}.tar" basedir="${maindist.dir}" includes="${name}-${version}/**"/>
<gzip zipfile="${name}-${version}.tar.gz" src="${name}-${version}.tar"/>
<delete file="${name}-${version}.tar"/>
<zip zipfile="${name}-${version}.zip" basedir="${maindist.dir}" includes="${name}-${version}/**"/>
</target>
<!--
=================================================
Cleans up generated stuff
================================================= -->
<target name="clean">
<delete dir="${build.classes}"/>
<delete dir="${dist.dir}"/>
</target>
<!--
=================================================
Total cleanup
================================================= -->
<target name="cleanall" depends="clean">
<delete dir="${build.dir}"/>
<delete file="${lib.dir}/${name}.jar"/>
<delete file="${name}-${version}.zip"/>
<delete file="${name}-${version}.tar"/>
<delete file="${name}-${version}.tar.gz"/>
</target>
</project>