-
Notifications
You must be signed in to change notification settings - Fork 80
/
build.xml
300 lines (267 loc) · 13.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
<?xml version="1.0" encoding="utf-8"?>
<project name="flare" default="usage" basedir=".">
<!-- =================================================================== -->
<!-- Import Flex Ant Tasks, Set Flex Home and asdoc -->
<!-- =================================================================== -->
<property name="LOCALE" value="en_US"/>
<property name="FLEX_HOME" value="C:/pkg/flex/"/>
<property name="asdoc" value="${FLEX_HOME}bin/asdoc.exe"/>
<taskdef resource="flexTasks.tasks"
classpath="${FLEX_HOME}ant/lib/flexTasks.jar" />
<!-- =================================================================== -->
<!-- Properties -->
<!-- =================================================================== -->
<tstamp>
<format property="year" pattern="yyyy" locale="en"/>
<format property="datetime" pattern="EE MMM d yyyy h:mm aa"/>
</tstamp>
<property name="name" value="prefuse.flare"/>
<property name="version" value="alpha"/>
<property name="flare.src" value="${basedir}/flare/src"/>
<property name="flare.flex.src" value="${basedir}/flare/src-flex-integration"/>
<property name="flare.lib" value="${basedir}/flare/lib"/>
<property name="apps.src" value="${basedir}/flare.apps/src"/>
<property name="demos.src" value="${basedir}/flare.demos/src"/>
<property name="tests.src" value="${basedir}/flare.tests/src"/>
<property name="tests.lib" value="${basedir}/flare.tests/lib"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="dist.dir" value="${basedir}/build/dist"/>
<property name="docs.dir" value="${basedir}/docs"/>
<property name="api.dir" value="${docs.dir}/api/"/>
<property file="${basedir}/etc/doc.properties.txt"/>
<!-- =================================================================== -->
<!-- Help on usage -->
<!-- =================================================================== -->
<target name="usage">
<echo message=""/>
<echo message=""/>
<echo message="prefuse::flare build control"/>
<echo message="-------------------------------------------------------------"/>
<echo message=""/>
<echo message=" available targets are:"/>
<echo message=""/>
<echo message=" all --> builds flare and demos in ./build}"/>
<echo message=" flare --> builds the flare libraries in ./build"/>
<echo message=" flare-flex --> builds the flare Flex integration libraries in ./build"/>
<echo message=" apps --> builds the apps project in ./build"/>
<echo message=" demos --> builds the demos app in ./build"/>
<echo message=" tests --> builds the tests app in ./build"/>
<echo message=" docs --> builds reference documentation in ./docs/api"/>
<echo message=" dist --> creates the distribution in ./dist"/>
<echo message=" clean --> restores distribution to original state"/>
<echo message=" usage --> (default) displays this 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">
<mkdir dir="${build.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Compile flare toolkit -->
<!-- =================================================================== -->
<target name="flare" depends="prepare">
<!-- First we have to collect all the AS files -->
<path id="flare.files">
<fileset dir="${flare.src}">
<include name="**/**"/>
</fileset>
</path>
<pathconvert
property="flare.classes"
pathsep=" "
dirsep="."
refid="flare.files">
<map from="${flare.src}/" to=""/>
<mapper>
<chainedmapper><globmapper from="*.as" to="*"/></chainedmapper>
</mapper>
</pathconvert>
<!-- Now we build the .swc -->
<compc output="${build.dir}/flare.swc" include-classes="${flare.classes}">
<source-path path-element="${flare.src}/"/>
<source-path path-element="${flare.lib}/"/>
</compc>
</target>
<target name="flare-flex" depends="flare">
<!-- Shameless copy from above; ant doesn't make this kind of workflow easy -->
<!-- First we have to collect all the AS files -->
<path id="flare.flex.files">
<fileset dir="${flare.flex.src}">
<include name="**/**"/>
</fileset>
</path>
<pathconvert
property="flare.flex.classes"
pathsep=" "
dirsep="."
refid="flare.flex.files">
<map from="${flare.flex.src}/" to=""/>
<mapper>
<chainedmapper><globmapper from="*.as" to="*"/></chainedmapper>
</mapper>
</pathconvert>
<!-- Now we build the .swc -->
<compc output="${build.dir}/flare-flex.swc" include-classes="${flare.flex.classes}">
<external-library-path file="${build.dir}/flare.swc" append="true"/>
<source-path path-element="${flare.flex.src}/"/>
</compc>
</target>
<!-- =================================================================== -->
<!-- Compile apps -->
<!-- =================================================================== -->
<target name="apps" depends="flare">
<mxmlc file="${apps.src}/flare/apps/JobVoyager.as"
output="${build.dir}/JobVoyager.swf">
<source-path path-element="${apps.src}"/>
<compiler.library-path dir="${build.dir}">
<include name="flare.swc"/>
</compiler.library-path>
</mxmlc>
<mxmlc file="${apps.src}/flare/apps/PackageMap.as"
output="${build.dir}/PackageMap.swf">
<source-path path-element="${apps.src}"/>
<compiler.library-path dir="${build.dir}">
<include name="flare.swc"/>
</compiler.library-path>
</mxmlc>
<mxmlc file="${apps.src}/flare/apps/DependencyGraph.as"
output="${build.dir}/DependencyGraph.swf">
<source-path path-element="${apps.src}"/>
<compiler.library-path dir="${build.dir}">
<include name="flare.swc"/>
</compiler.library-path>
<compiler.library-path dir="${FLEX_HOME}frameworks/libs">
<include name="framework.swc"/>
</compiler.library-path>
</mxmlc>
</target>
<!-- =================================================================== -->
<!-- Compile demos -->
<!-- =================================================================== -->
<target name="demos" depends="flare">
<mxmlc file="${demos.src}/demos.as" output="${build.dir}/flare.demos.swf">
<compiler.library-path dir="${build.dir}">
<include name="flare.swc"/>
</compiler.library-path>
</mxmlc>
</target>
<!-- =================================================================== -->
<!-- Compile tests -->
<!-- =================================================================== -->
<target name="tests" depends="prepare,flare">
<mxmlc file="${tests.src}/tests.as" output="${build.dir}/flare.tests.swf">
<compiler.library-path dir="${build.dir}">
<include name="flare.swc"/>
</compiler.library-path>
<compiler.library-path dir="${tests.lib}">
<include name="unitest.swc"/>
</compiler.library-path>
</mxmlc>
</target>
<!-- =================================================================== -->
<!-- Build all in ./build -->
<!-- =================================================================== -->
<target name="all" depends="flare,demos,apps,tests"/>
<!-- =================================================================== -->
<!-- Build reference documentation in docs -->
<!-- =================================================================== -->
<target name="docs">
<exec executable="${asdoc}">
<arg value="-output=${api.dir}"/>
<arg value="-doc-sources=${doc.source}"/>
<arg value="-main-title=${doc.title}"/>
<arg value="-window-title=${doc.title}"/>
<arg value="-footer=${doc.copyright}. Created ${datetime}."/>
<!-- ridiculously enough, it appears all package descriptions must
be provided using command line arguments... -->
<arg value="-package=flare.analytics,${doc.flare.analytics}"/>
<arg value="-package=flare.analytics.cluster,${doc.flare.analytics.cluster}"/>
<arg value="-package=flare.analytics.graph,${doc.flare.analytics.graph}"/>
<arg value="-package=flare.analytics.optimization,${doc.flare.analytics.optimization}"/>
<arg value="-package=flare.animate,${doc.flare.animate}"/>
<arg value="-package=flare.animate.interpolate,${doc.flare.animate.interpolate}"/>
<arg value="-package=flare.data,${doc.flare.data}"/>
<arg value="-package=flare.data.converters,${doc.flare.data.converters}"/>
<arg value="-package=flare.display,${doc.flare.display}"/>
<arg value="-package=flare.flex,${doc.flare.flex}"/>
<arg value="-package=flare.physics,${doc.flare.physics}"/>
<arg value="-package=flare.query,${doc.flare.query}"/>
<arg value="-package=flare.query.methods,${doc.flare.query.methods}"/>
<arg value="-package=flare.scale,${doc.flare.scale}"/>
<arg value="-package=flare.util,${doc.flare.util}"/>
<arg value="-package=flare.util.heap,${doc.flare.util.heap}"/>
<arg value="-package=flare.util.math,${doc.flare.util.math}"/>
<arg value="-package=flare.util.palette,${doc.flare.util.palette}"/>
<arg value="-package=flare.vis,${doc.flare.vis}"/>
<arg value="-package=flare.vis.axis,${doc.flare.vis.axis}"/>
<arg value="-package=flare.vis.controls,${doc.flare.vis.controls}"/>
<arg value="-package=flare.vis.data,${doc.flare.vis.data}"/>
<arg value="-package=flare.vis.data.render,${doc.flare.vis.data.render}"/>
<arg value="-package=flare.vis.events,${doc.flare.vis.events}"/>
<arg value="-package=flare.vis.legend,${doc.flare.vis.legend}"/>
<arg value="-package=flare.vis.operator,${doc.flare.vis.operator}"/>
<arg value="-package=flare.vis.operator.distortion,${doc.flare.vis.operator.distortion}"/>
<arg value="-package=flare.vis.operator.filter,${doc.flare.vis.operator.filter}"/>
<arg value="-package=flare.vis.operator.encoder,${doc.flare.vis.operator.encoder}"/>
<arg value="-package=flare.vis.operator.label,${doc.flare.vis.operator.label}"/>
<arg value="-package=flare.vis.operator.layout,${doc.flare.vis.operator.layout}"/>
</exec>
</target>
<!-- =================================================================== -->
<!-- Build distribution in ./dist -->
<!-- =================================================================== -->
<target name="dist" depends="clean,prepare,flare,demos">
<mkdir dir="${dist.dir}"/>
<!-- copy flare libraries -->
<copy todir="${dist.dir}">
<fileset dir="${basedir}" casesensitive="yes">
<include name="flare/**"/>
<include name="flare.tests/**"/>
<include name="flare.demos/**"/>
<include name="flare.apps/**"/>
<include name="etc/**"/>
<include name="*"/>
<exclude name="build/**"/>
<exclude name="**/.*"/>
<exclude name="**/bin/**"/>
<exclude name="**/bin-debug/**"/>
<exclude name="**/bin-release/**"/>
</fileset>
<fileset dir="${basedir}" casesensitive="yes">
<include name="**/.project"/>
<include name="**/.flexLibProperties"/>
<include name="**/.actionScriptProperties"/>
</fileset>
</copy>
<!-- copy binaries -->
<copy todir="${dist.dir}/build">
<fileset dir="${build.dir}">
<include name="*.swc"/>
<include name="*.swf"/>
</fileset>
</copy>
<fixcrlf srcdir="${dist.dir}"
eol="lf" eof="remove"
tablength="4" tab="remove"
includes="**/*.sh"
/>
<zip zipfile="${build.dir}/${name}-${version}-${DSTAMP}.zip"
basedir="${dist.dir}"
whenempty="create"
/>
<delete dir="${dist.dir}"/>
</target>
<!-- =================================================================== -->
<!-- Clean restores the distribution to original state -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${docs.dir}"/>
</target>
</project>