forked from prefuse/Prefuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
312 lines (269 loc) · 12.9 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
<project name="prefuse" default="usage" basedir=".">
<!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init">
<tstamp>
<format property="year" pattern="yyyy" locale="en"/>
</tstamp>
<property file="build.properties"/>
<property name="Name" value="prefuse"/>
<property name="name" value="prefuse"/>
<property name="version" value="beta"/>
<property name="build.compiler" value="modern"/>
<property name="debug" value="off"/>
<property name="optimize" value="on"/>
<property name="deprecation" value="on"/>
<property name="packages" value="prefuse.*"/>
<!-- Define the source directories -->
<property name="root.dir" value="./"/>
<property name="data.dir" value="${root.dir}/data"/>
<property name="demos.dir" value="${root.dir}/demos"/>
<property name="doc.dir" value="${root.dir}/doc"/>
<property name="lib.dir" value="${root.dir}/lib"/>
<property name="src.dir" value="${root.dir}/src"/>
<property name="test.dir" value="${root.dir}/test"/>
<!-- Define path to required libraries -->
<property name="lucene.lib" value="${root.dir}/lib/lucene-1.4.3.jar"/>
<!-- Define the source build directories -->
<property name="doc.apidocs" value="${doc.dir}/api"/>
<property name="build.dir" value="${root.dir}/build"/>
<property name="build.lib" value="${root.dir}/build/lib"/>
<property name="build.prefuse.src" value="${root.dir}/build/prefuse/src"/>
<property name="build.prefuse.dest" value="${root.dir}/build/prefuse/classes"/>
<property name="build.demos.src" value="${root.dir}/build/demos/src"/>
<property name="build.demos.dest" value="${root.dir}/build/demos/classes"/>
<!-- Define the distribution directories -->
<property name="dist.root" value="${root.dir}/dist"/>
<property name="sourcedist.dir" value="${dist.root}/${name}-${version}/"/>
<property name="compiledist.dir" value="${dist.root}/${name}-${version}"/>
</target>
<!-- =================================================================== -->
<!-- Help on usage -->
<!-- =================================================================== -->
<target name="usage">
<echo message=""/>
<echo message=""/>
<echo message="prefuse build control"/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
<echo message=" all --> builds all the jars in ./build"/>
<echo message=" prefuse --> builds the prefuse.jar file in ./build"/>
<echo message=" demos --> builds the demos.jar file in ./build"/>
<echo message=" compiledist--> creates the compiled distribution in ./dist"/>
<echo message=" sourcedist --> creates the source distribution in ./dist"/>
<echo message=" api --> generates prefuse API docs in ./doc/api"/>
<echo message=" clean --> restores distribution to original state"/>
<echo message=" usage --> (default) displays build menu"/>
<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}"/>
<mkdir dir="${build.lib}"/>
<copy todir="${build.lib}">
<fileset dir="${lib.dir}"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Prepares the prefuse source code -->
<!-- =================================================================== -->
<target name="prepare-prefuse" depends="prepare">
<mkdir dir="${build.prefuse.src}"/>
<mkdir dir="${build.prefuse.dest}"/>
<copy todir="${build.prefuse.src}">
<fileset dir="${src.dir}"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Prepares the demos code -->
<!-- =================================================================== -->
<target name="prepare-demos" depends="prepare">
<mkdir dir="${build.demos.src}"/>
<mkdir dir="${build.demos.dest}"/>
<copy todir="${build.demos.src}">
<fileset dir="${demos.dir}"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compiles the prefuse source code -->
<!-- =================================================================== -->
<target name="compile-prefuse" depends="prepare-prefuse">
<!-- copy resource files -->
<copy todir="${build.prefuse.dest}">
<fileset dir="${build.prefuse.src}" excludes="**/*.java"/>
</copy>
<javac srcdir="${build.prefuse.src}"
destdir="${build.prefuse.dest}"
classpath="${lucene.lib}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
encoding="cp1252"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the demos directory -->
<!-- =================================================================== -->
<target name="compile-demos" depends="prepare-demos, prefuse">
<!-- copy resource files -->
<copy todir="${build.demos.dest}">
<fileset dir="${build.demos.src}" excludes="**/*.java"/>
</copy>
<copy todir="${build.demos.dest}">
<fileset dir="${data.dir}"/>
</copy>
<javac srcdir="${build.demos.src}"
destdir="${build.demos.dest}"
classpath="${build.dir}/${name}.jar"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"/>
</target>
<!-- =================================================================== -->
<!-- Creates the prefuse.jar in ./build -->
<!-- =================================================================== -->
<target name="prefuse" depends="compile-prefuse">
<jar jarfile="${build.dir}/${name}.jar"
basedir="${build.prefuse.dest}"
includes="**"/>
<jar jarfile="${build.dir}/${name}.src.jar"
basedir="${build.prefuse.src}"
includes="**"/>
</target>
<!-- =================================================================== -->
<!-- Creates the demos.jar in ./build -->
<!-- =================================================================== -->
<target name="demos" depends="compile-demos">
<jar jarfile="${build.dir}/demos.jar"
basedir="${build.demos.dest}"
includes="**"/>
<!--manifest="${demos.dir}/prefuse/demos/launcher/demos.manifest"-->
</target>
<!-- =================================================================== -->
<!-- Build all jars in ./build -->
<!-- =================================================================== -->
<target name="all" depends="prefuse, demos"/>
<!-- =================================================================== -->
<!-- Creates the API documentation in ./doc/api/ -->
<!-- =================================================================== -->
<target name="api" depends="prepare-prefuse, prepare-demos">
<mkdir dir="${doc.apidocs}"/>
<javadoc packagenames="${packages}"
sourcepath="${build.prefuse.src}"
classpath="${lucene.lib}"
destdir="${doc.apidocs}"
author="true"
version="true"
use="true"
breakiterator="yes"
splitindex="true"
noindex="false"
windowtitle="${Name} API Documentation"
doctitle="<font face='Verdana,Arial,sans-serif'>the ${Name} visualization toolkit</font>"
overview="${build.prefuse.src}/prefuse/overview.html"
bottom="Copyright © ${year} Regents of the University of California"
/>
</target>
<!-- =================================================================== -->
<!-- Replace all sequences of 4 spaces in .java files with a tab -->
<!-- =================================================================== -->
<target name="addTabsWithLength4" depends="init">
<fixcrlf
srcdir="${root.dir}"
tab="add"
tablength="4"
includes="**/*.java"/>
</target>
<!-- =================================================================== -->
<!-- Replace all tabs in .java files with a sequence of 4 spaces -->
<!-- =================================================================== -->
<target name="removeTabsWithLength4" depends="init">
<fixcrlf
srcdir="${root.dir}"
tab="remove"
tablength="4"
includes="**/*.java"/>
</target>
<!-- =================================================================== -->
<!-- Build source distribution in ./dist -->
<!-- =================================================================== -->
<target name="sourcedist" depends="clean">
<mkdir dir="${dist.root}"/>
<mkdir dir="${sourcedist.dir}"/>
<copy todir="${sourcedist.dir}">
<fileset dir="${root.dir}" excludes="**/.*" />
</copy>
<copy todir="${sourcedist.dir}">
<fileset dir="${root.dir}" casesensitive="yes">
<include name=".project"/>
<include name=".classpath"/>
</fileset>
</copy>
<!-- Now delete what we dont want, probably a better way to do this -->
<delete dir="${sourcedist.dir}/dist"/>
<delete dir="${sourcedist.dir}/classes"/>
<delete dir="${sourcedist.dir}/build"/>
<delete dir="${sourcedist.dir}/.settings"/>
<fixcrlf srcdir="${sourcedist.dir}"
eol="lf" eof="remove"
tablength="4" tab="remove"
includes="**/*.sh"
/>
<zip zipfile="${dist.root}/${name}-${version}-${DSTAMP}.zip"
basedir="${dist.root}"
whenempty="create"
/>
</target>
<!-- =================================================================== -->
<!-- Build compiled distribution in ./dist -->
<!-- =================================================================== -->
<target name="compiledist" depends="clean, all, api">
<mkdir dir="${dist.root}"/>
<mkdir dir="${compiledist.dir}"/>
<copy todir="${compiledist.dir}">
<fileset dir="${root.dir}"/>
</copy>
<!-- Now delete what we dont want, probably a better way to do this -->
<delete dir="${compiledist.dir}/dist"/>
<delete dir="${sourcedist.dir}/classes"/>
<delete dir="${compiledist.dir}/build/demos"/>
<delete dir="${compiledist.dir}/build/prefuse"/>
<delete dir="${compiledist.dir}/build/lib"/>
<fixcrlf srcdir="${compiledist.dir}"
eol="lf" eof="remove"
includes="**/*.sh"
/>
<zip zipfile="${dist.root}/${name}-${version}-${DSTAMP}-bin.zip"
basedir="${dist.root}/${name}-${version}"
whenempty="create"
/>
</target>
<!-- =================================================================== -->
<!-- Clean restores the distribution to original state -->
<!-- =================================================================== -->
<target name="clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.root}"/>
<delete dir="${doc.apidocs}"/>
</target>
<!-- =================================================================== -->
<!-- Fix tabs and line endings on java source files -->
<!-- =================================================================== -->
<target name="fixtabs" depends="init">
<fixcrlf srcdir="${src.dir}" eol="lf" eof="remove"
tablength="4" tab="remove" includes="**/*.java" />
<fixcrlf srcdir="${demos.dir}" eol="lf" eof="remove"
tablength="4" tab="remove" includes="**/*.java" />
<fixcrlf srcdir="${test.dir}" eol="lf" eof="remove"
tablength="4" tab="remove" includes="**/*.java" />
</target>
</project>
<!-- End of file -->