/
build.xml
721 lines (636 loc) · 28.8 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
<?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="Installer" basedir="." default="build">
<!--load environment variables prefixed with env -->
<property environment="env"/>
<!--location of property file -->
<property file="${basedir}/local.properties" />
<condition property="CERT_PASSWORD_FILE" value="${CERT_PASSWORD_FILE_WIN}" >
<and>
<not>
<available file="${CERT_PASSWORD_FILE}" />
</not>
<available file="${CERT_PASSWORD_FILE_WIN}" />
</and>
</condition>
<condition property="CERT_PASSWORD_FILE" value="${CERT_PASSWORD_FILE_MAC}" >
<and>
<not>
<available file="${CERT_PASSWORD_FILE}" />
</not>
<available file="${CERT_PASSWORD_FILE_MAC}" />
</and>
</condition>
<condition property="RELEASE_KEYSTORE_FILE" value="${RELEASE_KEYSTORE_FILE_WIN}" >
<and>
<not>
<available file="${RELEASE_KEYSTORE_FILE}" />
</not>
<available file="${RELEASE_KEYSTORE_FILE_WIN}" />
</and>
</condition>
<condition property="RELEASE_KEYSTORE_FILE" value="${RELEASE_KEYSTORE_FILE_MAC}" >
<and>
<not>
<available file="${RELEASE_KEYSTORE_FILE}" />
</not>
<available file="${RELEASE_KEYSTORE_FILE_MAC}" />
</and>
</condition>
<property file="${basedir}/build.properties" description="Properties for Apache Flex SDK Installer project" />
<property file="${basedir}/build.number"/>
<property file="${CERT_PASSWORD_FILE}"/>
<property name="installer.version" value="${release.version}.${build.number}"/>
<property name="kit.prefix" value="apache-flex-sdk-installer-${installer.version}"/>
<property name="source.kit" value="${kit.prefix}-src"/>
<property name="binary.kit" value="${kit.prefix}-bin"/>
<property name="LOCAL_CONFIG_FILE" value="${basedir}/src/installer/sdk-installer-config-4.0.xml" />
<!--<property name="commons.zip" value="http://projects.yoolab.org/maven/content/repositories/releases/org/as3commons/as3commons-zip/1.0.0-alpha.1/as3commons-zip-1.0.0-alpha.1.swc" />-->
<!-- use this one for now until we find a better source -->
<property name="commons.zip" value="https://github.com/bigosmallm/MakeApacheFlexForFlashBuilder/blob/master/libs/as3commons-zip-1.0.0-alpha.1.swc?raw=true" />
<!--
Properties are immutable so value frozen first time property is set.
If FLEX_HOME is not set with -DFLEX_HOME=/path/to/flex/sdk on the ant command line
use the environment variable, if it exists. Else if windows, use FLEX_HOME_WIN
else use FLEX_HOME_MAC, which are both defined in build.properties.
-->
<condition property="FLEX_HOME" value="${env.FLEX_HOME}">
<isset property="env.FLEX_HOME" />
</condition>
<condition property="FLEX_HOME" value="${FLEX_HOME_WIN}">
<os family="windows"/>
</condition>
<condition property="FLEX_HOME" value="${FLEX_HOME_MAC}">
<os family="mac"/>
</condition>
<condition property="FLEX_HOME" value="${FLEX_HOME_LINUX}">
<os family="unix"/>
</condition>
<condition property="adl" value="adl.exe">
<os family="windows"/>
</condition>
<condition property="adl" value="adl">
<os family="mac"/>
</condition>
<condition property="runtime" value="win">
<os family="windows"/>
</condition>
<condition property="runtime" value="mac">
<os family="mac"/>
</condition>
<condition property="LOCAL_CONFIG_URL" value="file:///${LOCAL_CONFIG_FILE}">
<os family="windows"/>
</condition>
<property name="LOCAL_CONFIG_URL" value="file://${LOCAL_CONFIG_FILE}" />
<!--
Properties are immutable so value frozen first time property is set.
If AIR_HOME is not set on the command line with -DAIR_HOME=/path/to/air/sdk on the
ant command line use the environment variable, if it exists. Else if windows, use
AIR_HOME_WIN else use AIR_HOME_MAC, which are both defined in build.properties.
-->
<condition property="AIR_HOME" value="${env.AIR_HOME}">
<isset property="env.AIR_HOME" />
</condition>
<condition property="AIR_HOME" value="${AIR_HOME_WIN}">
<os family="windows"/>
</condition>
<condition property="AIR_HOME" value="${AIR_HOME_MAC}">
<os family="mac"/>
</condition>
<condition property="AIR_HOME" value="${AIR_HOME_LINUX}">
<os family="unix"/>
</condition>
<condition property="cert_pwd_not_found" >
<not>
<available file="${CERT_PASSWORD_FILE}"/>
</not>
</condition>
<condition property="KEYSTORE" value="${RELEASE_KEYSTORE_FILE}" >
<available file="${CERT_PASSWORD_FILE}"/>
</condition>
<condition property="KEYSTORE" value="temp.p12" >
<not>
<available file="${CERT_PASSWORD_FILE}"/>
</not>
</condition>
<condition property="CERT_PASSWORD" value="${TEMP_PASS_CHANGE_THIS}" >
<not>
<available file="${CERT_PASSWORD_FILE}"/>
</not>
</condition>
<!-- compilers -->
<property name="ADL" value="${AIR_HOME}/bin/adl"/>
<property name="ADT" value="${AIR_HOME}/lib/adt.jar"/>
<!-- additional tasks - mxmlc tag -->
<path id="flexTasks.path">
<fileset dir="${FLEX_HOME}">
<include name="lib/flexTasks.jar" />
<include name="ant/lib/flexTasks.jar" />
</fileset>
</path>
<taskdef resource="flexTasks.tasks" classpathref="flexTasks.path"/>
<!--
Optional jars but should be in place for a real release build.
For <rat> apache-rat-0.8.jar and apache-rat-tasks-0.8.jar should be in classpath.
See rat-report.
-->
<path id="anttask.classpath">
<fileset dir="${env.ANT_HOME}/lib">
<include name="**/apache-rat*.jar"/>
</fileset>
<fileset dir="${user.home}">
<include name=".ant/lib/**/apache-rat*.jar"/>
</fileset>
</path>
<!-- AIR package extension -->
<condition property="extension" value="exe">
<os family="windows" />
</condition>
<condition property="extension" value="dmg">
<os family="mac" />
</condition>
<condition property="extension" value="deb">
<os family="unix" />
</condition>
<target name="build" depends="init,certificate,compile,packagenative,cleanup"
description="Compiles and packages application"/>
<target name="release" depends="clean,build,source-package,rat-report,sign,copy-misc"
description="Build the application and package up the distros for release."/>
<target name="init" depends="clean,createDirs,update-version-in-xml-files"
description="Creates the deploy folders and sets app extension"/>
<target name="clean" description="Cleans up old files.">
<delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
<delete dir="${DEPS_DIR}" failOnError="false" includeEmptyDirs="true" />
<delete dir="${LIBRARY_DIR}" failOnError="false" includeEmptyDirs="true" />
<delete dir="${RELEASE_DIR}" failOnError="false" includeEmptyDirs="true" />
<delete file="${basedir}/rat.report" failOnError="false"/>
</target>
<target name="cleanup" description="Cleans up old files." unless="no.cleanup">
<delete dir="${BUILD_DIR}" failOnError="false" includeEmptyDirs="true" />
</target>
<target name="createDirs">
<echo>***************************************${line.separator}Execute the update-version target once,${line.separator}and only once, when you modifiy this app.${line.separator}This will increment the version number to allow${line.separator}the app to be updated by the AIR installer.${line.separator}***************************************
</echo>
<mkdir dir="${BUILD_DIR}"/>
<mkdir dir="${RELEASE_DIR}"/>
</target>
<!-- Make sure version, esp, build.number, in APP_NAME-app.xml is in sync. -->
<target name="update-version-in-xml-files" description="Update version in APP_NAME-app.xml.">
<echo message="version in ${APP_NAME}-app.xml will be ${installer.version}"/>
<replaceregexp byline="true">
<regexp pattern="<versionNumber>(\d+\.)?(\d+\.)?(\d+)</versionNumber>"/>
<substitution expression="<versionNumber>${installer.version}</versionNumber>"/>
<fileset dir="${SOURCE_DIR}">
<include name="${APP_NAME}-app.xml"/>
</fileset>
</replaceregexp>
<replaceregexp byline="true">
<regexp pattern="<latest>(\d+\.)?(\d+\.)?(\d+)</latest>"/>
<substitution expression="<latest>${installer.version}</latest>"/>
<fileset dir="${SOURCE_DIR}">
<include name="${APP_CONFIG_XML_NAME}.xml"/>
</fileset>
</replaceregexp>
</target>
<!--
Run this target once, and then rebuild, when you make a change to this app
so that the AIR Installer will allow the app to be updated. The build.number
property in the file build.property will be read and then incremented and the
nano version number in the <version> tag in InstallApacheFlex-app.xml will be
updated.
-->
<target name="update-version" description="Update the app version number so the installer will be updated.">
<tstamp>
<format property="touch.year" pattern="yyyy"/>
</tstamp>
<propertyfile file="build.number"
comment="Copyright ${touch.year} The Apache Software Foundation.">
<entry key="build.number" type="int" default="0" operation="+"/>
</propertyfile>
</target>
<target name="packagenative" depends="packageair"
description="Packages the AIR file from the build directory to create a native installer (exe/dmg) file">
<java jar="${ADT}" fork="true"
failonerror="true"
maxmemory="512m">
<arg value="-package"/>
<arg value="-target"/>
<arg value="native"/>
<arg value="${RELEASE_DIR}/${binary.kit}.${extension}"/>
<arg value="${BUILD_DIR}/${APP_NAME}.air"/>
</java>
</target>
<target name="check-as3commons.swc">
<available file="${LIBRARY_DIR}/as3commons-zip-1.0.0-alpha.1.swc" property="as3commons.swc.present"/>
</target>
<target name="get-as3commons.swc" depends="check-as3commons.swc" unless="as3commons.swc.present"
description="Download as3commons.swc and fail if checksum mismatch.">
<mkdir dir="${LIBRARY_DIR}"/>
<get src="${commons.zip}"
dest="${LIBRARY_DIR}/as3commons-zip-1.0.0-alpha.1.swc"
verbose="true"/>
<!-- skip checksum until we find a valid file
<get src="${commons.zip}.md5"
dest="${LIBRARY_DIR}/as3commons-zip-1.0.0-alpha.1.swc.md5"
verbose="true"/>
<checksum file="${LIBRARY_DIR}/as3commons-zip-1.0.0-alpha.1.swc" algorithm="md5" verifyProperty="isMD5ok"/>
<delete file="${LIBRARY_DIR}/as3commons-zip-1.0.0-alpha.1.swc.md5" failOnError="false"/>
<fail message="Checksum failure for ${LIBRARY_DIR}/as3commons-zip-1.0.0-alpha.1.swc">
<condition>
<isfalse value="${isMD5ok}"/>
</condition>
</fail>
-->
</target>
<target name="check-as3httpclient.swc">
<available file="${LIBRARY_DIR}/as3httpclient.swc" property="as3httpclient.swc.present"/>
</target>
<!-- This has a BSD license which is a reciprocal license with the Apache v2 license. -->
<target name="get-as3httpclient.swc" depends="check-as3httpclient.swc" unless="as3httpclient.swc.present"
description="Download as3httpclient.swc">
<mkdir dir="${LIBRARY_DIR}"/>
<mkdir dir="${LIBRARY_DIR}/temp"/>
<get src="https://github.com/quetwo/as3httpclient/releases/download/1.0/as3httpclient.swc"
dest="${LIBRARY_DIR}/as3httpclient.swc"
/>
</target>
<target name="compile" depends="get-as3commons.swc, get-as3httpclient.swc"
description="Compiles the AIR application to a SWF file and places SWF in a temp directory to be packaged.">
<mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
output="${BUILD_DIR}/${APP_NAME}.swf"
swf-version="23"
static-rsls="true"
accessible="true"
configname="air"
debug="${DEBUG_FLAG}"
failonerror="true"
fork="true"
link-report="${BUILD_DIR}/${APP_NAME}.lnk.xml"
maxmemory="512m">
<source-path path-element="${SOURCE_DIR}"/>
<source-path path-element="${COMMON_SOURCE_DIR}"/>
<external-library-path file="${AIR_HOME}/frameworks/libs/air/airglobal.swc" append="true"/>
<library-path dir="${LIBRARY_DIR}" includes="*.swc" append="true"/>
<library-path dir="${ANT_ON_AIR_DIR}" includes="*.swc" append="true"/>
<!--<library-path dir="${LIBRARY_DIR}/temp/as3httpclient-master/lib" includes="*.swc" append="true"/>-->
<define name="INSTALLER::releaseVersion" value="${release.version}"/>
<define name="INSTALLER::buildNumber" value="${build.number}"/>
</mxmlc>
</target>
<!-- Make sure to use the same certificate each time so we can update the app. -->
<target name="certificate" if="cert_pwd_not_found">
<antcall target="generate-certificate"/>
</target>
<target name="generate-certificate">
<echo message="Using cert ${KEYSTORE}" />
<java jar="${ADT}" fork="true"
failonerror="true">
<arg value="-certificate"/>
<arg value="-cn"/>
<arg value="${CERT_NAME}"/>
<arg value="-ou"/>
<arg value="${CERT_ORG_UNIT}"/>
<arg value="-o"/>
<arg value="${CERT_ORG_NAME}"/>
<arg value="-c"/>
<arg value="${CERT_COUNTRY}"/>
<arg value="${CERT_KEY_TYPE}"/>
<arg value="${KEYSTORE}"/>
<arg value="${CERT_PASSWORD}"/>
</java>
</target>
<target name="check-as3crypto-license" >
<condition property="found-as3crypto-license" >
<available file="${DEPS_DIR}/as3crypto/LICENSE.txt"/>
</condition>
</target>
<target name="get-as3crypto-license" depends="check-as3crypto-license" unless="found-as3crypto-license">
<mkdir dir="${DEPS_DIR}/as3crypto/temp" />
<get src="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/as3crypto/Crypto.zip"
dest="${DEPS_DIR}/as3crypto/temp"
/>
<unzip src="${DEPS_DIR}/as3crypto/temp/Crypto.zip" dest="${DEPS_DIR}/as3crypto">
<patternset>
<include name="LICENSE.txt"/>
</patternset>
</unzip>
<delete dir="${DEPS_DIR}/as3crypto/temp" />
</target>
<target name="simple-untar-license" >
<mkdir dir="${DEPS_DIR}/as3-simple-untar" />
<get src="https://raw.githubusercontent.com/thdtjsdn/as3-simple-untar/master/src/de/ketzler/utils/SimpleUntar.as"
dest="${DEPS_DIR}/as3-simple-untar/LICENSE"/>
<replaceregexp file="${DEPS_DIR}/as3-simple-untar/LICENSE"
match="package .*" replace=""
flags="s"
/>
</target>
<target name="packageair"
description="Packages the build SWF file from a temp directory to create an AIR file">
<echo message="Using cert ${KEYSTORE}" />
<mkdir dir="${DEPS_DIR}/as3httpclientlib" />
<get src="https://raw.githubusercontent.com/quetwo/as3httpclient/as3httpclient-work/License.txt"
dest="${DEPS_DIR}/as3httpclientlib"
/>
<mkdir dir="${DEPS_DIR}/as3corelib" />
<get src="https://raw.githubusercontent.com/mikechambers/as3corelib/master/README"
dest="${DEPS_DIR}/as3corelib"
/>
<antcall target="get-as3crypto-license" />
<antcall target="simple-untar-license" />
<echo message="Run Adobe Air ADT"/>
<java jar="${ADT}" fork="true"
failonerror="true"
maxmemory="512m">
<arg value="-package"/>
<arg line="-tsa http://timestamp.digicert.com"/>
<arg value="-storetype"/>
<arg value="${STORETYPE}"/>
<arg value="-keystore"/>
<arg value="${KEYSTORE}"/>
<arg value="-storepass"/>
<arg value="${CERT_PASSWORD}"/>
<arg value="${BUILD_DIR}/${APP_NAME}.air"/>
<arg value="${SOURCE_DIR}/${APP_NAME}-app.xml"/>
<arg value="${basedir}/NOTICE"/>
<arg value="${DEPS_DIR}"/>
<arg value="-C"/>
<arg value="${basedir}/binary_license"/>
<arg value="${basedir}/binary_license/LICENSE"/>
<arg value="-C"/>
<arg value="${BUILD_DIR}"/>
<arg value="${BUILD_DIR}/${APP_NAME}.swf"/>
<arg value="-C"/>
<arg value="${SOURCE_DIR}"/>
<arg value="${SOURCE_DIR}/${APP_CONFIG_XML_NAME}.xml"/>
<arg value="${ASSETS_DIR}"/>
</java>
</target>
<target name="copy-misc" description="Copy config files to release directory">
<copy file="${basedir}/README" tofile="${RELEASE_DIR}/READme"/>
</target>
<!--
Packages the source distribution with ZIP and TAR_GZIP.
The source file line endings match the package type.
-->
<target name="source-package" description="Package source files.">
<mkdir dir="${BUILD_DIR}/temp"/>
<copy todir="${BUILD_DIR}/temp/${COMMON_PROJECT_NAME}" includeEmptyDirs="false">
<fileset dir="${COMMON_PROJECT_DIR}">
<exclude name="*.p12"/>
<exclude name="*.password"/>
<exclude name="rat.report"/>
<exclude name="libs/**"/>
<exclude name="bin/**"/>
<exclude name="bin-debug/**"/>
<exclude name="release/**"/>
<exclude name=".settings/**"/>
<exclude name="**/.actionScriptProperties"/>
<exclude name="**/.flexProperties"/>
<exclude name="**/.flexLibProperties"/>
<exclude name="**/.project"/>
<exclude name="**/.idea/**"/>
</fileset>
</copy>
<copy todir="${BUILD_DIR}/temp/ant_on_air" includeEmptyDirs="false">
<fileset dir="${basedir}/ant_on_air">
<include name="build.properties" />
<include name="build.xml" />
</fileset>
</copy>
<copy todir="${BUILD_DIR}/temp/ant_on_air/src" includeEmptyDirs="false">
<fileset dir="${basedir}/ant_on_air/src">
</fileset>
</copy>
<copy todir="${BUILD_DIR}/temp/ant_on_air/locale" includeEmptyDirs="false">
<fileset dir="${basedir}/ant_on_air/locale">
</fileset>
</copy>
<copy todir="${BUILD_DIR}/temp/ant_on_air/tests" includeEmptyDirs="false">
<fileset dir="${basedir}/ant_on_air/tests">
<exclude name="*.swf" />
<exclude name="temp/" />
</fileset>
</copy>
<copy todir="${BUILD_DIR}/temp/${INSTALLER_PROJECT_NAME}" includeEmptyDirs="false">
<fileset dir="${basedir}/${INSTALLER_PROJECT_NAME}">
<exclude name="*.p12"/>
<exclude name="*.password"/>
<exclude name="rat.report"/>
<exclude name="libs/**"/>
<exclude name="bin/**"/>
<exclude name="bin-debug/**"/>
<exclude name="build/**"/>
<exclude name="release/**"/>
<exclude name="rc/**"/>
<exclude name=".settings/**"/>
<exclude name="**/.actionScriptProperties"/>
<exclude name="**/.flexProperties"/>
<exclude name="**/.flexLibProperties"/>
<exclude name="**/.project"/>
<exclude name="**/.idea/**"/>
</fileset>
</copy>
<!-- Bump these up to the top-level release directory. -->
<copy todir="${BUILD_DIR}/temp" includeEmptyDirs="false">
<fileset dir="${basedir}">
<include name="build.*"/>
<include name="binary_license/LICENSE"/>
<include name="LICENSE"/>
<include name="NOTICE"/>
<include name="README"/>
<include name="RELEASE_GUIDE"/>
<include name="CONTRIBUTING"/>
<include name="CONTRIBUTORS"/>
<include name="RELEASE_NOTES"/>
<exclude name="installerBadge/**" />
<exclude name="installerLocaleEditor/**" />
<exclude name="common/**" />
<exclude name="ant_on_air/**" />
<exclude name="*.p12"/>
<exclude name="*.password"/>
<exclude name="rat.report"/>
<exclude name="build/**"/>
<exclude name="release/**"/>
<exclude name="local.properties"/>
</fileset>
</copy>
<fixcrlf srcdir="${BUILD_DIR}/temp" eol="crlf" encoding="UTF8" excludes="**/assets/**,**/*.ttf,**/*.png" fixlast="false"/>
<mkdir dir="${RELEASE_DIR}"/>
<zip destfile="${RELEASE_DIR}/${source.kit}.zip"
basedir="${BUILD_DIR}/temp"/>
<fixcrlf srcdir="${BUILD_DIR}/temp" eol="unix" encoding="UTF8" excludes="**/assets/**,**/*.ttf,**/*.png" fixlast="false"/>
<tar destfile="${RELEASE_DIR}/${source.kit}.tar.gz"
compression="gzip"
basedir="${BUILD_DIR}/temp"/>
<delete dir="${BUILD_DIR}/temp"/>
<delete dir="${BUILD_DIR}"/>
</target>
<!--
Packages the binary distribution with ZIP and TAR_GZIP.
-->
<target name="binary-package" description="Package binary files.">
<mkdir dir="${RELEASE_DIR}"/>
<zip destfile="${RELEASE_DIR}/${binary.kit}.zip">
<fileset dir="${basedir}/release">
<exclude name="**/*.zip"/>
<exclude name="**/*.tar*"/>
</fileset>
</zip>
<tar destfile="${RELEASE_DIR}/${binary.kit}.tar.gz" compression="gzip">
<zipfileset src="${RELEASE_DIR}/${binary.kit}.zip"/>
</tar>
</target>
<!--
Run the Apache Rat audit tool against the source in the source kit.
The report is written to rat.report.
You need to place apache-rat-tasks-0.8.jar and apache-rat-0.8.jar in the
anttask.classpath in order to do this. If the jar isn't found, the report
will not be generated.
-->
<target name="rat-report" depends="rat-taskdef" if="have.rattasks"
description="Report on licenses in source kit.">
<!-- Unzip the source kit -->
<unzip src="${RELEASE_DIR}/${source.kit}.zip" dest="${RELEASE_DIR}/temp"/>
<property name="rat.dir" value="${RELEASE_DIR}/temp"/>
<echo message="Checking files at ${rat.dir}, report is ${basedir}/rat.report"/>
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
reportFile="${basedir}/rat.report">
<fileset dir="${rat.dir}">
<exclude name="**/Apache License Version 2.txt"/>
<!-- Start of source files -->
<!-- generated source files that don't have Apache v2 license header -->
<exclude name="**/build.number"/>
<exclude name="**/.actionScriptProperties"/>
<exclude name="**/.flexProperties"/>
<exclude name="**/.flexLibProperties"/>
<exclude name="**/.project"/>
<exclude name="**/.fxpProperties"/>
<exclude name="**/.settings/**"/>
<exclude name="**/.idea/**"/>
<exclude name="**/*.iml"/>
<exclude name="CONTRIBUTING"/>
<exclude name="CONTRIBUTORS"/>
<!-- End of source files -->
<!-- Start of binary files -->
<!-- exclude media (png, ico) -->
<exclude name="**/*.ico"/>
<exclude name="**/*.png"/>
<!-- exclude fonts -->
<exclude name="**/*.ttf"/>
<!-- End of binary files -->
</fileset>
</rat:report>
<delete dir="${RELEASE_DIR}/temp" failOnError="false"/>
</target>
<target name="rat-taskdef" description="Rat taskdef">
<available property="have.rattasks"
resource="org/apache/rat/anttasks/antlib.xml"
classpathref="anttask.classpath"/>
<antcall target="have-rattasks"/>
<antcall target="no-rattasks"/>
</target>
<target name="have-rattasks" if="have.rattasks">
<typedef resource="org/apache/rat/anttasks/antlib.xml"
uri="antlib:org.apache.rat.anttasks"
classpathref="anttask.classpath"/>
</target>
<target name="no-rattasks" unless="have.rattasks">
<echo message="Rat report not generated."/>
<echo message="rat jars (apache-rat-*.jar, apache-rat-tasks-*.jar)"/>
<echo message="not found in anttask.classpath"/>
</target>
<target name="create-md5s" >
<checksum file="${RELEASE_DIR}/${source.kit}.zip" algorithm="md5" forceOverwrite="yes" />
<checksum file="${RELEASE_DIR}/${source.kit}.tar.gz" algorithm="md5" forceOverwrite="yes" />
<checksum file="${RELEASE_DIR}/${binary.kit}.${extension}" algorithm="md5" forceOverwrite="yes" />
</target>
<target name="sign" >
<exec executable="gpg">
<arg value="--armor" />
<arg value="--output" />
<arg value="${RELEASE_DIR}/${source.kit}.zip.asc" />
<arg value="--detach-sig" />
<arg value="${RELEASE_DIR}/${source.kit}.zip" />
</exec>
<exec executable="gpg">
<arg value="--armor" />
<arg value="--output" />
<arg value="${RELEASE_DIR}/${source.kit}.tar.gz.asc" />
<arg value="--detach-sig" />
<arg value="${RELEASE_DIR}/${source.kit}.tar.gz" />
</exec>
<exec executable="gpg">
<arg value="--armor" />
<arg value="--output" />
<arg value="${RELEASE_DIR}/${binary.kit}.${extension}.asc" />
<arg value="--detach-sig" />
<arg value="${RELEASE_DIR}/${binary.kit}.${extension}" />
</exec>
</target>
<target name="sign_exe" description="sign exe when on mac" >
<checksum file="${RELEASE_DIR}/${binary.kit}.exe" algorithm="md5" forceOverwrite="yes" />
<exec executable="gpg">
<arg value="--armor" />
<arg value="--output" />
<arg value="${RELEASE_DIR}/${binary.kit}.exe.asc" />
<arg value="--detach-sig" />
<arg value="${RELEASE_DIR}/${binary.kit}.exe" />
</exec>
</target>
<target name="sign_dmg" description="sign dmg when on win" >
<checksum file="${RELEASE_DIR}/${binary.kit}.dmg" algorithm="md5" forceOverwrite="yes" />
<exec executable="gpg">
<arg value="--armor" />
<arg value="--output" />
<arg value="${RELEASE_DIR}/${binary.kit}.dmg.asc" />
<arg value="--detach-sig" />
<arg value="${RELEASE_DIR}/${binary.kit}.dmg" />
</exec>
</target>
<target name="debug" >
<copy file="${SOURCE_DIR}/${APP_NAME}-app.xml" todir="${BUILD_DIR}" />
<mkdir dir="${BUILD_DIR}/installer" />
<exec executable="${AIR_HOME}/bin/${adl}" dir="${BUILD_DIR}" failonerror="true">
<arg value="-runtime" />
<arg value="${AIR_HOME}/runtimes/air/${runtime}" />
<arg value="${BUILD_DIR}/${APP_NAME}-app.xml" />
<arg value="--" />
<arg value="-config=${LOCAL_CONFIG_URL}" />
</exec>
</target>
<target name="debug-locale" >
<copy file="${SOURCE_DIR}/${APP_NAME}-app.xml" todir="${BUILD_DIR}" />
<mkdir dir="${BUILD_DIR}/installer" />
<exec executable="${AIR_HOME}/bin/${adl}" dir="${BUILD_DIR}" failonerror="true">
<arg value="-runtime" />
<arg value="${AIR_HOME}/runtimes/air/${runtime}" />
<arg value="${BUILD_DIR}/${APP_NAME}-app.xml" />
<arg value="--" />
<arg value="-config=${LOCAL_CONFIG_URL}" />
<arg value="-language=${TEST_LOCALE}" />
</exec>
</target>
<target name="debug-for-real" >
<copy file="${SOURCE_DIR}/${APP_NAME}-app.xml" todir="${BUILD_DIR}" />
<mkdir dir="${BUILD_DIR}/installer" />
<exec executable="${AIR_HOME}/bin/${adl}" dir="${BUILD_DIR}" failonerror="true">
<arg value="-runtime" />
<arg value="${AIR_HOME}/runtimes/air/${runtime}" />
<arg value="${BUILD_DIR}/${APP_NAME}-app.xml" />
</exec>
</target>
</project>