This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
plugin-build.xml
364 lines (319 loc) · 16.3 KB
/
plugin-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
<project name="Flowplayer plugin base build file (included in the actual plugin specific build.xml files)">
<property file="build.generated.properties"/>
<property file="${user.home}/plugin.properties" />
<property file="plugin-build.properties" />
<property name="src" value="src" />
<property name="src-as" value="${src}/actionscript" />
<property name="src-js" value="${src}/javascript" />
<property name="build-dir" value="build" />
<property name="example-dir" value="example" />
<property name="dist-dir" value="dist" />
<property name="lib-dir" value="lib" />
<property name="flex-libs-path" value="${flexlibsdir}/advancedgrids.swc ${flexlibsdir}/charts.swc ${flexlibsdir}/flash-integration.swc ${flexlibsdir}/spark.swc ${flexlibsdir}/sparkskins.swc ${flexlibsdir}/authoringsupport.swc ${flexlibsdir}/core.swc ${flexlibsdir}/framework.swc ${flexlibsdir}/rpc.swc ${flexlibsdir}/spark_dmv.swc ${flexlibsdir}/textLayout.swc" />
<property name="flowplayer-js-version-info" value="3.1.4" />
<property name="src-flowplayer" value="../flash/core" />
<property name="plugin-swc" value="${basename}.swc" />
<property name="plugin-swc-versioned" value="${basename}-${version}.swc" />
<condition property="extra.libs" value="${plugin-libs}" else="">
<isset property="plugin-libs" />
</condition>
<macrodef name="build-plugin">
<attribute name="plugin-main-class" />
<attribute name="plugin-binary" />
<sequential>
<echo message="++ @{plugin-binary} +++">
</echo>
<antcall target="prepare" />
<antcall target="compile">
<param name="plugin-binary" value="@{plugin-binary}" />
<param name="plugin-main-class" value="@{plugin-main-class}" />
</antcall>
</sequential>
</macrodef>
<target name="clean">
<echo message="cleaning ${basename}" />
<delete>
<fileset dir="${build-dir}">
<include name="*swf" />
<include name="*swc" />
</fileset>
</delete>
</target>
<macrodef name="mxmlc.compile">
<attribute name="src" default="${src-as}" />
<attribute name="plugin-main-class" default="${plugin-main-class}" />
<attribute name="out" default="${plugin-binary}" />
<attribute name="libs" default="" />
<sequential>
<condition property="libs" value="" else="-include-libraries @{libs}">
<equals arg1="@{libs}" arg2="" />
</condition>
<condition property="pluginruntimelibs1" value="-runtime-shared-library-path+=${plugin-runtime-lib-swc1},library.swf" else="">
<isset property="plugin-runtime-lib-swc1" />
</condition>
<condition property="pluginruntimelibs2" value="-runtime-shared-library-path+=${plugin-runtime-lib-swc2},library.swf" else="">
<isset property="plugin-runtime-lib-swc2" />
</condition>
<condition property="pluginruntimelibs3" value="-runtime-shared-library-path+=${plugin-runtime-lib-swc3},library.swf" else="">
<isset property="plugin-runtime-lib-swc3" />
</condition>
<condition property="mxmlc-library-path" value="${library-path}" else="">
<isset property="library-path" />
</condition>
<condition property="mxmlc-define" value="-define=${compiler-define}" else="">
<isset property="compiler-define" />
</condition>
<condition property="mxmlc-defines" value="${compiler-defines}" else="">
<isset property="compiler-defines" />
</condition>
<condition property="tld-define" value="-define+=CONFIG::secondaryDomains,${secondary-domains-quoted}" else="">
<isset property="secondary-domains-quoted" />
</condition>
<condition property="mxmlc-sources" value="${extra-sources}" else="">
<isset property="extra-sources" />
</condition>
<echo message="compiling with ${mxmlc-library-path}" />
<echo message="compiling with ${mxmlc-define} ${mxmlc-defines}" />
<exec executable="${mxmlc_bin}" failonerror="true">
<arg line="-source-path @{src} ${mxmlc-library-path} ${mxmlc-sources}" />
<arg line="${mxmlc-define}" />
<arg line="${mxmlc-defines}" />
<arg line="${tld-define}"/>
<arg line="${libs}" />
<arg line="-library-path ${flex-libs-path} ${mxmlc-library-path}" />
<arg line="-runtime-shared-library-path=${flowplayer_lib},library.swf" />
<arg line="${pluginruntimelibs1}" />
<arg line="${pluginruntimelibs2}" />
<arg line="${pluginruntimelibs3}" />
<arg line="-static-link-runtime-shared-libraries=false"/>
<arg line="-generate-frame-loader=false"/>
<arg line="-default-frame-rate=${framerate}" />
<arg line="-default-background-color=${bgcolor}" />
<arg line="-strict=true" />
<arg line="-keep-as3-metadata=Value,External" />
<arg line="'@{src}/@{plugin-main-class}'" />
<arg line="-output '${build-dir}/@{out}'" />
<arg line="-incremental=false"/>
</exec>
</sequential>
</macrodef>
<macrodef name="compc.compile">
<attribute name="src" default="${src-as}" />
<attribute name="sources" default="." />
<attribute name="out" default="${plugin-binary}" />
<attribute name="libs" default="" />
<sequential>
<condition property="libs" value="" else="-include-libraries @{libs}">
<equals arg1="@{libs}" arg2="" />
</condition>
<condition property="pluginruntimelibs1" value="-runtime-shared-library-path+=${plugin-runtime-lib-swc1},library.swf" else="">
<isset property="plugin-runtime-lib-swc1" />
</condition>
<condition property="pluginruntimelibs2" value="-runtime-shared-library-path+=${plugin-runtime-lib-swc2},library.swf" else="">
<isset property="plugin-runtime-lib-swc2" />
</condition>
<condition property="pluginruntimelibs3" value="-runtime-shared-library-path+=${plugin-runtime-lib-swc3},library.swf" else="">
<isset property="plugin-runtime-lib-swc3" />
</condition>
<condition property="compc-library-path" value="${library-path}" else="">
<isset property="library-path" />
</condition>
<condition property="compc-define" value="-define=${compiler-define}" else="">
<isset property="compiler-define" />
</condition>
<condition property="compc-sources" value="${extra-sources}" else="">
<isset property="extra-sources" />
</condition>
<condition property="compc-defines" value="${compiler-defines}" else="">
<isset property="compiler-defines" />
</condition>
<echo message="compiling lbrary with ${compc-library-path}" />
<echo message="compiling with ${compc-define}" />
<exec executable="${compc_bin}" failonerror="true">
<arg line="-source-path @{src} ${compc-sources}" />
<arg line="${libs}" />
<arg line="${compc-define}" />
<arg line="${compc-defines}" />
<arg line="-library-path ${flexdir}/frameworks/locale/en_US ${flex-libs-path} ${flowplayer_lib} ${compc-library-path}" />
<arg line="-include-sources @{src}" />
<arg line="-strict=true" />
<arg line="-keep-as3-metadata=External" />
<arg line="-output '${build-dir}/@{out}'" />
</exec>
</sequential>
</macrodef>
<macrodef name="prepare-example">
<attribute name="player-swf" />
<attribute name="main-swf" />
<sequential>
<copy todir="${build-dir}/example" overwrite="true">
<fileset dir="../flash/lib/devkit/example">
<include name="*.tmpl" />
</fileset>
<mapper type="glob" from="*.tmpl" to="*" />
<filterset begintoken="@" endtoken="@">
<filter token="FLOWPLAYER_JS_VERSION_INFO" value="${flowplayer-js-version-info}" />
<filter token="PLAYER_SWF" value="../@{player-swf}" />
<filter token="MAIN_PLAYER_SWF" value="../@{main-swf}" />
</filterset>
</copy>
<copy todir="${build-dir}/example">
<fileset dir="../flash/lib/devkit/example">
<exclude name="*.tmpl"/>
<include name="*.js" />
<include name="*.html" />
<include name="*.css" />
<include name="*.png" />
<include name="*.jpg" />
<include name="*.swf" />
<include name="*.txt" />
<include name="**/css/*" />
<include name="**/images/*" />
</fileset>
</copy>
<copy todir="${build-dir}">
<fileset dir="${src-flowplayer}/build">
<include name="*.swf" />
</fileset>
</copy>
<echo message="copying js files to build/example" />
<copy todir="${build-dir}/example" overwrite="true">
<fileset dir="${src-flowplayer}/build">
<include name="*.js" />
</fileset>
</copy>
</sequential>
</macrodef>
<target name="library" depends="build" description="builds the plugin lib">
<compc.compile src="${src-as}" libs="${extra.libs}" sources="." out="${plugin-swc}" />
<copy file="${build-dir}/${plugin-swc}" tofile="${build-dir}/${plugin-swc-versioned}">
</copy>
</target>
<target name="compile" unless="pluginproxy">
<mxmlc.compile src="${src-as}" libs="${extra.libs}" out="${plugin-binary}" plugin-main-class="${plugin-main-class}" />
<!--<antcall target="example" />-->
</target>
<target name="example" depends="build" description="prepare the plugin example html files">
<prepare-example player-swf="flowplayer.swf" main-swf="${plugin-binary-versioned}"/>
</target>
<target name="build" description="builds all" unless="pluginproxy">
<build-plugin plugin-binary="${plugin-binary}" plugin-main-class="${plugin-main-class}" />
<copy file="${build-dir}/${plugin-binary}" tofile="${build-dir}/${plugin-binary-versioned}" />
</target>
<target name="deploy" description="Deploys the plugin into the target dir" depends="build" unless="pluginproxy">
<available file="${deploy_dir}" property="deploy.dir.exists" />
<antcall target="_deploy" />
</target>
<target name="_deploy" if="deploy.dir.exists">
<echo message="deploying plugin to ${deploy_dir}" />
<copy file="${build-dir}/${plugin-binary}" todir="${deploy_dir}/${build-dir}" overwrite="true" verbose="true"/>
<copy file="${build-dir}/${plugin-binary-versioned}" todir="${deploy_dir}/${build-dir}" overwrite="true" verbose="true"/>
<copy file="${build-dir}/${plugin-binary-versioned}" todir="${deploy_dir}/${dist-dir}" overwrite="true" verbose="true"/>
<!--<copy file="${build-dir}/${plugin-binary}" tofile="${deploy_dir}/${build-dir}/${basename}-dev.swf" overwrite="true" />-->
</target>
<target name="dist" description="Copies the distributaion packages into a target dir" depends="zip, source-zip" unless="pluginproxy">
<echo message="Copying dist zip to ${deploy-dir}" />
<copy file="${dist-dir}/${basename}-${version}.zip" todir="${deploy_dir}/${dist-dir}" overwrite="true" />
<copy file="${dist-dir}/${basename}-${version}-src.zip" todir="${deploy_dir}/${dist-dir}" overwrite="true" />
<delete dir="${dist-dir}/${basename}"/>
<unzip src="${dist-dir}/${basename}-${version}.zip" dest="${dist-dir}" />
<echo message="Copying swfs to ${deploy-dir}" />
<copy file="${dist-dir}/${basename}/${plugin-binary-versioned}" todir="${deploy_dir}/${dist-dir}" overwrite="true" failonerror="false" verbose="true" />
<copy file="${dist-dir}/${basename}/${plugin-binary-versioned}" todir="${deploy_dir}/build" overwrite="true" failonerror="false" verbose="true" />
</target>
<target name="prepare" unless="pluginproxy">
<mkdir dir="${example-dir}" />
<mkdir dir="${build-dir}" />
<mkdir dir="${dist-dir}" />
<copy file="${flowplayer_lib}" todir="${build-dir}" />
<unzip dest="${build-dir}">
<fileset file="${flowplayer_lib}" />
</unzip>
</target>
<target name="zip" unless="pluginproxy">
<zip destfile="${dist-dir}/${basename}-${version}.zip">
<zipfileset prefix="${basename}" dir="${basedir}">
<include name="LICENSE.txt" />
<include name="README.txt" />
</zipfileset>
<zipfileset prefix="${basename}" dir="${build-dir}">
<include name="${plugin-binary-versioned}" />
</zipfileset>
</zip>
<echo message="copying to ${dist-dir}/${basename}.zip" />
<copy file="${dist-dir}/${basename}-${version}.zip" tofile="${dist-dir}/${basename}.zip" overwrite="true" />
<copy file="${dist-dir}/${basename}-${version}.zip" tofile="${dist-dir}/${basename}-${version}-${flash.target.player}.zip" overwrite="true" />
</target>
<target name="zip-swc">
<zip destfile="${dist-dir}/${basename}-${version}.swc.zip">
<zipfileset prefix="${basename}" dir="../flash/lib/devkit">
<include name="LICENSE.txt" />
<include name="README-swc.txt" />
</zipfileset>
<zipfileset prefix="${basename}" dir="${build-dir}">
<include name="${plugin-swc-versioned}" />
</zipfileset>
</zip>
</target>
<target name="zip-with-examples">
<zip destfile="${dist-dir}/${basename}-${version}.zip">
<zipfileset prefix="${basename}" dir="../flash/lib/devkit">
<include name="LICENSE.txt" />
<include name="README.txt" />
</zipfileset>
<zipfileset prefix="${basename}" dir="${build-dir}">
<include name="${plugin-binary-versioned}" />
<include name="flowplayer.swf" />
<include name="flowplayer.controls.swf" />
<include name="example/*" />
</zipfileset>
</zip>
</target>
<target name="write-zip-url">
<echo message="writing to ${url-file}" />
<echo file="${url-file}" append="true"><a href="http://flowplayer-releases.s3.amazonaws.com/${basename}/${basename}.zip">${basename}.zip</a> <br />
</echo>
</target>
<target name="write-version">
<echo file="${yaml-file}" append="true"> ${shortname_yaml}: ${version}${line.separator}</echo>
</target>
<target name="write-filesize">
<length property="filesize" file="${build-dir}/${plugin-binary}" />
<echo file="${yaml-file}" append="true" message=" ${basename_yaml}.swf: ${filesize}${line.separator}" />
<length property="zip.filesize" file="${dist-dir}/${basename_yaml}-${version}.zip" />
<echo file="${yaml-file}" append="true" message=" ${basename_yaml}.zip: ${zip.filesize}${line.separator}" />
</target>
<target name="write-dist-info">
<echo file="${dist-file}" append="true" message="${basename_yaml}:${line.separator}" />
<echo file="${dist-file}" append="true" message=" folder: ${releasedir}${line.separator}" />
<echo file="${dist-file}" append="true" message=" files:${line.separator}" />
<echo file="${dist-file}" append="true" message=" - ${basename}-${version}.zip${line.separator}" />
<echo file="${dist-file}" append="true" message=" - ${basename}-${version}.swf${line.separator}" />
</target>
<target name="source-zip" depends="prepare" unless="pluginproxy">
<zip destfile="${dist-dir}/${basename}-${version}-src.zip">
<zipfileset prefix="${basename}" dir="${basedir}">
<include name="LICENSE.txt" />
<include name="README.txt" />
<include name="build.xml" />
<include name="build.properties" />
</zipfileset>
<zipfileset prefix="${basename}/${src}" dir="${src}">
<include name="**/*" />
</zipfileset>
</zip>
<copy file="${dist-dir}/${basename}-${version}-src.zip" tofile="${dist-dir}/${basename}-src.zip" />
</target>
<target name="echo-name">
<echo message="${plugin-binary-versioned}" />
</target>
<target name="zip-swfs">
<updatezip zip="${all-swf-zip}">
<zipfiles>
<fileset dir="${build-dir}">
<include name="${basename}.swf" />
</fileset>
</zipfiles>
</updatezip>
</target>
</project>