-
Notifications
You must be signed in to change notification settings - Fork 116
/
InstallAdobeSDKs.xml
410 lines (371 loc) · 18.3 KB
/
InstallAdobeSDKs.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
<?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="InstallAdobeSDKs" default="install" basedir=".">
<property name="ROYALE_HOME" location="${basedir}"/>
<!-- this script supports the usingDownloadCache property and
downloadCacheFolder property to cache downloads in the
folder specified by downloadCacheFolder. This can make
a huge difference in future runs although there is some
risk around caching bad downloads and/or needing to
clean up the cache -->
<!-- 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}/nightly.properties"/>
<property file="${ROYALE_HOME}/build.properties"/>
<property name="bundle" value="en_US" />
<property file="${ROYALE_HOME}/InstallAdobeSDKs.properties/${bundle}.properties"/>
<property file="${ROYALE_HOME}/InstallAdobeSDKs.properties/en_US.properties"/>
<condition property="platform" value="mac">
<os family="mac" />
</condition>
<condition property="platform" value="windows">
<os family="windows" />
</condition>
<condition property="platform" value="linux">
<os family="unix" />
</condition>
<condition property="isMac" value="mac">
<os family="mac" />
</condition>
<condition property="isWindows" value="windows">
<os family="windows" />
</condition>
<condition property="isLinux" value="linux">
<os family="unix" />
</condition>
<condition property="download.dir" value="${env.HOME}/Downloads">
<os family="mac" />
</condition>
<condition property="download.dir" value="${env.HOMEDRIVE}/${env.HOMEPATH}/Downloads">
<os family="windows" />
</condition>
<property name="temp.dir" value="${basedir}/in" />
<target name="install" depends="flash-install,air-install,delete-temp-dir" >
</target>
<target name="air-sdk-name" description="Determines name of AIR SDK.">
<available file="${download.dir}/AdobeAIRSDK.zip" property="air.sdk.name" value="AdobeAIRSDK.zip"/>
<available file="${download.dir}/AIRSDK_Compiler.zip" property="air.sdk.name" value="AIRSDK_Compiler.zip"/>
<available file="${download.dir}/AdobeAIRSDK.tbz2" property="air.sdk.name" value="AdobeAIRSDK.tbz2"/>
<available file="${download.dir}/AdobeAIRSDK.dmg" property="air.sdk.name" value="AdobeAIRSDK.dmg"/>
<fail message="${ERROR_ADOBE_AIR_SDK_NOT_FOUND}">
<condition>
<not>
<isset property="air.sdk.name" />
</not>
</condition>
</fail>
</target>
<target name="ask-air" >
<property name="air.prompt.text" value="Hit any key when download complete" />
<input
message="${air.prompt.text}" />
</target>
<target name="air-install" depends="ask-air, air-sdk-name"
description="Copies downloaded AIR SDK to correct locations" >
<echo>${INFO_USING_AIR} ${air.sdk.name}</echo>
<antcall target="air-setup-win" />
<antcall target="air-setup-mac-if-mac" />
</target>
<target name="air-setup-win" if="isWindows">
<unzip src="${download.dir}/${air.sdk.name}" dest="${temp.dir}/airsdk" />
<echo>${INFO_FINISHED_UNZIPPING} ${temp.dir}/${air.sdk.name}</echo>
<copy todir="${ROYALE_HOME}" overwrite="true">
<fileset dir="${temp.dir}/airsdk">
<include name="AIR SDK license.pdf" />
<include name="AIR SDK Readme.txt" />
<include name="airsdk.xml" />
<include name="bin/adl.exe" />
<include name="bin/adt.bat" />
<include name="frameworks/libs/air/**" />
<include name="frameworks/projects/air/**" />
<include name="include/**" />
<include name="install/android/**" />
<include name="lib/adt.jar" />
<include name="lib/android/**" />
<include name="lib/aot/**" />
<include name="lib/nai/**" />
<include name="lib/win/**" />
<include name="runtimes/**" />
<include name="samples/badge/**" />
<include name="samples/descriptor-sample.xml" />
<include name="samples/icons/**" />
<include name="templates/air/**" />
<include name="templates/extensions/**" />
<include name="templates/sdk/**" />
</fileset>
</copy>
</target>
<target name="unzipOrMountDMG" description="Check for file extension and decide if we should unzip or mount">
<mkdir dir="${temp.dir}/airsdk" />
<copy file="${download.dir}/${air.sdk.name}" tofile="${temp.dir}/airsdk/${air.sdk.name}" />
<condition property="shouldUnzip" value="true">
<matches pattern="tbz2" string="${air.sdk.name}"/>
</condition>
<echo message="Should unzip: ${shouldUnzip}"/>
</target>
<target name="unzipAIRSDK" if="shouldUnzip">
<echo message="Unzipping"/>
<!--The tbz2 contains symlinks which Ant does not preserve
<untar compression="bzip2" src="${temp.dir}/${air.sdk.name}" dest="${temp.dir}/airsdk" />-->
<exec executable="bunzip2" dir="${temp.dir}/airsdk">
<arg value="${air.sdk.name}" />
</exec>
<echo file="${basedir}/airtar.properties">air.tar.name=${air.sdk.name}</echo>
<replace file="${basedir}/airtar.properties" token="tbz2" value="tar" />
<property file="${basedir}/airtar.properties" />
<exec executable="tar" dir="${temp.dir}/airsdk">
<arg value="-xvf" />
<arg value="${air.tar.name}" />
</exec>
<echo>${INFO_FINISHED_UNTARING} ${temp.dir}/airsdk/${air.tar.name}</echo>
<delete file="${basedir}/airtar.properties" />
</target>
<target name="mountAIRSDK" unless="shouldUnzip">
<echo message="Mounting dmg"/>
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="true">
<arg value="attach"/>
<arg value="-nobrowse"/>
<arg value="${temp.dir}/airsdk/${air.sdk.name}"/>
</exec>
</target>
<target name="copyFromMount" unless="shouldUnzip">
<echo message="Copying AIR SDK from mounted volume"/>
<exec executable="rsync" dir="${ROYALE_HOME}">
<arg value="--archive" />
<arg value="--ignore-existing" />
<arg value="--force" />
<arg value="/Volumes/AIR SDK/"/>
<arg value="${temp.dir}/airsdk" />
</exec>
</target>
<target name="unmountAIRSDK" unless="shouldUnzip">
<echo message="Unmounting AIR SDK"/>
<exec executable="/usr/bin/hdiutil" os="Mac OS X" failonerror="false">
<arg value="unmount"/>
<arg value="/Volumes/AIR SDK"/>
</exec>
</target>
<target name="air-setup-mac-if-mac" unless="isWindows">
<antcall target="air-setup-mac" />
</target>
<target name="air-setup-mac" depends="unzipOrMountDMG,unzipAIRSDK,mountAIRSDK,copyFromMount,unmountAIRSDK" unless="isWindows">
<antcall target="mac-copy-file">
<param name="srcdir" value="." />
<param name="filename" value="AIR SDK license.pdf"/>
<param name="destdir" value="${ROYALE_HOME}" />
</antcall>
<antcall target="mac-copy-file">
<param name="srcdir" value="." />
<param name="filename" value="AIR SDK Readme.txt"/>
<param name="destdir" value="${ROYALE_HOME}" />
</antcall>
<antcall target="mac-copy-file">
<param name="srcdir" value="." />
<param name="filename" value="airsdk.xml"/>
<param name="destdir" value="${ROYALE_HOME}" />
</antcall>
<antcall target="mac-copy-file">
<param name="srcdir" value="bin" />
<param name="filename" value="adl"/>
<param name="destdir" value="${ROYALE_HOME}/bin" />
</antcall>
<antcall target="mac-copy-file">
<param name="srcdir" value="bin" />
<param name="filename" value="adt"/>
<param name="destdir" value="${ROYALE_HOME}/bin" />
</antcall>
<antcall target="mac-copy-file">
<param name="srcdir" value="lib" />
<param name="filename" value="adt.jar"/>
<param name="destdir" value="${ROYALE_HOME}/lib" />
</antcall>
<antcall target="mac-copy-file">
<param name="srcdir" value="samples" />
<param name="filename" value="descriptor-sample.xml"/>
<param name="destdir" value="${ROYALE_HOME}/samples" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="frameworks/libs/air" />
<param name="destdir" value="${ROYALE_HOME}/frameworks/libs" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="frameworks/projects/air" />
<param name="destdir" value="${ROYALE_HOME}/frameworks/projects" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="include" />
<param name="destdir" value="${ROYALE_HOME}" />
</antcall>
<antcall target="mac-copy-dir-if-exists">
<param name="srcdir" value="install/android" />
<param name="destdir" value="${ROYALE_HOME}/install" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="lib/android" />
<param name="destdir" value="${ROYALE_HOME}/lib" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="lib/aot" />
<param name="destdir" value="${ROYALE_HOME}/lib" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="lib/nai" />
<param name="destdir" value="${ROYALE_HOME}/lib" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="runtimes" />
<param name="destdir" value="${ROYALE_HOME}" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="samples/badge" />
<param name="destdir" value="${ROYALE_HOME}/samples" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="samples/icons" />
<param name="destdir" value="${ROYALE_HOME}/samples" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="templates/air" />
<param name="destdir" value="${ROYALE_HOME}/templates" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="templates/extensions" />
<param name="destdir" value="${ROYALE_HOME}/templates" />
</antcall>
<antcall target="mac-copy-dir">
<param name="srcdir" value="templates/sdk" />
<param name="destdir" value="${ROYALE_HOME}/templates" />
</antcall>
</target>
<target name="mac-copy-file" description="copies a file">
<mkdir dir="${destdir}" />
<exec executable="cp" dir="${ROYALE_HOME}">
<arg value="-p" />
<arg value="${temp.dir}/airsdk/${srcdir}/${filename}"/>
<arg value="${destdir}" />
</exec>
</target>
<target name="mac-copy-dir" description="copies a directory using exec and rsync so that symbolic links are preserved">
<echo file="${basedir}/maccopy.properties">mac.copy.echo=${mac.copy.echo.pattern}</echo>
<property file="${basedir}/maccopy.properties" />
<delete file="${basedir}/maccopy.properties" />
<echo>${mac.copy.echo}</echo>
<exec executable="rsync" dir="${ROYALE_HOME}">
<arg value="--archive" />
<arg value="--ignore-existing" />
<arg value="--force" />
<arg value="${temp.dir}/airsdk/${srcdir}"/>
<arg value="${destdir}" />
</exec>
</target>
<target name="mac-copy-dir-if-exists" depends="mac-check-exists" if="${srcdir}.exists" description="copies a directory using exec and rsync so that symbolic links are preserved">
<echo file="${basedir}/maccopy.properties">mac.copy.echo=${mac.copy.echo.pattern}</echo>
<property file="${basedir}/maccopy.properties" />
<echo>${mac.copy.echo}</echo>
<exec executable="rsync" dir="${ROYALE_HOME}">
<arg value="--archive" />
<arg value="--ignore-existing" />
<arg value="--force" />
<arg value="${temp.dir}/airsdk/${srcdir}"/>
<arg value="${destdir}" />
</exec>
</target>
<target name="mac-check-exists">
<available file="${temp.dir}/airsdk/${srcdir}" type="dir" property="${srcdir}.exists" />
</target>
<target name="flash-install"
description="Copies downloaded Flash SDK to correct locations" >
<property name="flash.prompt.text" value="Hit any key when download complete" />
<input
message="${flash.prompt.text}" />
<pathconvert property="fpversion">
<fileset dir="${download.dir}">
<include name="playerglobal*.swc"/>
</fileset>
<regexpmapper from="playerglobal([0-9]*)_([0-9]*)\.swc" to="\1.\2" />
</pathconvert>
<copy todir="${ROYALE_HOME}/frameworks/libs/player" overwrite="true">
<fileset dir="${download.dir}">
<include name="playerglobal*.swc" />
</fileset>
<regexpmapper from="playerglobal([0-9]*)_([0-9]*)\.swc" to="\1.\2/playerglobal.swc" />
</copy>
<replaceregexp file="${ROYALE_HOME}/royale-sdk-description.xml"
match="FP.*AIR"
replace="FP${fpversion} AIR" />
<replaceregexp file="${ROYALE_HOME}/frameworks/royale-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/flex-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/royale-config-template.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/flex-config-template.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/air-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/air-config-template.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/airmobile-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/js-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/js-config-template.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/node-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/node-config-template.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/jquery-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/jquery-config-template.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/createjs-config.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<replaceregexp file="${ROYALE_HOME}/frameworks/createjs-config-template.xml"
match="target-player.*target-player"
replace="target-player>${fpversion}</target-player" />
<echo>${INFO_COPIED_FLASH} ${fpversion}</echo>
</target>
<target name="delete-temp-dir">
<delete dir="${temp.dir}"/>
</target>
</project>