forked from zjutbang/flex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
1657 lines (1421 loc) · 69.5 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="sdk" default="main" basedir=".">
<property name="FLEX_HOME" location="${basedir}"/>
<!-- Required for OSX 10.6 / Snow Leopard Performance -->
<condition property="local.d32" value="-d32" >
<and>
<equals arg1="${sun.arch.data.model}" arg2="64"/>
<equals arg1="${os.arch}" arg2="x86_64"/>
<os family="mac"/>
</and>
</condition>
<property file="${FLEX_HOME}/env.properties"/>
<property environment="env"/>
<property file="${FLEX_HOME}/local.properties"/>
<property file="${FLEX_HOME}/build.properties"/>
<property name="debug" value="true"/>
<property name="strict" value="true"/>
<property name="javac.src" value="1.5"/>
<property name="target.player" value="11.1"/>
<property name="kit.prefix" value="apache-flex-sdk-${release.version}-incubating"/>
<property name="source.kit" value="${kit.prefix}-src"/>
<property name="binary.kit" value="${kit.prefix}-bin"/>
<!--
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="prebuild,modules,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="dev" depends="modules-dev" description="Runs src.depend build for development"/>
<!--
Can set build.additional-packages to build additional-packages as part of a release.
This does not build the docs. Use doc-packages or asdoc-packages.
-->
<target name="release"
depends="check-compile-env,check-runtime-env,check-adobe-extension-manager-env,source-release,binary-release,rat-check"
description="Creates source and binary kits for Apache Flex."/>
<target name="source-release"
depends="super-clean,create-description,source-package"
description="Packages the source release kit which is the official Apache release."/>
<target name="binary-release"
depends="setup-binary-release,main,frameworks-rsls,sample-themes,checkintests,doc,other.locales,binary-package,additional-packages"
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="additional-packages"
depends="ja-locale-samples,antTasks-package"
description="Package locale-samples and antTasks."/>
<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.">
<ant dir="${basedir}/modules" target="thirdparty-downloads"/>
<ant dir="${basedir}/frameworks" 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" />
</target>
<target name="prebuild" depends="check-compile-env,thirdparty-downloads,create-description"
description="Stuff that needs to be done before any builds." />
<target name="check-compile-env" depends="check-playerglobal-home,check-air-home,check-pixelbender-home"
description="Check for the required environment variables for compilation."/>
<target name="check-playerglobal-home" unless="playerglobal.swc.exists"
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" unless="AIR_HOME.set"
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"/>
</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-pixelbender-home" unless="pbutil.exe.exists"
description="Check PIXELBENDER_HOME for both a directory and an exe file">
<echo message="PIXELBENDER_HOME is ${env.PIXELBENDER_HOME}"/>
<available file="${env.PIXELBENDER_HOME}"
type="dir"
property="PIXELBENDER_HOME.set"/>
<fail message="The environment variable PIXELBENDER_HOME is not set to a directory"
unless="PIXELBENDER_HOME.set"/>
<condition property="pbutil.exe.exists">
<and>
<os family="mac"/>
<available file="${env.PIXELBENDER_HOME}/pbutil" type="file"/>
</and>
</condition>
<condition property="pbutil.exe.exists">
<and>
<os family="windows"/>
<available file="${env.PIXELBENDER_HOME}/pbutil.exe" type="file"/>
</and>
</condition>
<fail message="The directory ${env.PIXELBENDER_HOME} does not contain the pbutil executable"
unless="pbutil.exe.exists"/>
</target>
<target name="check-adobe-extension-manager-env" unless="ADOBE_EXTENSION_MANAGER.set"
description="Check ADOBE_EXTENSION_MANAGER is a directory.">
<echo message="ADOBE_EXTENSION_MANAGER is ${env.ADOBE_EXTENSION_MANAGER}"/>
<available file="${env.ADOBE_EXTENSION_MANAGER}"
type="file"
property="ADOBE_EXTENSION_MANAGER.set"/>
<fail message="ADOBE_EXTENSION_MANAGER must be set correctly for a release build"
unless="ADOBE_EXTENSION_MANAGER.set"/>
</target>
<target name="create-description" description="Generate flex-sdk-description.xml">
<echo message="build.number is ${build.number}"/>
<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>
<version>${release.version}</version>
<build>${build.number}</build>
</flex-sdk-description>
</echo>
</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" />
</target>
<!--
Cleanup
-->
<target name="super-clean" depends="thirdparty-clean,clean" description="Cleans everything including thirdparty downloads."/>
<target name="thirdparty-clean" description="Removes all thirdparty downloads.">
<ant dir="${basedir}/modules" target="thirdparty-clean"/>
<ant dir="${basedir}/frameworks" target="thirdparty-clean"/>
</target>
<target name="clean" depends="modules-clean,frameworks-clean,frameworks-clean,frameworks-rsls-clean,package-clean,checkintests-clean"
description="Full clean excluding thirdparty downloads">
<delete file="${basedir}/flex-sdk-description.xml" failonerror="false"/>
<delete file="${basedir}/rat*.report" failonerror="false"/>
<delete dir="${basedir}/samples/themes" failonerror="false">
<include name="**/*.swc"/>
<include name="**/*.swf"/>
</delete>
<!-- These directory would exist if the AIR SDK was merged in. -->
<delete dir="${basedir}/lib" failonerror="false" includeEmptyDirs="true">
<include name="aot/**"/>
<include name="nai/**"/>
<include name="win/**"/>
</delete>
<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="modules-clean">
<ant dir="${basedir}/modules" target="clean"/>
</target>
<target name="frameworks-clean">
<ant dir="${basedir}/frameworks" target="clean"/>
</target>
<target name="frameworks-rsls-clean">
<delete dir="${basedir}/frameworks/rsls" includeEmptyDirs="true" quiet="true"/>
</target>
<target name="package-clean">
<delete dir="${basedir}/out" failonerror="false" includeEmptyDirs="true"/>
<antcall target="clean-temp"/>
</target>
<target name="checkintests-clean" depends="clean-dependencychecker">
<delete file="${basedir}/frameworks/tests/AIRExamples/AIRDemo.swf" failonerror="false"/>
<delete dir="${basedir}/frameworks/tests/airMobileBasicTests/bin-debug" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/checkinapp/checkinapp.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/componentSmoke/componentSmoke2.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/spark/sparkTest.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/fxgCompile/fxgCompileTest.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/graphics/GraphicTags_checkin.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/basicTests/BasicTests.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/basicTests/basicLoader.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/basicTests/spark/views/HelloWorld.swf" failonerror="false"/>
<delete file="${basedir}/frameworks/tests/basicTests/spark/views/StyleManagerModuleTest.swf" failonerror="false"/>
<delete file="${basedir}/mustella/MustellaResultsParser.class" failonerror="false"/>
<!-- not currently in Apache Flex -->
<!--
<ant dir="${basedir}/frameworks/tests/layout" target="clean"/>
<ant dir="${basedir}/frameworks/tests/states" target="clean"/>
-->
<ant dir="${basedir}/mustella" target="cleanmustellaswc"/>
</target>
<target name="player-clean">
<delete dir="${basedir}/in/player" failonerror="false" includeEmptyDirs="true"/>
</target>
<!--
Build Java module JARs
-->
<target name="modules" description="Full build of all JARs">
<ant dir="${basedir}/modules"/>
</target>
<target name="modules-dev" description="Build src.depend JARs">
<ant dir="${basedir}/modules" target="dev"/>
</target>
<target name="antTasks" description="Full build of antTasks" unless="antTasks.compiled" >
<ant dir="${basedir}/modules/antTasks"/>
<property name="antTasks.compiled" value="true"/>
</target>
<!--
Build framework SWCs
-->
<target name="frameworks" description="Full build of all framework SWCs, including resource bundles and themes">
<ant dir="${basedir}/frameworks">
<property name="locale" value="en_US"/>
</ant>
</target>
<target name="framework-compile" description="Recompile framework.swc">
<ant dir="${basedir}/frameworks/projects/framework" target="compile">
<property name="locale" value="en_US"/>
</ant>
</target>
<target name="spark-compile" description="Recompile spark.swc">
<ant dir="${basedir}/frameworks/projects/spark" target="compile"/>
</target>
<target name="airframework-compile" description="Recompile airframework.swc">
<ant dir="${basedir}/frameworks/projects/airframework" target="compile"/>
</target>
<target name="airspark-compile" description="Recompile airspark.swc">
<ant dir="${basedir}/frameworks/projects/airspark" target="compile"/>
</target>
<!-- Build framework RSLs -->
<macrodef name="create-rsl">
<attribute name="rsl-dir"/>
<attribute name="swc-dir"/>
<attribute name="swc-name"/>
<attribute name="build-number"/>
<sequential>
<unzip src="@{swc-dir}/@{swc-name}.swc"
dest="@{rsl-dir}" >
<patternset>
<include name="library.swf" />
</patternset>
</unzip>
<!-- optimize out metadata but keep debug info for the unsigned RSL -->
<java jar="${basedir}/lib/optimizer.jar" fork="true" failonerror="true">
<jvmarg line="-ea -DAS3 -DAVMPLUS -Dflexlib=${basedir}/frameworks -Xms32m -Xmx384m -Dsun.io.useCanonCaches=false"/>
<arg line="'@{rsl-dir}/library.swf' --output '@{rsl-dir}/@{swc-name}_@{build-number}.swf' --keep-as3-metadata='Bindable,Managed,ChangeEvent,NonCommittingChangeEvent,Transient,SkinPart' --debug='true' "/>
</java>
<delete file="@{rsl-dir}/library.swf"/>
<java jar="${basedir}/lib/digest.jar" fork="true" failonerror="true">
<jvmarg line="-ea -DAS3 -DAVMPLUS -Xms32m -Xmx384m -Dsun.io.useCanonCaches=false"/>
<arg line="--digest.rsl-file '@{rsl-dir}/@{swc-name}_@{build-number}.swf' --digest.swc-path '@{swc-dir}/@{swc-name}.swc' --digest.signed=false"/>
</java>
</sequential>
</macrodef>
<target name="frameworks-rsls" description="Build signed framework RSLs">
<!-- framework RSL -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="framework" build-number="${release.version}.${build.number}"/>
<!-- mx RSL -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs/mx" swc-name="mx" build-number="${release.version}.${build.number}"/>
<!-- rpc RSL -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="rpc" build-number="${release.version}.${build.number}"/>
<!-- Spark -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="spark" build-number="${release.version}.${build.number}"/>
<!-- sparkskins RSL -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="sparkskins" build-number="${release.version}.${build.number}"/>
<!-- charts RSL -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="charts" build-number="${release.version}.${build.number}"/>
<!-- advancedgrids RSL -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="advancedgrids" build-number="${release.version}.${build.number}"/>
<!-- spark_dmv RSL -->
<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="spark_dmv" build-number="${release.version}.${build.number}"/>
</target>
<target name="other.locales" description="Build resource SWCs for additional locales">
<ant dir="${basedir}/frameworks" target="other.locales"/>
</target>
<target name="sample-themes" description="Build the sample themes">
<ant dir="${basedir}/samples/themes/arcade" target="main" />
<ant dir="${basedir}/samples/themes/cobalt" target="main" />
<ant dir="${basedir}/samples/themes/graphite" target="main" />
<!-- zen theme is missing some assets -->
<!--<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/flex2/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="${FLEX_HOME}/javadoc"/>
<delete dir="${basedir}/javadoc" failonerror="false" includeEmptyDirs="true"/>
</target>
<target name="ide" description="Build any ide specific files">
<ant dir="${basedir}/ide/flashbuilder" />
</target>
<target name="post-build" depends="ide" description="Handle post-build activities" />
<!--
Build the ASDoc html pages.
-->
<target name="asdoc" description="asdoc">
<ant dir="${basedir}/asdoc" />
</target>
<!--
Package up the Apache Flex 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,source-package-zip,source-package-tgz"
description="Package source files required to build in zip and tar-gzip file">
</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"/>
<copy todir="${basedir}/temp" includeEmptyDirs="false">
<fileset dir="${basedir}">
<include name="build.xml"/>
<include name="build.properties"/>
<include name="env-template.properties"/>
<include name="flex-sdk-description.xml"/>
<include name="CHANGES"/>
<include name="DISCLAIMER"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="README"/>
<include name="RELEASE_NOTES"/>
</fileset>
</copy>
<!-- bin -->
<antcall target="stage-bin"/>
<!-- frameworks -->
<antcall target="stage-frameworks"/>
<!-- modules -->
<antcall target="stage-modules"/>
<!-- asdoc -->
<copy todir="${basedir}/temp/asdoc" includeEmptyDirs="false">
<fileset dir="${basedir}/asdoc"/>
</copy>
<!-- ide -->
<copy todir="${basedir}/temp/ide">
<fileset dir="${basedir}/ide" >
<include name="flashbuilder/**"/>
</fileset>
</copy>
<!-- mustella (only enough to run checkintests) -->
<!-- modules -->
<antcall target="stage-mustella"/>
<!-- samples -->
<copy todir="${basedir}/temp/samples">
<fileset dir="${basedir}/samples" >
<exclude name="**/*.swc"/>
<exclude name="**/*.swf"/>
</fileset>
</copy>
<!-- templates -->
<copy todir="${basedir}/temp/templates">
<fileset dir="${basedir}/templates" >
<include name="automation-runtimeloading-files/**"/>
<include name="swfobject/**"/>
<exclude name="**/*.swf"/>
<exclude name="**/swfobject.js"/>
</fileset>
</copy>
<!--
Source files have Windows line endings. Most UNIX editors can handle
either type of line endings but the converse is often not true.
The bin directory is handled in stage-bin.
-->
<fixcrlf srcdir="${basedir}/temp" eol="crlf">
<exclude name="bin/**"/>
<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"/>
</fixcrlf>
<!--
Unix shell scripts need the correct line endings.
The bin directory is handled in stage-bin.
-->
<fixcrlf srcdir="${basedir}/temp" eol="unix">
<include name="**.sh"/>
<exclude name="bin/**"/>
</fixcrlf>
</target>
<!-- frameworks -->
<!-- javascript and test directories follow -->
<target name="stage-frameworks">
<copy todir="${basedir}/temp/frameworks" includeEmptyDirs="false">
<fileset dir="${basedir}/frameworks">
<include name="**"/>
<exclude name="**/libs/**"/>
<exclude name="**/*.swc"/>
<exclude name="**/*.pbj"/>
<exclude name="**/*.swf"/>
<exclude name="**/*.mxp"/>
<exclude name="test*/**"/>
<exclude name="javascript/**"/>
<exclude name="projects/air/**"/>
<exclude name="projects/textLayout/**"/>
<exclude name="projects/spark/manifest.xml"/>
<exclude name="projects/*/bundles.properties"/>
</fileset>
</copy>
<!-- frameworks/javascript -->
<copy todir="${basedir}/temp/frameworks/javascript" includeEmptyDirs="false">
<fileset dir="${basedir}/frameworks/javascript">
<include name="build.xml"/>
</fileset>
</copy>
<copy todir="${basedir}/temp/frameworks/javascript" includeEmptyDirs="false">
<fileset dir="${basedir}/frameworks/javascript">
<exclude name="FABridge/**/swfobject.js"/>
<exclude name="FABridge/readme.txt"/>
</fileset>
<mapper type="glob" from="FABridge/*" to="fabridge/*" />
</copy>
<!-- frameworks/tests -->
<antcall target="stage-frameworks-tests"/>
<!-- now that air-config.xml and flex-config.xml are in temp, fix them up for release. -->
<fix-config-file file="${basedir}/temp/frameworks/air-config.xml" />
<fix-config-file file="${basedir}/temp/frameworks/flex-config.xml" />
<!-- Update all Version.as files in the kit frameworks directory with build.number -->
<antcall target="version-update"/>
</target>
<target name="stage-frameworks-tests" unless="no.tests">
<!-- frameworks -->
<copy todir="${basedir}/temp/frameworks" includeEmptyDirs="false">
<fileset dir="${basedir}/frameworks">
<include name="test*/**"/>
</fileset>
</copy>
</target>
<target name="stage-bin">
<copy todir="${basedir}/temp/bin" includeEmptyDirs="false">
<fileset dir="${basedir}/bin">
<include name="*"/>
<exclude name="adl*"/>
<exclude name="adt*"/>
</fileset>
</copy>
<fixcrlf srcdir="${basedir}/temp/bin" eol="crlf">
<include name="**/*.bat"/>
</fixcrlf>
<!-- Unix shell scripts need the correct line endings. -->
<fixcrlf srcdir="${basedir}/temp/bin" eol="unix">
<exclude name="**/*.bat"/>
</fixcrlf>
</target>
<target name="stage-modules" unless="no.modules">
<!-- modules -->
<copy todir="${basedir}/temp/modules" includeEmptyDirs="false">
<fileset dir="${basedir}/modules">
<include name="**"/>
<exclude name="thirdparty/**"/>
<exclude name=".metadata/**"/>
<exclude name="**/*.jar"/>
<exclude name="**/*.vms"/>
<exclude name="*/test/**"/>
<exclude name="compiler/src/java/velocity.log"/>
<exclude name="compiler/**/ParseException.java"/>
<exclude name="compiler/**/Parser.java"/>
<exclude name="compiler/**/ParserConstants.java"/>
<exclude name="compiler/**/Token.java"/>
<exclude name="compiler/**/TokenManager.java"/>
<exclude name="compiler/**/TokenMgrError.java"/>
<exclude name="**/classes/**"/>
<exclude name="**/.classpath"/>
<exclude name="**/.project"/>
</fileset>
</copy>
<!-- modules/thirdparty -->
<copy todir="${basedir}/temp/modules/thirdparty" includeEmptyDirs="true">
<fileset dir="${basedir}/modules/thirdparty">
<include name="**"/>
<exclude name="**/classes/**"/>
<exclude name="**/.classpath"/>
<exclude name="**/.project"/>
<exclude name="*/test*/**"/>
</fileset>
</copy>
</target>
<!-- mustella (only enough to run checkintests) -->
<target name="stage-mustella" unless="no.tests">
<copy todir="${basedir}/temp/mustella">
<fileset dir="${basedir}/mustella">
<include name="as3/**"/>
<exclude name="as3/src/mustella/ContinueAfterRuntimeException/**"/>
<exclude name="as3/src/mustella/ExcludeList.txt"/>
<exclude name="as3/src/mustella/IncludeList.txt"/>
<exclude name="**/*.air"/>
<exclude name="**/*.swf"/>
<include name="build.xml"/>
<include name="local.properties"/>
<include name="MustellaResultsParser.java"/>
</fileset>
</copy>
</target>
<target name="binary-package"
description="Package binary files in zip and tar-gzip file.">
<!-- don't include modules directory in stage-source -->
<property name="no.modules" value="set" />
<!-- don't include mustella or frameworks/tests in stage-source -->
<property name="no.tests" value="set" />
<antcall target="stage-source"/>
<!-- Delete files from source distro that are not in binary distro. -->
<delete dir="${basedir}/temp/">
<include name="**/build.xml"/>
<exclude name="asdoc/build.xml"/>
</delete>
<!--
Some, but not all framework sources are included.
Need to include the sources required for build_framework.xml.
-->
<delete dir="${basedir}/temp/frameworks" includeemptydirs="true">
<include name="build_framework.xml"/>
<include name="projects/*/.*/**"/>
<include name="projects/*/asdoc/**"/>
<include name="projects/*/bundles/*/docs/**"/>
<include name="projects/flash-integration/**"/>
<include name="projects/playerglobal/**"/>
<exclude name="projects/flash-integration/src/**"/>
<exclude name="projects/flash-integration/manifest.xml"/>
</delete>
<!-- remove some of the themes and all the src for the themes -->
<delete dir="${basedir}/temp/frameworks/themes" includeemptydirs="true">
<include name="Ice/**"/>
<include name="Institutional/**"/>
<include name="Smoke/**"/>
<include name="Wooden/**"/>
<include name="**/src/**"/>
</delete>
<!-- delete any left-over empty directories -->
<delete includeemptydirs="true">
<fileset dir="${basedir}/temp/frameworks">
<and>
<size value="0"/>
<type type="dir"/>
</and>
</fileset>
</delete>
<!-- these files are in addition to the remaining source files -->
<!-- concat the license file with the binary license file for the 3rd party deps -->
<!--concat destfile="${basedir}/temp/LICENSE">
<filelist dir="${FLEX_HOME}" files="LICENSE,LICENSE.bin"/>
</concat-->
<!-- use this to build frameworks -->
<copy file="${basedir}/frameworks/build_framework.xml"
tofile="${basedir}/temp/frameworks/build.xml" failonerror="true" verbose="true"/>
<!-- ant is pre-built and in FLEX_HOME/ant rather than modules/antTasks -->
<antcall target="stage-antTasks"/>
<!-- locales -->
<antcall target="stage-locales"/>
<!-- generated files in frameworks excepts libs and rsls -->
<copy todir="${basedir}/temp/frameworks">
<fileset dir="${basedir}/frameworks">
<include name="projects/*/bundles.properties"/>
<include name="projects/spark/manifest.xml"/>
<include name="**/*.pbj"/>
<include name="**/*.swc"/>
<include name="**/*.swf"/>
<exclude name="libs/**"/>
<exclude name="rsls/**"/>
<exclude name="tests/**"/>
</fileset>
</copy>
<!-- frameworks/libs -->
<copy todir="${basedir}/temp/frameworks/libs">
<fileset dir="${basedir}/frameworks/libs">
<include name="air/airframework.swc"/>
<include name="air/airspark.swc"/>
<include name="mobile/mobilecomponents.swc"/>
<include name="authoringsupport.swc"/>
<include name="core.swc"/>
<include name="spark.swc"/>
<include name="framework.swc"/>
<include name="mx/mx.swc"/>
<include name="flash-integration.swc"/>
<include name="rpc.swc"/>
<include name="sparkskins.swc"/>
<include name="authoringsupport.swc"/>
<include name="charts.swc"/>
<include name="advancedgrids.swc"/>
<include name="spark_dmv.swc"/>
<exclude name="osmf.swc"/>
<exclude name="textLayout.swc"/>
</fileset>
</copy>
<!-- frameworks/libs/automation -->
<copy todir="${basedir}/temp/frameworks/libs/automation">
<fileset dir="${basedir}/frameworks/libs/automation">
<include name="automation.swc"/>
<include name="automation_agent.swc"/>
<include name="automation_air.swc"/>
<include name="automation_airspark.swc"/>
<include name="automation_dmv.swc"/>
<include name="automation_flashflexkit.swc"/>
<include name="automation_spark.swc"/>
<include name="tool.swc"/>
<include name="tool_air.swc"/>
</fileset>
</copy>
<!-- frameworks/rsls -->
<copy todir="${basedir}/temp/frameworks/rsls">
<fileset dir="${basedir}/frameworks/rsls"/>
</copy>
<!-- the jar files -->
<antcall target="stage-lib"/>
<!-- locale swcs -->
<copy todir="${basedir}/temp/frameworks/locale">
<fileset dir="${basedir}/frameworks/locale">
<include name="**/*.swc"/>
</fileset>
</copy>
<!-- ide -->
<copy todir="${basedir}/temp/ide">
<fileset dir="${basedir}/ide" >
<include name="flashbuilder/config"/>
</fileset>
</copy>
<!-- sample themes -->
<copy todir="${basedir}/temp/samples">
<fileset dir="${basedir}/samples" >
<include name="**/build.xml"/>
<include name="**/*.swc"/>
<include name="**/*.swf"/>
</fileset>
</copy>
<!-- swfobject templates except for downloaded files -->
<copy todir="${basedir}/temp/templates/swfobject">
<fileset dir="${basedir}/templates/swfobject">
<exclude name="**/expressInstall.swf"/>
<exclude name="**/swfobject.js"/>
</fileset>
</copy>
<antcall target="binary-package-zip"/>
<antcall target="binary-package-tgz"/>
</target>
<target name="stage-lib">
<!--
lib - Do not include any jars which we prompted to download because of
conflicting licenses. These are all in lib/external/optional.
-->
<copy todir="${basedir}/temp/lib">
<fileset dir="${basedir}/lib">
<include name="asc.jar"/>
<include name="asdoc.jar"/>
<include name="batik-all-flex.jar"/>
<include name="compc.jar"/>
<include name="copylocale.jar"/>
<include name="digest.jar"/>
<include name="fdb.jar"/>
<include name="fcsh.jar"/>
<include name="flex-compiler-oem.jar"/>
<include name="mxmlc.jar"/>
<include name="optimizer.jar"/>
<include name="swcdepends.jar"/>
<include name="swfdump.jar"/>
<include name="swfutils.jar"/>
<include name="fxgutils.jar"/>
<include name="velocity-dep-1.4-flex.jar"/>
<exclude name="external/optional/**"/>
</fileset>
</copy>
<!--
external libraries
We don't have the sources to build them but they have compatible licenses.
-->
<copy todir="${basedir}/temp/lib/external">
<fileset dir="${basedir}/lib/external">
<include name="commons-collections.jar"/>
<include name="commons-collections-LICENSE*"/>
<include name="commons-collections-NOTICE*/**"/>
<include name="commons-discovery.jar"/>
<include name="commons-discovery-LICENSE*"/>
<include name="commons-discovery-NOTICE*/**"/>
<include name="commons-logging.jar"/>
<include name="commons-logging-LICENSE*"/>
<include name="commons-logging-NOTICE*/**"/>
<include name="javacc.jar"/>
<include name="javacc-LICENSE*"/>
<include name="saxon9.jar"/>
<include name="saxon9-LICENSE*"/>
<include name="saxon9-NOTICE*/**"/>
<include name="xalan.jar"/>
<include name="xalan-LICENSE*"/>
<include name="xalan-NOTICE*/**"/>
<include name="xercesImpl.jar"/>
<include name="xercesPatch.jar"/>
<include name="xerces-LICENSE*/**"/>
<include name="xerces-NOTICE*/**"/>
<include name="xml-apis.jar"/>
<include name="xml-batik-LICENSE*"/>
<include name="xml-batik-NOTICE*/**"/>
<exclude name="optional/**"/>
</fileset>
</copy>
</target>
<!--
Packages the binary distribution with ZIP.
-->
<target name="binary-package-zip" unless="no.zip"
description="Zips up the files in the temp directory into the binary zipfile.">
<mkdir dir="${basedir}/out"/>
<zip destfile="${basedir}/out/${binary.kit}.zip" basedir="${basedir}/temp"/>
</target>
<!--
Packages the binary distribution with TAR-GZIP.
-->
<target name="binary-package-tgz" unless="no.zip"
description="Tar-Gzip up the files in the temp directory into the binary tgz file.">
<tar-gzip name="${binary.kit}" />
</target>
<macrodef name="fix-config-file">
<attribute name="file"/>
<sequential>
<replace file="@{file}">
<replacefilter
token="<warn-no-explicit-super-call-in-constructor>true"
value="<warn-no-explicit-super-call-in-constructor>false"/>
<replacefilter
token="$${build.number}"
value="${release.version}.${build.number}"/>
</replace>
</sequential>
</macrodef>
<!--
tar with gzip compression, the temp directory and put it in the out directory.
The shell scripts in the bin directory (no extension) and other .sh files have
mode set to execute.
name - the basename name of the kit in out directory, without the .tar.gz extension
-->
<macrodef name="tar-gzip">
<attribute name="name"/>
<sequential>
<mkdir dir="${basedir}/out"/>
<tar destfile="${basedir}/out/@{name}.tar.gz"
compression="gzip"
longfile="gnu">
<tarfileset dir="${basedir}/temp" prefix="@{name}">
<include name="**" />
<exclude name="bin/**" />
<exclude name="**/*.sh" />
</tarfileset>
<tarfileset dir="${basedir}/temp" prefix="@{name}">
<include name="bin/*.bat" />
</tarfileset>
<tarfileset dir="${basedir}/temp" prefix="@{name}" mode="755">
<include name="bin/*" />
<include name="**/*.sh" />
<exclude name="bin/*.bat" />
</tarfileset>
</tar>
</sequential>
</macrodef>
<!--