-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathharman-installer.xml
More file actions
259 lines (232 loc) · 9.85 KB
/
harman-installer.xml
File metadata and controls
259 lines (232 loc) · 9.85 KB
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
<?xml version="1.0"?>
<!--
Installs the the Apache Flex SDK with the Adobe AIR SDK from HARMAN.
Note: This script runs with Apache Ant. https://ant.apache.org/
Steps:
1. Download the Apache Flex SDK Binary Distribution
- Windows: apache-flex-sdk-4.16.1-bin.zip
- macOS or Linux: apache-flex-sdk-4.16.1-bin.tar.gz
2. Extract (unzip/untar) the Flex SDK Binary Distribution somewhere on your computer.
3. Download the AIR SDK from HARMAN. Do not extract!
- Windows: AIRSDK_Flex_Windows.zip
- macOS: AIRSDK_Flex_MacOS.zip
- Linux: AIRSDK_Flex_Linux.zip
4. Copy harman-installer.xml (this file) and AIRSDK_Flex_(Windows|MacOS|Linux).zip
into the root directory of the extracted Flex SDK Binary Distribution.
4. In a terminal, run the following command (replace 50.0 with the correct version):
ant -f harman-installer.xml -Dair.sdk.version=50.0
5. After installation, you may safely delete harman-installer.xml and
AIR_SDK_(Windows|MacOS|Linux).zip
-->
<project name="harman-installer" default="install" basedir=".">
<property name="flexsdk" value="${basedir}"/>
<property name="installer" value="1"/>
<property name="installer.script" value="${flexsdk}/installer.xml"/>
<property name="usingDownloadCache" value="1"/>
<property name="downloadCacheFolder" value="${basedir}/harman-installer-cache"/>
<property name="do.air.install" value="1"/>
<property name="air.sdk.version" value="50.0"/>
<property name="air.sdk.url.server" value=""/>
<property name="air.sdk.url.folder" value="airsdk"/>
<condition property="air.sdk.url.file" value="AIRSDK_Flex_MacOS.dmg">
<os family="mac"/>
</condition>
<condition property="air.sdk.url.file" value="AIRSDK_Flex_Windows.zip">
<os family="windows"/>
</condition>
<condition property="air.sdk.url.file" value="AIRSDK_Flex_Linux.tbz2">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<loadresource property="air.sdk.url.file.base">
<concat>${air.sdk.url.file}</concat>
<filterchain>
<replaceregex pattern="(.*)\.[A-Za-z0-9]+" replace="\1" />
</filterchain>
</loadresource>
<property name="airsdk.zip" value="${basedir}/${air.sdk.url.file.base}.zip"/>
<property name="do.flash.install" value="1"/>
<property name="flash.sdk.version" value="${air.sdk.version}"/>
<loadresource property="flash.sdk.swfversion">
<concat>${air.sdk.version}</concat>
<filterchain>
<replaceregex pattern="(\d+)(\.\d+)+" replace="\1" />
</filterchain>
</loadresource>
<property name="flash.sdk.url.server" value=""/>
<property name="flash.sdk.url.folder" value="playerglobal"/>
<property name="flash.sdk.url.file" value="playerglobal.swc"/>
<property name="do.fontswf.install" value="1"/>
<property name="do.osmf.install" value="1"/>
<property name="do.ofl.install" value="1"/>
<property name="do.swfobject.install" value="1"/>
<condition property="isWin" value="1">
<os family="windows"/>
</condition>
<condition property="isMac" value="1">
<os family="mac"/>
</condition>
<condition property="isLinux" value="1">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<fail message="Missing ${airsdk.zip}">
<condition>
<not>
<resourceexists>
<file file="${airsdk.zip}"/>
</resourceexists>
</not>
</condition>
</fail>
<fail message="Missing Flex SDK installer script. Expected: ${flexsdk}/installer.xml">
<condition>
<not>
<resourceexists>
<file file="${flexsdk}/installer.xml"/>
</resourceexists>
</not>
</condition>
</fail>
<target name="install" depends="-prepare,-validate-cache-files,-installer,-cleanup"
description="Install SDK"/>
<target name="-installer" description="Runs the installer.xml script from the Flex SDK">
<ant antfile="${installer.script}" inheritAll="true" inheritRefs="true" useNativeBasedir="true">
<!--
we're overwriting the URL values, but the refs need to point to a real
id reference value from sdk-installer-config-4.0.xml
-->
<property name="air.sdk.url.server.ref" value="en_US"/>
<property name="air.sdk.url.folder.ref" value="en_US"/>
<property name="air.sdk.url.file.ref" value="en_US"/>
<property name="flash.sdk.url.server.ref" value="en_US"/>
<property name="flash.sdk.url.folder.ref" value="en_US"/>
<property name="flash.sdk.url.file.ref" value="en_US"/>
<property name="flash.sdk.swfversion.ref" value="en_US"/>
</ant>
<replace file="${flexsdk}/frameworks/flex-config.xml" token="{targetPlayerMajorVersion}.{targetPlayerMinorVersion}" value="${flash.sdk.version}"/>
<!--
workaround for installer.xml failing to copy everything from lib.
grab the rest of the files that we saved in the cache.
-->
<copy todir="${flexsdk}/lib" overwrite="true">
<fileset dir="${downloadCacheFolder}/lib-backup"/>
</copy>
</target>
<target name="-prepare" description="Unzips AIR SDK and copies playerglobal.swc and lib directory to cache">
<mkdir dir="${downloadCacheFolder}"/>
<delete dir="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
<delete file="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file}"/>
<delete file="${downloadCacheFolder}/lib-backup"/>
<copy file="${airsdk.zip}"
tofile="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}.zip"
overwrite="true"/>
<antcall target="-mac-quarantine"/>
<antcall target="-unzip"/>
<copy file="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}/frameworks/libs/player/32.0/playerglobal.swc"
tofile="${downloadCacheFolder}/${flash.sdk.url.folder}/${flash.sdk.url.file}"
overwrite="true"/>
<!--
workaround for installer.xml failing to copy everything from lib. we'll
copy it into the cache for now.
-->
<copy todir="${downloadCacheFolder}/lib-backup"
overwrite="true">
<fileset dir="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}/lib"/>
</copy>
<antcall target="-mac-dmg"/>
<antcall target="-linux-tbz2"/>
<delete dir="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
</target>
<target name="-cleanup" description="Removes temporary files">
<delete dir="${downloadCacheFolder}"/>
</target>
<target name="-unzip" depends="-win-unzip,-unix-unzip"/>
<target name="-win-unzip" if="isWin">
<unzip src="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}.zip"
dest="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
</target>
<target name="-unix-unzip" unless="isWin">
<exec executable="unzip" failonerror="true">
<arg value="-q"/>
<arg value="-o"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}.zip"/>
<arg value="-d"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
</exec>
</target>
<target name="-mac-quarantine" if="isMac" description="Removes quarantine on macOS">
<exec executable="xattr" failonerror="true">
<arg value="-d"/>
<arg value="-r"/>
<arg value="com.apple.quarantine"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}.zip"/>
</exec>
</target>
<target name="-mac-dmg" if="isMac" description="Converts AIRSDK_Flex_MacOS.zip to AIRSDK_Flex_MacOS.dmg">
<exec executable="hdiutil" failonerror="true">
<arg value="makehybrid"/>
<arg value="-quiet"/>
<arg value="-hfs"/>
<arg value="-o"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file}"/>
<arg value="-hfs-openfolder"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
<arg value="-default-volume-name"/>
<arg value="AIR SDK"/>
</exec>
<delete file="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}.zip"/>
</target>
<target name="-linux-tbz2" if="isLinux" description="Converts AIRSDK_Flex_Linux.zip to AIRSDK_Flex_Linux.tbz2">
<exec executable="unzip" failonerror="true">
<arg value="-q"/>
<arg value="-o"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}.zip"/>
<arg value="-d"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
</exec>
<exec executable="tar" failonerror="true">
<arg value="-cjSf"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file}"/>
<arg value="-C"/>
<arg value="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}"/>
<arg value="."/>
</exec>
<delete file="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file.base}.zip"/>
</target>
<target name="-validate-cache-files">
<fail message="Missing ${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file}">
<condition>
<and>
<isset property="usingDownloadCache"/>
<not>
<resourceexists>
<file file="${downloadCacheFolder}/${air.sdk.url.folder}/${air.sdk.url.file}"/>
</resourceexists>
</not>
</and>
</condition>
</fail>
<fail message="Missing ${downloadCacheFolder}/${flash.sdk.url.folder}/${flash.sdk.url.file}">
<condition>
<and>
<isset property="usingDownloadCache"/>
<not>
<resourceexists>
<file file="${downloadCacheFolder}/${flash.sdk.url.folder}/${flash.sdk.url.file}"/>
</resourceexists>
</not>
</and>
</condition>
</fail>
</target>
</project>