forked from apache/royale-asjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
2011 lines (1762 loc) · 92.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
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
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?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.
-->
<project name="asjs" default="main" basedir=".">
<property name="ROYALE_HOME" location="${basedir}"/>
<!-- 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="windows"/>
<equals arg1="${sun.arch.data.model}" arg2="64"/>
<equals arg1="${os.arch}" arg2="x86_64"/>
<equals arg1="${ant.java.version}" arg2="1.6"/>
</and>
</condition>
<property file="${ROYALE_HOME}/env.properties"/>
<property environment="env"/>
<property file="${ROYALE_HOME}/local.properties"/>
<property file="${ROYALE_HOME}/build.properties"/>
<property name="debug" value="true"/>
<property name="strict" value="true"/>
<property name="javac.src" value="1.7"/>
<property name="kit.prefix" value="apache-royale-${release.version}"/>
<property name="source.kit" value="${kit.prefix}-src"/>
<condition property="binary.kit" value="${kit.prefix}-bin-js">
<not>
<isset property="env.AIR_HOME" />
</not>
</condition>
<property name="binary.kit" value="${kit.prefix}-bin-js-swf"/>
<property name="binary-js.kit" value="${kit.prefix}-bin-js"/>
<property name="staging-dir" value="${basedir}/temp/royale-asjs" />
<condition property="isMac" value="mac">
<os family="mac" />
</condition>
<condition property="isWindows" value="windows">
<os family="windows" />
</condition>
<condition property="isLinux" value="linux">
<and>
<os family="unix" />
<not>
<isset property="isMac" />
</not>
</and>
</condition>
<!-- turn off SWF portion of checkintest if no AIR_HOME -->
<condition property="runtime.setup">
<not>
<isset property="env.AIR_HOME" />
</not>
</condition>
<condition property="mxmlc.jar.exists">
<not>
<isset property="env.AIR_HOME" />
</not>
</condition>
<!--
Optional jars but should be in place for a real release build.
For <grep> put AntelopeTasks_*.jar in this path.
See version-update.
For <rat> apache-rat-0.8.jar and apache-rat-tasks-0.8.jar should be in classpath.
See rat-check.
-->
<path id="anttask.classpath">
<fileset dir="${env.ANT_HOME}/lib">
<include name="**/AntelopeTasks_*.jar"/>
<include name="**/apache-rat*.jar"/>
</fileset>
<fileset dir="${user.home}">
<include name=".ant/lib/**/AntelopeTasks_*.jar"/>
<include name=".ant/lib/**/apache-rat*.jar"/>
</fileset>
</path>
<!--
Notes: If you're running the main target, then there is no need to call clean first.
Each of the main targets for the modules will call clean themselves before proceeding.
-->
<target name="main" depends="check-if-ide,prebuild,frameworks,post-build,last-message-if-airsdk" description="Full build" unless="airsdk.found">
<tstamp>
<format property="build.datetime" pattern="MM/dd/yyyy hh:mm:ss aa" />
</tstamp>
<echo>ant main target completed on ${build.datetime}</echo>
</target>
<target name="main-jenkins" depends="dump-config,prebuild,frameworks,post-build" description="Full build">
<tstamp>
<format property="build.datetime" pattern="MM/dd/yyyy hh:mm:ss aa" />
</tstamp>
<echo>ant main target completed on ${build.datetime}</echo>
</target>
<target name="dump-config" unless="airsdk.found" >
<property name="is.jenkins" value="true" />
<echo>env.USERNAME is: ${env.USERNAME}</echo>
<condition property="FLASHLOG"
value="c:/Documents and Settings/${env.USERNAME}/Application Data/Macromedia/Flash Player/Logs/flashlog.txt">
<available file="c:/Documents and Settings/${env.USERNAME}/Application Data/Macromedia/Flash Player/Logs/flashlog.txt"
type="file"/>
</condition>
<condition property="FLASHLOG"
value="c:/Users/${env.USERNAME}/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt">
<available file="c:/Users/${env.USERNAME}/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt"
type="file"/>
</condition>
<!-- Check the system user profile -->
<condition property="FLASHLOG"
value="C:/Windows/system32/config/systemprofile/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt">
<available file="C:/Windows/system32/config/systemprofile/AppData/Roaming/Macromedia/Flash Player/Logs/flashlog.txt"
type="file"/>
</condition>
<antcall target="copy-flashlog"/>
</target>
<target name="copy-flashlog" if="FLASHLOG">
<echo>copying last flashlog.txt from ${FLASHLOG}</echo>
<copy file="${FLASHLOG}" tofile="${basedir}/lastflashlog.txt" />
</target>
<target name="block-flat-fonts">
<property name="flat.donot.ask" value="true" />
</target>
<target name="release"
depends="block-flat-fonts,check-compiler-home,check-typedefs-home,source-release,binary-release,rat-check"
description="Creates source and binary kits for Apache Royale."/>
<target name="release-jenkins"
depends="check-compile-env,check-runtime-env,check-compiler-home,source-release,binary-release-jenkins,rat-check"
description="Creates source and binary kits for Apache Royale."/>
<target name="source-release"
depends="super-clean,create-description,create-config,source-package"
description="Packages the source release kit which is the official Apache release."/>
<target name="binary-release"
depends="setup-binary-release,set.base.folder,build-all,main,sample-themes,checkintests,check-goog-home,binary-package,jsonly-package"
description="Builds and packages the binary kit which is provided as a convenience."/>
<target name="binary-release-jenkins"
depends="setup-binary-release,main-jenkins,sample-themes,binary-package"
description="Builds and packages the binary kit which is provided as a convenience."/>
<target name="source-release-noclean"
depends="create-description,create-config,source-package"
description="Packages the source release kit which is the official Apache release."/>
<target name="binary-release-noclean"
depends="main,sample-themes,checkintests,binary-package"
description="Builds and packages the binary kit which is provided as a convenience."/>
<target name="doc-packages"
depends="asdoc-package,javadocs"
description="Build and package the asdocs for the framework clases and the javadocs."/>
<target name="help">
<echo message="run ant -projecthelp to see the available targets"/>
</target>
<!--
To clean these you must call thirdparty-clean or super-clean to clean everything.
clean does not remove these since they don't change often and the downloads take time.
-->
<target name="thirdparty-downloads" description="Downloads all the required thirdparty code." unless="airsdk.found">
<ant dir="${basedir}/frameworks" target="thirdparty-downloads"/>
<condition property="env.GOOG_HOME" value="${basedir}/js/lib/google/closure-library">
<not>
<isset property="env.GOOG_HOME" />
</not>
</condition>
<!-- <ant dir="${basedir}/frameworks/js" target="thirdparty-downloads"/> -->
<!-- don't ask again about these since we just did if these weren't already set -->
<property name="build.noprompt" value="set" />
<!-- this flag is used by frameworks/build.xml to prevent a second download -->
<property name="no.thirdparty-downloads" value="set" />
</target>
<target name="prebuild" depends="check-compile-env,thirdparty-downloads,create-description,copy-externs,copy-compiler,create-config"
description="Stuff that needs to be done before any builds." unless="airsdk.found"/>
<target name="check-compile-env" depends="check-playerglobal-home,check-air-home,check-compiler-home" unless="airsdk.found"
description="Check for the required environment variables for compilation.">
<echo>OS: ${os.name} / ${os.version} / ${os.arch}</echo>
<echo>VM: ${java.vm.name} / ${java.vm.version}</echo>
<echo>Java: ${java.version}</echo>
<echo>Ant: ${ant.version} Ant Java Version: ${ant.java.version}</echo>
</target>
<target name="check-playerglobal-home" if="env.PLAYERGLOBAL_HOME"
description="Check PLAYERGLOBAL_HOME for both a directory and a swc file">
<echo message="PLAYERGLOBAL_HOME is ${env.PLAYERGLOBAL_HOME}"/>
<echo message="playerglobal.version is ${playerglobal.version}"/>
<available file="${env.PLAYERGLOBAL_HOME}"
type="dir"
property="PLAYERGLOBAL_HOME.set"/>
<fail message="The environment variable PLAYERGLOBAL_HOME is not set to a directory"
unless="PLAYERGLOBAL_HOME.set"/>
<property name="playerglobal.swc"
value="${env.PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc"/>
<available file="${playerglobal.swc}"
type="file"
property="playerglobal.swc.exists"/>
<fail message="The file ${playerglobal.swc} does not exist"
unless="playerglobal.swc.exists"/>
<echo message="playerglobal.swc is ${playerglobal.swc}"/>
</target>
<target name="check-air-home" if="env.AIR_HOME"
description="Check that AIR_HOME is a directory">
<echo message="AIR_HOME is ${env.AIR_HOME}"/>
<condition property="AIR_HOME.set">
<and>
<length string="${env.AIR_HOME}" when="greater" length="0" />
<available file="${env.AIR_HOME}" type="dir"/>
<!--available file="${env.AIR_HOME}/bin/adt" type="file"/-->
</and>
</condition>
<fail message="The environment variable AIR_HOME must be set to the AIR SDK Kit directory"
unless="AIR_HOME.set"/>
</target>
<target name="check-goog-home" unless="GOOG_HOME"
description="Check that GOOG_HOME is a directory">
<echo message="GOOG_HOME is ${env.GOOG_HOME}"/>
<available file="${env.GOOG_HOME}"
type="dir"
property="GOOG_HOME"
value="${env.GOOG_HOME}" />
</target>
<target name="check-compiler-home" unless="ROYALE_COMPILER_REPO"
description="Check ROYALE_COMPILER_REPO is a directory.">
<echo message="env.ROYALE_COMPILER_REPO is ${env.ROYALE_COMPILER_REPO}"/>
<available file="${env.ROYALE_COMPILER_REPO}/compiler/lib/compiler-mxmlc.jar"
type="file"
property="ROYALE_COMPILER_REPO"
value="${env.ROYALE_COMPILER_REPO}"/>
<echo message="ROYALE_COMPILER_REPO is ${ROYALE_COMPILER_REPO}"/>
<condition property="ROYALE_COMPILER_REPO" value="${basedir}/../royale-compiler">
<and>
<available file="${basedir}/../royale-compiler/compiler/lib/compiler-mxmlc.jar" type="file" />
<not>
<isset property="ROYALE_COMPILER_REPO" />
</not>
</and>
</condition>
<echo message="ROYALE_COMPILER_REPO is ${ROYALE_COMPILER_REPO}"/>
<fail message="ROYALE_COMPILER_REPO must be set to a folder with a compiler/lib sub-folder containing compiler-mxmlc.jar such as the top-level folder in royale-compiler repo"
unless="ROYALE_COMPILER_REPO"/>
</target>
<target name="check-typedefs-home" unless="ROYALE_TYPEDEFS_HOME"
description="Check ROYALE_TYPEDEFS_HOME is a directory.">
<echo message="ROYALE_TYPEDEFS_HOME is ${env.ROYALE_TYPEDEFS_HOME}"/>
<available file="${env.ROYALE_TYPEDEFS_HOME}/js/target/js.swc"
type="file"
property="ROYALE_TYPEDEFS_HOME"
value="${env.ROYALE_TYPEDEFS_HOME}"/>
<available file="${basedir}/../royale-typedefs/js/target/js.swc"
type="file"
property="ROYALE_TYPEDEFS_HOME"
value="${basedir}/../royale-typedefs"/>
<available file="${basedir}/js/target/js.swc"
type="file"
property="ROYALE_TYPEDEFS_HOME"
value="${basedir}"/>
<echo>basedir is ${basedir}</echo>
<fail message="ROYALE_TYPEDEFS_HOME must be set to a folder containing js/target/js.swc such as the royale-typedefs repo"
unless="ROYALE_TYPEDEFS_HOME"/>
</target>
<target name="swf-js-output-royale-description" if="env.PLAYERGLOBAL_HOME">
<echo file="${basedir}/royale-sdk-description.xml" append="true">
<output-targets>
<output-target name="js" version="Ecma5Strict" />
<output-target name="swf" version="AS3" AIR="${air.version}" Flash="${playerglobal.version}" />
</output-targets>
</royale-sdk-description>
</echo>
</target>
<target name="js-output-royale-description" unless="env.PLAYERGLOBAL_HOME">
<echo file="${basedir}/royale-sdk-description.xml" append="true">
<output-targets>
<output-target name="js" version="Ecma5Strict" />
</output-targets>
</royale-sdk-description>
</echo>
</target>
<target name="create-jsonly-description">
<tstamp>
<format property="build.number.date" pattern="yyyyMMdd" />
</tstamp>
<echo message="build.number is ${build.number.date}"/>
<echo file="${basedir}/temp/royale-asjs/royale-sdk-description.xml"><?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.
-->
<royale-sdk-description>
<name>${release.name}</name>
<version>${release.version}</version>
<build>${build.number.date}</build>
<output-targets>
<output-target name="js" version="Ecma5Strict" />
</output-targets>
</royale-sdk-description>
</echo>
</target>
<target name="create-description" description="Generate flex-sdk-description.xml" unless="airsdk.found">
<tstamp>
<format property="build.number.date" pattern="yyyyMMdd" />
</tstamp>
<echo message="build.number is ${build.number.date}"/>
<echo file="${basedir}/flex-sdk-description.xml"><?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.
-->
<flex-sdk-description>
<name>${release.name} ${release.version} FP${playerglobal.version} AIR${air.version} ${locale}</name>
<version>${fb.release.version}</version>
<build>${build.number.date}</build>
</flex-sdk-description>
</echo>
<echo file="${basedir}/royale-sdk-description.xml"><?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.
-->
<royale-sdk-description>
<name>${release.name}</name>
<version>${release.version}</version>
<build>${build.number.date}</build>
</echo>
<antcall target="js-output-royale-description" />
<antcall target="swf-js-output-royale-description" />
</target>
<target name="create-config" description="Create config files" unless="airsdk.found">
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="royale" />
</ant>
<antcall target="tweak-for-jsonly" />
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="air" />
</ant>
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="js" />
</ant>
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="ace" />
</ant>
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="jquery" />
</ant>
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="createjs" />
</ant>
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="node" />
</ant>
<ant dir="${basedir}/frameworks" target="create-config">
<property name="configname" value="flex" />
</ant>
<!-- hack to keep compiler happy -->
<mkdir dir="${ROYALE_HOME}/frameworks/themes/Spark" />
<echo file="${ROYALE_HOME}/frameworks/themes/Spark/spark.css">/*
* 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.
*
*/
/* generated by build script */
</echo>
</target>
<target name="copy-externs" depends="check-typedefs-home" description="Copy extern swcs into this folder">
<mkdir dir="${basedir}/js/libs" />
<copy todir="${basedir}/js/libs" flatten="true">
<fileset dir="${ROYALE_TYPEDEFS_HOME}">
<include name="**/*.swc"/>
</fileset>
</copy>
<antcall target="rename_jquery" />
</target>
<target name="copy-compiler" depends="check-compiler-home" description="Copy compiler jars to where they are supposed to go">
<mkdir dir="${basedir}/lib" />
<echo>Copying Compiler from ${ROYALE_COMPILER_REPO}</echo>
<copy todir="${basedir}/lib">
<fileset dir="${ROYALE_COMPILER_REPO}/compiler/lib">
<include name="**"/>
<exclude name="external/jburg.jar"/>
<exclude name="external/jflex*"/>
<exclude name="external/junit*"/>
</fileset>
</copy>
<mkdir dir="${basedir}/bin" />
<copy todir="${basedir}/bin">
<fileset dir="${ROYALE_COMPILER_REPO}/compiler/src/assembly/scripts">
<include name="**"/>
</fileset>
</copy>
<chmod dir="${basedir}/bin" excludes="**/*.bat" perm="+x" />
<mkdir dir="${basedir}/js/lib" />
<echo>Copying Transpiler from ${ROYALE_COMPILER_REPO}</echo>
<copy todir="${basedir}/js/lib">
<fileset dir="${ROYALE_COMPILER_REPO}/compiler-jx/lib">
<include name="**"/>
<exclude name="junit*"/>
</fileset>
</copy>
<!-- needed to make Flash Builder accept folder as a Flex SDK -->
<copy file="${ROYALE_COMPILER_REPO}/compiler/lib/compiler-mxmlc.jar" tofile="${basedir}/lib/mxmlc.jar" />
<copy file="${ROYALE_COMPILER_REPO}/compiler/lib/compiler-mxmlc.jar" tofile="${basedir}/lib/adt.jar" />
<!-- compc used to come from flex-compiler-oem, hopefull this one is ok as well -->
<copy file="${ROYALE_COMPILER_REPO}/compiler/lib/compiler-compc.jar" tofile="${basedir}/lib/compc.jar" />
</target>
<target name="check_jquery" >
<condition property="jquery_exists">
<available file="${basedir}/js/libs/jquery.swc" />
</condition>
</target>
<target name="rename_jquery" depends="check_jquery" unless="jquery_exists" >
<move file="${basedir}/js/libs/jquery-1.9.swc" tofile="${basedir}/js/libs/jquery.swc" />
</target>
<target name="setup-binary-release" depends="thirdparty-clean"
description="Set properties needed to turn on features for release sdk">
<!--
For a release build, download everything fresh.
Build changes to the downloads, might not be caught by the refresh logic.
thirdparty-clean should leave this directory empty but just in case...
-->
<delete dir="${basedir}/in" failonerror="false" includeEmptyDirs="true" />
<!-- generate localized compiler message jars -->
<property name="localized.jars" value="true" />
<property name="release.target" value="true" />
</target>
<!--
Cleanup
-->
<target name="super-clean" depends="thirdparty-clean,clean" description="Cleans everything including thirdparty downloads.">
<delete dir="${basedir}/mustella/tests/basicTests/bin"/>
<delete dir="${basedir}/mustella/tests/mxtests/basicTests/bin"/>
<delete dir="${basedir}/bin" failonerror="false">
<include name="**"/>
<exclude name=".gitignore"/>
</delete>
<delete dir="${basedir}/lib" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${basedir}/js/lib" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${ROYALE_HOME}/frameworks/libs/player" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${ROYALE_HOME}/frameworks/libs/air" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${ROYALE_HOME}/frameworks/locale" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${ROYALE_HOME}/frameworks/mx" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${ROYALE_HOME}/frameworks/rsls" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${ROYALE_HOME}/frameworks/themes/Halo" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${ROYALE_HOME}/frameworks/themes/Spark" failonerror="false" includeEmptyDirs="true"/>
<delete file="${ROYALE_HOME}/frameworks/airmobile-config.xml" failonerror="false"/>
<delete file="${ROYALE_HOME}/frameworks/macfonts.ser" failonerror="false"/>
<delete file="${ROYALE_HOME}/frameworks/winfonts.ser" failonerror="false"/>
<delete file="${ROYALE_HOME}/frameworks/localfonts.ser" failonerror="false"/>
<delete file="${ROYALE_HOME}/frameworks/mxml-manifest.xml" failonerror="false"/>
<delete file="${ROYALE_HOME}/frameworks/spark-manifest.xml" failonerror="false"/>
<delete file="${ROYALE_HOME}/ide/flashbuilder/flashbuilder-config.xml" failonerror="false"/>
<delete dir="${basedir}" failonerror="false">
<include name="**/*.log"/>
<include name="**/*.mdmp"/>
</delete>
</target>
<target name="thirdparty-clean" description="Removes all thirdparty downloads.">
<ant dir="${basedir}/frameworks" target="thirdparty-clean"/>
<delete dir="${basedir}/in"/>
<delete dir="${basedir}/lib"/>
<delete dir="${basedir}/marmotinni/java/lib"/>
</target>
<target name="clean" depends="examples-clean,frameworks-clean,package-clean,checkintests-clean,mxtests-clean"
description="Full clean excluding thirdparty downloads">
<delete file="${basedir}/royale-sdk-description.xml" failonerror="false"/>
<delete file="${basedir}/rat.report" failonerror="false"/>
<delete dir="${basedir}/examples" failonerror="false">
<include name="**/*.swc"/>
<include name="**/*.swf"/>
</delete>
<delete dir="${basedir}/js/libs" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${basedir}/out" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${basedir}/temp" failonerror="false" includeEmptyDirs="true"/>
<delete dir="${basedir}/tempDoc" failonerror="false" includeEmptyDirs="true"/>
<ant dir="${basedir}/asdoc" target="clean" />
<!--
<ant dir="${basedir}/ide/flashbuilder" target="clean" />
-->
</target>
<target name="examples-clean">
<ant dir="${basedir}/examples" target="clean"/>
<ant dir="${basedir}/manualtests" target="clean"/>
</target>
<target name="frameworks-clean">
<ant dir="${basedir}/frameworks" target="clean"/>
<ant dir="${basedir}/frameworks/js" target="clean"/>
</target>
<target name="package-clean">
<delete dir="${basedir}/out" failonerror="false" includeEmptyDirs="true"/>
<antcall target="clean-temp"/>
</target>
<target name="checkintests-clean">
<delete file="${basedir}/mustella/tests/basicTests/BasicTestsApp.swf" failonerror="false"/>
<delete dir="${basedir}/mustella/tests/basicTests/bin" failonerror="false" includeEmptyDirs="true"/>
</target>
<target name="player-clean">
<delete dir="${basedir}/in/player" failonerror="false" includeEmptyDirs="true"/>
</target>
<!--
Build Examples
-->
<target name="examples" description="Build the examples"
depends="prebuild,check-goog-home">
<ant dir="${basedir}/examples"/>
</target>
<!--
Build framework SWCs
-->
<target name="frameworks" description="Full build of all Actionscript framework SWCs, including resource bundles and themes" unless="airsdk.found">
<ant dir="${basedir}/frameworks">
<property name="locale" value="${locale}"/>
</ant>
<antcall target="tweak-for-jsonly"/>
</target>
<target name="sample-themes" description="Build the sample themes">
<!--<ant dir="${basedir}/samples/themes/zen" target="main" /> -->
</target>
<target name="javadocs"
description="Build javadoc for compiler oem interface">
<javadoc destdir="${basedir}/javadoc" useexternalfile="yes" maxmemory="128m">
<classpath>
<fileset dir="${basedir}/lib">
<include name="flex-compiler-oem.jar"/>
</fileset>
</classpath>
<fileset dir="${basedir}/modules/compiler/src/java/royale2/tools/oem">
<include name="*.java"/>
<exclude name="**/*.properties"/>
</fileset>
</javadoc>
<mkdir dir="${basedir}/out"/>
<zip destfile="${basedir}/out/${kit.prefix}-compiler-api-javadocs.zip" basedir="${ROYALE_HOME}/javadoc"/>
<delete dir="${basedir}/javadoc" failonerror="false" includeEmptyDirs="true"/>
</target>
<target name="ide" description="Build any ide specific files" unless="airsdk.found">
<!--<ant dir="${basedir}/ide/flashbuilder" />-->
</target>
<target name="post-build" depends="ide" description="Handle post-build activities" unless="airsdk.found">
<!-- fake a bunch of files to make the folder appear like a valid Flex SDK to Flash Builder -->
<echo file="${ROYALE_HOME}/ide/flashbuilder/flashbuilder-config.xml"><?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.
-->
<flashbuilder-config>
<express-install-swf>expressInstall.swf</express-install-swf>
</flashbuilder-config>
</echo>
<echo file="${ROYALE_HOME}/frameworks/mxml-manifest.xml"><?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.
-->
<componentPackage>
</componentPackage>
</echo>
<echo file="${ROYALE_HOME}/frameworks/spark-manifest.xml"><?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.
-->
<componentPackage>
</componentPackage>
</echo>
<mkdir dir="${ROYALE_HOME}/frameworks/locale" />
<mkdir dir="${ROYALE_HOME}/frameworks/mx" />
<mkdir dir="${ROYALE_HOME}/frameworks/projects" />
<mkdir dir="${ROYALE_HOME}/frameworks/rsls" />
<mkdir dir="${ROYALE_HOME}/frameworks/themes/Halo" />
<copy file="${ROYALE_HOME}/js/libs/js.swc"
tofile="${ROYALE_HOME}/frameworks/themes/Halo/Halo.swc" />
<copy file="${ROYALE_HOME}/frameworks/air-config.xml"
tofile="${ROYALE_HOME}/frameworks/airmobile-config.xml" />
<touch file="${ROYALE_HOME}/frameworks/macfonts.ser" />
<touch file="${ROYALE_HOME}/frameworks/winfonts.ser" />
<touch file="${ROYALE_HOME}/frameworks/localfonts.ser" />
</target>
<!--
Build the ASDoc html pages.
-->
<target name="asdoc" description="asdoc">
<ant dir="${basedir}/asdoc" />
</target>
<!--
Package up the Apache Royale sources. Do not include empty directories.
Note: even if cleaned, this will package up unversioned files that happen
to be in the tree.
FixMe: clean needs to clean - add code to detect unversioned files
-->
<target name="source-package" depends="stage-source,stage-compiler,stage-typedefs,stage-top-level,source-package-zip,source-package-tgz"
description="Package source files required to build in zip and tar-gzip file">
</target>
<target name="stage-compiler" >
<echo file="${ROYALE_COMPILER_REPO}/env.properties">env.ASJS_HOME=${basedir}</echo>
<!-- windows needs backslashes escaped -->
<replaceregexp file="${ROYALE_COMPILER_REPO}/env.properties" match="\\" replace="\\\\\\\\" flags="g" />
<ant dir="${ROYALE_COMPILER_REPO}" target="wipe-all" />
<ant dir="${ROYALE_COMPILER_REPO}" target="stage-all" >
<property name="staging-dir" value="${basedir}/temp/royale-compiler" />
</ant>
</target>
<target name="stage-typedefs" >
<ant dir="${ROYALE_TYPEDEFS_HOME}" target="wipe" />
<mkdir dir="${staging-dir}/../royale-typedefs"/>
<copy todir="${staging-dir}/../royale-typedefs" includeEmptyDirs="false" >
<fileset dir="${ROYALE_TYPEDEFS_HOME}" includes="**" />
</copy>
</target>
<target name="stage-top-level" >
<copy file="${basedir}/npm/js-swf/package.json" todir="${basedir}/temp" />
<copy todir="${basedir}/temp" includeEmptyDirs="false">
<fileset dir="${basedir}/releasemgr" includes="**" />
</copy>
<!-- use royale-asjs LICENSE at top-level as well for now
since it doesn't really need to be different -->
<copy file="${basedir}/LICENSE" todir="${basedir}/temp" />
</target>
<!--
Packages the source distribution with ZIP.
-->
<target name="source-package-zip" unless="no.zip">
<mkdir dir="${basedir}/out"/>
<zip destfile="${basedir}/out/${source.kit}.zip" basedir="${basedir}/temp"/>
</target>
<!--
Packages the source distribution with TAR-GZIP.
-->
<target name="source-package-tgz" unless="no.zip">
<tar-gzip name="${source.kit}" />
</target>
<target name="stage-source"
description="Package source files required to build in zip file" >
<antcall target="clean-temp"/>
<sleep seconds="3" />
<mkdir dir="${staging-dir}"/>
<copy todir="${staging-dir}" includeEmptyDirs="true">
<fileset dir="${basedir}">
<include name="**"/>
<exclude name="local.properties"/>
<exclude name="nightly.properties"/>
<exclude name="releasecandidate.xml"/>
<exclude name="ApproveRoyale.xml"/>
<exclude name=".DS_Store"/>
<exclude name="**/.DS_Store"/>
<exclude name=".git/**"/>
<exclude name="in/**"/>
<exclude name="out/**"/>
<exclude name="**/out/**"/>
<exclude name="**/target/**"/>
<exclude name="manualtests/**"/>
<exclude name="marmotinni/**"/>
<exclude name="mustella/**"/>
<exclude name="src/**"/>
<exclude name="testsuite/**"/>
<exclude name="fxg2svg/**"/>
<exclude name="temp/**"/>
<exclude name="vf2js/**"/>
<exclude name="**/RoyaleTest_again/**" />
<exclude name="**/VanillaSDK_POC/**" />
<exclude name="**/.plxarc"/>
<exclude name="**/.settings/**"/>
<exclude name="frameworks/fb.properties"/>
<exclude name="frameworks/fonts/**"/>
<exclude name="frameworks/test*/**"/>
<exclude name="frameworks/js/VanillaSDK/**"/>
<exclude name="**/*.iml"/>
</fileset>
</copy>
<tstamp>
<format property="build.number.date" pattern="yyyyMMdd" />
</tstamp>
<property name="build.version" value="${release.version}.${build.number.date}" />
<!-- now that config xml files are in temp, fix them up for release. -->
<echo message="Updating config file air-config.xml with version ${build.version}"/>
<fix-config-file file="${staging-dir}/frameworks/air-config-template.xml" version="${build.version}" />
<echo message="Updating config file royale-config.xml with version ${build.version}"/>
<fix-config-file file="${staging-dir}/frameworks/royale-config-template.xml" version="${build.version}" />
<echo message="Updating config file js-config.xml with version ${build.version}"/>
<fix-config-file file="${staging-dir}/frameworks/js-config-template.xml" version="${build.version}" />
<echo message="Updating config file jquery-config.xml with version ${build.version}"/>
<fix-config-file file="${staging-dir}/frameworks/jquery-config-template.xml" version="${build.version}" />
<echo message="Updating config file ace-config.xml with version ${build.version}"/>
<fix-config-file file="${staging-dir}/frameworks/ace-config-template.xml" version="${build.version}" />
<echo message="Updating config file createjs-config.xml with version ${build.version}"/>
<fix-config-file file="${staging-dir}/frameworks/createjs-config-template.xml" version="${build.version}" />
<echo message="Updating config file node-config.xml with version ${build.version}"/>
<fix-config-file file="${staging-dir}/frameworks/node-config-template.xml" version="${build.version}" />
<fixcrlf srcdir="${staging-dir}/js/bin" eol="crlf" fixlast="false">
<include name="**/*.bat"/>
</fixcrlf>
<!-- Unix shell scripts need the correct line endings. -->
<fixcrlf srcdir="${staging-dir}/js/bin" eol="unix" fixlast="false">
<exclude name="**/*.bat"/>
</fixcrlf>
<chmod dir="${staging-dir}/js/bin" excludes="**/*.bat" perm="+x" />
<chmod dir="${staging-dir}/bin" excludes="**/*.bat" perm="+x" />
<!--
Source files have Windows line endings. Most UNIX editors can handle
either type of line endings but the converse is often not true.
-->
<fixcrlf srcdir="${staging-dir}/frameworks" eol="crlf" fixlast="false">
<exclude name="bin/**"/>
<exclude name="**/assets/**"/>
<exclude name="**/*.fla"/>
<exclude name="**/*.flv"/>
<exclude name="**/*.gif"/>
<exclude name="**/*.mp3"/>
<exclude name="**/*.jpg"/>
<exclude name="**/*.pbj"/>
<exclude name="**/*.png"/>
<exclude name="**/*.sh"/>
<exclude name="**/*.swf"/>
<exclude name="**/*.swc"/>
</fixcrlf>
<!--
Unix shell scripts need the correct line endings.
The bin directory is handled in stage-bin.
-->
<fixcrlf srcdir="${staging-dir}/" eol="unix" fixlast="false">
<include name="**.sh"/>
<exclude name="bin/**"/>
</fixcrlf>
<!-- delete any left-over empty directories -->
<delete includeemptydirs="true">
<fileset dir="${staging-dir}/frameworks/projects">
<and>
<size value="0"/>
<type type="dir"/>
</and>
</fileset>
</delete>
<delete includeemptydirs="true">
<fileset dir="${staging-dir}/frameworks/js/projects">
<and>
<size value="0"/>
<type type="dir"/>
</and>
</fileset>
</delete>
<delete includeemptydirs="true">
<fileset dir="${staging-dir}/examples">
<and>
<size value="0"/>
<type type="dir"/>
</and>
</fileset>
</delete>
</target>
<target name="jsonly-package" if="env.AIR_HOME"
description="subset binary package to be a js-only package if AIR_HOME is set and we built a SWF+JS package">
<!-- assumes temp folder contains the binary package with SWF stuff in it -->
<delete dir="${basedir}/temp/royale-asjs/frameworks/libs" failonerror="false" includeEmptyDirs="true" />
<mkdir dir="${basedir}/temp/royale-asjs/frameworks/libs" />
<copy file="${ROYALE_HOME}/js/libs/js.swc"
tofile="${basedir}/temp/royale-asjs/frameworks/libs/KeepsFBFromHanging.swc" />
<mkdir dir="${basedir}/temp/royale-asjs/frameworks/libs/player/${playerglobal.version}"/>
<copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${basedir}/temp/royale-asjs/frameworks/libs/player/${playerglobal.version}/playerglobal.swc" />
<mkdir dir="${basedir}/temp/royale-asjs/frameworks/libs/air"/>
<copy file="${ROYALE_HOME}/js/libs/js.swc" tofile="${basedir}/temp/royale-asjs/frameworks/libs/air/airglobal.swc" />
<replace token="{playerglobalHome}" value="libs/player" >
<fileset dir="${staging-dir}/frameworks">
<include name="air-config.xml"/>
<include name="airmobile-config.xml"/>
<include name="createjs-config.xml"/>
<include name="flex-config.xml"/>
<include name="jquery-config.xml"/>
<include name="ace-config.xml"/>
<include name="js-config.xml"/>
<include name="node-config.xml"/>
<include name="royale-config.xml"/>
</fileset>
</replace>
<replace token="<path-element>libs</path-element>"
value="<path-element>js/libs</path-element>" >
<fileset dir="${staging-dir}/frameworks">
<include name="air-config.xml"/>
<include name="airmobile-config.xml"/>
<include name="createjs-config.xml"/>
<include name="flex-config.xml"/>
<include name="jquery-config.xml"/>
<include name="ace-config.xml"/>
<include name="js-config.xml"/>
<include name="node-config.xml"/>
<include name="royale-config.xml"/>
</fileset>
</replace>
<replace token="<target>SWF</target>" value="" >
<fileset dir="${staging-dir}/frameworks">
<include name="air-config.xml"/>