/
build.xml
507 lines (443 loc) · 20.7 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
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note:
If you modify this file you may have to make the same change in build_framework.xml.
build_framework.xml is renamed to build.xml when it is packaged.
It is used to build the frameworks directory from the zip file.
-->
<project name="frameworks" default="main" basedir=".">
<property name="ROYALE_HOME" location=".."/>
<!-- Required for OSX 10.6 / Snow Leopard Performance. -->
<!-- Java 7 on Mac requires OSX 10.7.3 or higher and is 64-bit only -->
<!-- local.d32 is set/used in build.properties so this needs to be done first. -->
<condition property="local.d32" value="-d32">
<and>
<os family="mac"/>
<matches pattern="1.6.*" string="${java.version}"/>
<equals arg1="${sun.arch.data.model}" arg2="64"/>
<equals arg1="${os.arch}" arg2="x86_64"/>
</and>
</condition>
<!-- Property for the platform. -->
<condition property="isMac">
<os family="mac"/>
</condition>
<condition property="isWindows">
<os family="windows" />
</condition>
<condition property="isLinux">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<property file="${ROYALE_HOME}/env.properties"/>
<property environment="env"/>
<property file="${ROYALE_HOME}/build.properties"/>
<property name="ROYALE_HOME" value="${ROYALE_HOME}" />
<target name="main" depends="check-compile-env,clean,prepare,compile,test,fonts"
description="Clean build of all SWCs"/>
<target name="check-compile-env" description="Check for the required environment variables">
<ant antfile="${ROYALE_HOME}/build.xml" target="check-compile-env" dir="${ROYALE_HOME}"/>
</target>
<target name="check-playerglobal" description="Check for the required environment variables">
<condition property="playerglobal.notneeded">
<available file="${basedir}/libs/player/${playerglobal.version}/playerglobal.swc" />
</condition>
<condition property="playerglobal.notneeded">
<isset property="env.PLAYERGLOBAL_HOME" />
</condition>
</target>
<target name="check-airglobal" description="Check for the required environment variables">
<condition property="airglobal.notneeded">
<available file="${basedir}/libs/air/airglobal.swc" />
</condition>
<condition property="airglobal.notneeded">
<isset property="env.AIR_HOME" />
</condition>
</target>
<target name="fake-playerglobal" description="copy js.swc as playerglobal.swc if needed" depends="check-playerglobal" unless="playerglobal.notneeded">
<mkdir dir="${basedir}/libs/player/${playerglobal.version}"/>
<copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${basedir}/libs/player/${playerglobal.version}/playerglobal.swc" />
</target>
<target name="fake-airglobal" description="copy js.swc as airglobal.swc if needed" depends="check-airglobal" unless="airglobal.notneeded">
<mkdir dir="${basedir}/libs/air"/>
<copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${basedir}/libs/air/airglobal.swc" />
</target>
<target name="prepare" depends="thirdparty-downloads">
<mkdir dir="${basedir}/js/libs" />
<mkdir dir="${basedir}/libs" />
<antcall target="fake-playerglobal" />
<antcall target="fake-airglobal" />
</target>
<target name="thirdparty-downloads" unless="no.thirdparty-downloads" description="Downloads all the required thirdparty code.">
<ant antfile="${basedir}/downloads.xml" dir="${basedir}"/>
</target>
<target name="compile" description="Builds all SWCs but not their resource bundles">
<!-- order may matter due to dependencies -->
<antcall target="Language"/>
<antcall target="Core"/>
<antcall target="Graphics"/>
<antcall target="Binding"/>
<antcall target="Reflection"/>
<antcall target="RoyaleUnit"/>
<antcall target="Collections"/>
<antcall target="Basic"/>
<antcall target="Ace"/>
<antcall target="HTML"/>
<antcall target="Effects"/>
<antcall target="Flat"/>
<antcall target="Charts"/>
<antcall target="DragDrop"/>
<antcall target="Formatters"/>
<antcall target="GoogleMaps"/>
<antcall target="CreateJS"/>
<antcall target="HTML5"/>
<antcall target="JQuery"/>
<antcall target="Mobile"/>
<antcall target="Storage"/>
<antcall target="XML"/>
<antcall target="Network"/>
<antcall target="Text"/>
<antcall target="TLF"/>
<antcall target="MaterialDesignLite"/>
<antcall target="FontAwesome"/>
<antcall target="Express"/>
<antcall target="RoyaleSite"/>
<antcall target="MXRoyale"/>
<antcall target="SparkRoyale"/>
<antcall target="Crux"/>
<antcall target="Jewel"/>
<antcall target="JewelTheme"/>
<antcall target="Icons"/>
</target>
<target name="test" description="Tests all SWCs">
<antcall target="RoyaleUnitTest"/>
<antcall target="CoreTest"/>
<antcall target="BasicTest"/>
<antcall target="ReflectionTest"/>
<antcall target="NetworkTest"/>
<antcall target="XMLTest"/>
</target>
<target name="fonts">
<ant dir="${basedir}/fontsrc" target="main"/>
</target>
<target name="other.locales" description ="Builds resource SWCs for all locales">
<!--<ant dir="${basedir}/projects/RoyaleUI" target="other.locales"/>-->
</target>
<target name="doc" >
<ant dir="${basedir}/projects/Core" target="doc" />
</target>
<!--
Cleanup
-->
<target name="super-clean" depends="thirdparty-clean,clean" description="Cleans everything including thirdparty downloads."/>
<target name="thirdparty-clean" unless="no.thirdparty-clean" description="Removes all thirdparty downloads.">
<ant antfile="${basedir}/downloads.xml" target="clean" dir="${basedir}"/>
</target>
<target name="clean" description="Cleans all SWCs and their resource bundles">
<!-- Delete output from SWC projects -->
<ant dir="${basedir}/projects/Binding" target="clean"/>
<ant dir="${basedir}/projects/Charts" target="clean"/>
<ant dir="${basedir}/projects/Collections" target="clean"/>
<ant dir="${basedir}/projects/Core" target="clean"/>
<ant dir="${basedir}/projects/DragDrop" target="clean"/>
<ant dir="${basedir}/projects/Effects" target="clean"/>
<ant dir="${basedir}/projects/Express" target="clean"/>
<ant dir="${basedir}/projects/Flat" target="clean"/>
<ant dir="${basedir}/projects/FontAwesome" target="clean"/>
<ant dir="${basedir}/projects/Formatters" target="clean"/>
<ant dir="${basedir}/projects/GoogleMaps" target="clean"/>
<ant dir="${basedir}/projects/CreateJS" target="clean"/>
<ant dir="${basedir}/projects/Graphics" target="clean"/>
<ant dir="${basedir}/projects/Basic" target="clean"/>
<ant dir="${basedir}/projects/HTML" target="clean"/>
<ant dir="${basedir}/projects/HTML5" target="clean"/>
<ant dir="${basedir}/projects/JQuery" target="clean"/>
<ant dir="${basedir}/projects/Language" target="clean"/>
<ant dir="${basedir}/projects/MaterialDesignLite" target="clean"/>
<ant dir="${basedir}/projects/Mobile" target="clean"/>
<ant dir="${basedir}/projects/Reflection" target="clean"/>
<ant dir="${basedir}/projects/RoyaleUnit" target="clean"/>
<ant dir="${basedir}/projects/Network" target="clean"/>
<ant dir="${basedir}/projects/Storage" target="clean"/>
<ant dir="${basedir}/projects/XML" target="clean"/>
<ant dir="${basedir}/projects/Text" target="clean"/>
<ant dir="${basedir}/projects/TLF" target="clean"/>
<ant dir="${basedir}/projects/RoyaleSite" target="clean"/>
<ant dir="${basedir}/projects/MXRoyale" target="clean"/>
<ant dir="${basedir}/projects/SparkRoyale" target="clean"/>
<ant dir="${basedir}/projects/Crux" target="clean"/>
<ant dir="${basedir}/projects/Jewel" target="clean"/>
<ant dir="${basedir}/projects/Icons" target="clean"/>
<ant dir="${basedir}/themes/JewelTheme" target="clean"/>
<ant dir="${basedir}/fontsrc" target="clean"/>
<!-- delete the FlashBuilder executable directories -->
<delete includeemptydirs="true" failonerror="false">
<fileset dir="${basedir}/projects">
<include name="*/bin/**"/>
</fileset>
</delete>
<!-- Delete empty folders -->
<delete dir="${basedir}/libs" failonerror="false">
<include name="*.swc"/>
</delete>
<!-- <delete dir="${basedir}/libs"/> -->
<delete dir="${basedir}/locale">
<exclude name="**/metadata.properties"/>
</delete>
<delete dir="${basedir}/libs/generated"/>
<!-- Delete only if it exists and it is empty. air and swfobject put dirs here. -->
<delete dir="${ROYALE_HOME}/templates" includeemptydirs="true" failonerror="false">
<exclude name="swfobject/index.template.html" />
<exclude name="swfobject/expressInstall.swf" />
<exclude name="swfobject/swfobject.js" />
<exclude name="swfobject/history/**" />
<exclude name="js-index-template.html" />
</delete>
</target>
<target name="Binding" description="Clean build of Binding.swc">
<ant dir="${basedir}/projects/Binding"/>
</target>
<target name="Charts" description="Clean build of Charts.swc">
<ant dir="${basedir}/projects/Charts"/>
</target>
<target name="Core" description="Clean build of Core.swc">
<ant dir="${basedir}/projects/Core"/>
</target>
<target name="CoreTest" description="Test of Core.swc">
<ant dir="${basedir}/projects/Core" target="test"/>
</target>
<target name="Collections" description="Clean build of Collections.swc">
<ant dir="${basedir}/projects/Collections"/>
</target>
<target name="CreateJS" description="Clean build of CreateJS.swc">
<ant dir="${basedir}/projects/CreateJS"/>
</target>
<target name="DragDrop" description="Clean build of DragDrop.swc">
<ant dir="${basedir}/projects/DragDrop"/>
</target>
<target name="Effects" description="Clean build of Effects.swc">
<ant dir="${basedir}/projects/Effects"/>
</target>
<target name="Express" description="Clean build of Express.swc">
<ant dir="${basedir}/projects/Express"/>
</target>
<target name="Flat" description="Clean build of Flat.swc">
<ant dir="${basedir}/projects/Flat"/>
</target>
<target name="FontAwesome" description="Clean build of FontAwesome.swc">
<ant dir="${basedir}/projects/FontAwesome"/>
</target>
<target name="Formatters" description="Clean build of Formatters.swc">
<ant dir="${basedir}/projects/Formatters"/>
</target>
<target name="GoogleMaps" description="Clean build of GoogleMaps.swc">
<ant dir="${basedir}/projects/GoogleMaps"/>
</target>
<target name="Graphics" description="Clean build of Graphics.swc">
<ant dir="${basedir}/projects/Graphics"/>
</target>
<target name="Basic" description="Clean build of Basic.swc">
<ant dir="${basedir}/projects/Basic"/>
</target>
<target name="BasicTest" description="Test of Basic.swc">
<ant dir="${basedir}/projects/Basic" target="test"/>
</target>
<target name="HTML" description="Clean build of HTML.swc">
<ant dir="${basedir}/projects/HTML"/>
</target>
<target name="HTML5" description="Clean build of HTML5.swc">
<ant dir="${basedir}/projects/HTML5"/>
</target>
<target name="Ace" description="Clean build of Ace.swc">
<ant dir="${basedir}/projects/Ace"/>
</target>
<target name="JQuery" description="Clean build of JQuery.swc">
<ant dir="${basedir}/projects/JQuery"/>
</target>
<target name="Language" description="Clean build of Language.swc">
<ant dir="${basedir}/projects/Language"/>
</target>
<target name="MaterialDesignLite" description="Clean build of MaterialDesignLite.swc">
<ant dir="${basedir}/projects/MaterialDesignLite"/>
</target>
<target name="Mobile" description="Clean build of Mobile.swc">
<ant dir="${basedir}/projects/Mobile"/>
</target>
<target name="Network" description="Clean build of Network.swc">
<ant dir="${basedir}/projects/Network"/>
</target>
<target name="NetworkTest" description="Test of Network.swc">
<ant dir="${basedir}/projects/Network" target="test"/>
</target>
<target name="Reflection" description="Clean build of Reflection.swc">
<ant dir="${basedir}/projects/Reflection"/>
</target>
<target name="ReflectionTest" description="Test of Reflection.swc">
<ant dir="${basedir}/projects/Reflection" target="test"/>
</target>
<target name="RoyaleUnit" description="Clean build of RoyaleUnit.swc">
<ant dir="${basedir}/projects/RoyaleUnit"/>
</target>
<target name="RoyaleUnitTest" description="Test of RoyaleUnit.swc">
<ant dir="${basedir}/projects/RoyaleUnit" target="test"/>
</target>
<target name="Storage" description="Clean build of Storage.swc">
<ant dir="${basedir}/projects/Storage"/>
</target>
<target name="XML" description="Clean build of XML.swc">
<ant dir="${basedir}/projects/XML"/>
</target>
<target name="XMLTest" description="Test of XML.swc">
<ant dir="${basedir}/projects/XML" target="test"/>
</target>
<target name="Text" description="Clean build of Text.swc">
<ant dir="${basedir}/projects/Text"/>
</target>
<target name="TLF" description="Clean build of TLF.swc">
<ant dir="${basedir}/projects/TLF"/>
</target>
<target name="RoyaleSite" description="Clean build of RoyaleSite.swc">
<ant dir="${basedir}/projects/RoyaleSite"/>
</target>
<target name="MXRoyale" description="Clean build of MXRoyale.swc">
<ant dir="${basedir}/projects/MXRoyale"/>
</target>
<target name="SparkRoyale" description="Clean build of SparkRoyale.swc">
<ant dir="${basedir}/projects/SparkRoyale"/>
</target>
<target name="Crux" description="Clean build of Crux.swc">
<ant dir="${basedir}/projects/Crux"/>
</target>
<target name="Jewel" description="Clean build of Jewel.swc">
<ant dir="${basedir}/projects/Jewel"/>
</target>
<target name="JewelTheme" description="Clean build of JewelTheme.swc">
<ant dir="${basedir}/themes/JewelTheme"/>
</target>
<target name="Icons" description="Clean build of Icons.swc">
<ant dir="${basedir}/projects/Icons"/>
</target>
<target name="create-config" depends="playerglobal-setswfversion" description="Copy the config template and inject version numbers">
<copy file="${basedir}/${configname}-config-template.xml" tofile="${basedir}/${configname}-config.xml" overwrite="true">
<filterset>
<filter token="playerversion" value="${playerglobal.version}"/>
<filter token="swfversion" value="${playerglobal.swfversion}"/>
<filter token="locale" value="${locale}"/>
</filterset>
</copy>
<antcall target="tweak-for-jsonly" />
</target>
<target name="tweak-for-jsonly" unless="env.AIR_HOME">
<replace file="${basedir}/${configname}-config.xml"
token="{playerglobalHome}" value="libs/player" />
<replace file="${basedir}/${configname}-config.xml"
token="<path-element>libs</path-element>"
value="<path-element>js/libs</path-element>" />
<replace file="${basedir}/${configname}-config.xml"
token="<target>SWF</target>"
value="" />
</target>
<target name="playerglobal-setswfversion" description="Set the swfversion to insert into the -config file">
<condition property="playerglobal.swfversion" value="11">
<equals arg1="${playerglobal.version}" arg2="10.2" />
</condition>
<condition property="playerglobal.swfversion" value="12">
<equals arg1="${playerglobal.version}" arg2="10.3" />
</condition>
<condition property="playerglobal.swfversion" value="13">
<equals arg1="${playerglobal.version}" arg2="11.0" />
</condition>
<condition property="playerglobal.swfversion" value="14">
<equals arg1="${playerglobal.version}" arg2="11.1" />
</condition>
<condition property="playerglobal.swfversion" value="15">
<equals arg1="${playerglobal.version}" arg2="11.2" />
</condition>
<condition property="playerglobal.swfversion" value="16">
<equals arg1="${playerglobal.version}" arg2="11.3" />
</condition>
<condition property="playerglobal.swfversion" value="17">
<equals arg1="${playerglobal.version}" arg2="11.4" />
</condition>
<condition property="playerglobal.swfversion" value="18">
<equals arg1="${playerglobal.version}" arg2="11.5" />
</condition>
<condition property="playerglobal.swfversion" value="19">
<equals arg1="${playerglobal.version}" arg2="11.6" />
</condition>
<condition property="playerglobal.swfversion" value="20">
<equals arg1="${playerglobal.version}" arg2="11.7" />
</condition>
<condition property="playerglobal.swfversion" value="21">
<equals arg1="${playerglobal.version}" arg2="11.8" />
</condition>
<condition property="playerglobal.swfversion" value="22">
<equals arg1="${playerglobal.version}" arg2="11.9" />
</condition>
<condition property="playerglobal.swfversion" value="23">
<equals arg1="${playerglobal.version}" arg2="12.0" />
</condition>
<condition property="playerglobal.swfversion" value="24">
<equals arg1="${playerglobal.version}" arg2="13.0" />
</condition>
<condition property="playerglobal.swfversion" value="25">
<equals arg1="${playerglobal.version}" arg2="14.0" />
</condition>
<condition property="playerglobal.swfversion" value="26">
<equals arg1="${playerglobal.version}" arg2="15.0" />
</condition>
<condition property="playerglobal.swfversion" value="27">
<equals arg1="${playerglobal.version}" arg2="16.0" />
</condition>
<condition property="playerglobal.swfversion" value="28">
<equals arg1="${playerglobal.version}" arg2="17.0" />
</condition>
<condition property="playerglobal.swfversion" value="29">
<equals arg1="${playerglobal.version}" arg2="18.0" />
</condition>
<condition property="playerglobal.swfversion" value="30">
<equals arg1="${playerglobal.version}" arg2="19.0" />
</condition>
<condition property="playerglobal.swfversion" value="31">
<equals arg1="${playerglobal.version}" arg2="20.0" />
</condition>
<condition property="playerglobal.swfversion" value="32">
<equals arg1="${playerglobal.version}" arg2="21.0" />
</condition>
<condition property="playerglobal.swfversion" value="33">
<equals arg1="${playerglobal.version}" arg2="22.0" />
</condition>
<condition property="playerglobal.swfversion" value="34">
<equals arg1="${playerglobal.version}" arg2="23.0" />
</condition>
<condition property="playerglobal.swfversion" value="35">
<equals arg1="${playerglobal.version}" arg2="24.0" />
</condition>
<condition property="playerglobal.swfversion" value="36">
<equals arg1="${playerglobal.version}" arg2="25.0" />
</condition>
<condition property="playerglobal.swfversion" value="37">
<equals arg1="${playerglobal.version}" arg2="26.0" />
</condition>
<condition property="playerglobal.swfversion" value="38">
<equals arg1="${playerglobal.version}" arg2="27.0" />
</condition>
</target>
</project>