build.xml 31.5 KB
Newer Older
1
<project name="Flowplayer" default="build">
2
    <taskdef name="flatten" classname="org.flowplayer.ant.Flatten" classpath="lib/ant-task.jar"/>
3

4
5
6
7
    <property file="build.generated.properties"/>
    <property file="${user.home}/core.properties" />
    <property file="build.properties"/>

Anssi Piirainen's avatar
Anssi Piirainen committed
8
    <property name="player-version" value="3.2.17" />
9
    <property name="secondaries-file" value="../tld/secondary" />
10
    <property file="${player-version}.properties"  />
11

12
    <loadfile srcfile="${secondaries-file}" property="secondaryTxt" />
13
    <flatten property="secondary-domains" value="${secondaryTxt}" />
14
15
    <property name="secondary-domains-quoted" value="&quot;&#39;${secondary-domains}&#39;&quot;" />

16
17
18
19
20
21
22
    <property name="source-dist-root-folder" value="flowplayer"/>

    <property name="version-status-quoted" value="&quot;&#39;${version-status}&#39;&quot;"/>
    <condition property="version-info" value="${version-1}.${version-2}.${version-3}"
               else="${version-1}.${version-2}.${version-3}-${version-status}">
        <equals arg1="${version-status}" arg2=""/>
    </condition>
23
    <echo message="flowplayer version ${player-version}" />
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

    <property name="controls-version-info-quoted" value="&quot;&#39;${controls-version-info}&#39;&quot;"/>
    <property name="audio-version-info-quoted" value="&quot;&#39;${audio-version-info}&#39;&quot;"/>

    <property name="core-dir" value="../flash/core"/>
    <property name="src" value="${core-dir}/src"/>
    <property name="src-as" value="${src}/actionscript"/>
    <property name="src-flash" value="${src}/flash"/>
    <property name="src-as-commercial" value="${src}/actionscript-commercial"/>
    <property name="src-as-builtin" value="${src}/actionscript-builtin"/>
    <property name="src-js" value="${src}/javascript"/>
    <property name="src-test" value="${core-dir}/test"/>
    <property name="src-html" value="${src}/html"/>
    <property name="build-dir" value="build"/>
    <property name="dist-dir" value="dist"/>
    <property name="apidoc-dir" value="build/apidoc"/>
    <property name="lib-dir" value="${core-dir}/lib"/>
    <property name="locale" value="en_US"/>

    <condition property="plugin-skin" value="${controls}" else="modern">
        <isset property="controls"/>
    </condition>
    
    <condition property="has-slowmotion-buttons" value="true" else="false">
        <equals arg1="${plugin-skin}" arg2="modern"/>
    </condition>

    <condition property="plugin-libs" value="${controls-dir}/src/flash/${plugin-skin}" else="">
        <available file="${controls-dir}/build.xml"/>
    </condition>

    <property name="libs-path" value="${flexlibsdir} ${lib-dir}/thunderbolt ${plugin-libs} ${plugin-swc}"/>
    <property name="classes-for-lib"
              value="org.flowplayer.view.Flowplayer org.flowplayer.util.PropertyBinder org.flowplayer.util.Arrange org.flowplayer.util.Assert org.flowplayer.model.PluginEvent org.flowplayer.util.TextUtil org.flowplayer.view.AbstractSprite org.flowplayer.view.AnimationEngine org.flowplayer.controller.NetStreamControllingStreamProvider org.flowplayer.controller.NetStreamClient org.flowplayer.controller.NetConnectionClient org.flowplayer.util.TimeUtil"/>
    <property name="doc-classes"
              value="${classes-for-lib} org.flowplayer.view.FlowplayerBase org.flowplayer.view.StyleableSprite org.flowplayer.model.Plugin org.flowplayer.model.PluginModel org.flowplayer.model.DisplayPluginModel org.flowplayer.model.ProviderModel org.flowplayer.model.Cloneable org.flowplayer.model.DisplayProperties org.flowplayer.model.Identifiable org.flowplayer.model.Callable org.flowplayer.model.Clip org.flowplayer.model.Playlist org.flowplayer.model.AbstractEvent org.flowplayer.model.ClipEvent org.flowplayer.model.PlayerEvent org.flowplayer.model.PluginEvent org.flowplayer.model.ClipEventDispatcher org.flowplayer.model.ClipEventSupport org.flowplayer.model.EventType org.flowplayer.model.ClipEventType org.flowplayer.model.PlayerEventType org.flowplayer.model.PluginEventType org.flowplayer.view.Styleable org.flowplayer.controller.StreamProvider org.flowplayer.model.PluginFactory org.flowplayer.controller.ClipURLResolver org.flowplayer.controller.ConnectionProvider org.flowplayer.util.Log"/>

    <condition property="classpath-temp" value="${lib-dir}/corelib/src ${lib-dir}/goasp/src_go ${plugin-classes}"
               else="${lib-dir}/corelib/src ${lib-dir}/goasp/src_go">
        <isset property="plugin-classes"/>
    </condition>

    <condition property="classpath" value="${classpath-temp} ${plugins}" else="${classpath-temp} ${src-as-builtin}">
        <isset property="plugins"/>
    </condition>

    <property name="library-binary" value="flowplayer.swc"/>
    <property name="library-binary-versioned" value="flowplayer-${version-info}.swc"/>

    <property name="player-binary" value="flowplayer.swf"/>
    <property name="debug-player-binary" value="flowplayer.debug.swf"/>
    <property name="commercial-debug-player-binary" value="flowplayer.commercial.debug.swf"/>
    <property name="commercial-player-binary" value="flowplayer.commercial.swf"/>
    <property name="player-binary-versioned" value="flowplayer-${version-info}.swf"/>
    <property name="commercial-player-binary-versioned" value="flowplayer.commercial-${version-info}.swf"/>

    <property name="dist-name" value="flowplayer-${version-info}.zip"/>
    <property name="dist-target-name" value="flowplayer-${version-info}-${flash.target.player}.zip"/>
    <property name="commercial-dist-name" value="flowplayer.commercial-${version-info}.zip"/>
    <property name="commercial-dist-target-name" value="flowplayer.commercial-${version-info}-${flash.target.player}.zip"/>
    <property name="multidomain-dist-name" value="flowplayer.multidomain-${version-info}.zip"/>
    <property name="multidomain-dist-target-name" value="flowplayer.multidomain-${version-info}-${flash.target.player}.zip"/>
    <property name="devkit-dist-name" value="flowplayer.devkit-${version-info}.zip"/>
    <property name="apidoc-dist-name" value="flowplayer.asdoc-${version-info}.zip"/>
    <property name="source-dist-name" value="flowplayer-${version-info}-src.zip"/>

    <property name="dist-name-dev" value="flowplayer.zip"/>
    <property name="commercial-dist-name-dev" value="flowplayer.commercial.zip"/>
    <property name="multidomain-dist-name-dev" value="flowplayer.multidomain.zip"/>
    <property name="devkit-dist-name-dev" value="flowplayer.devkit.zip"/>
    <property name="apidoc-dist-name-dev" value="flowplayer.asdoc.zip"/>
    <property name="source-dist-name-dev" value="flowplayer-src.zip"/>

    <target name="clean" depends="clean-plugins">
        <delete dir="${build-dir}">
            <include name="*swf"/>
            <include name="*swc"/>
        </delete>
        <delete dir="${build-dir}/example"></delete>
    </target>

105
    <target name="dobuild" depends="check-uptodate, flowplayer.js, build-lib, plugins" unless="uptodate.main">
106
107
108
109
110
111
        <antcall target="prepare"/>
        <property name="licenselib" value="${lib-dir}/licensekey"/>
        <antcall target="compile"/>
        <example player-swf="${player-binary-versioned}" example-dir="example-free"/>
    </target>

112
    <target name="dobuild-all" depends="check-uptodate, flowplayer.js, build-lib, plugins-all" unless="uptodate.main">
113
114
115
116
117
118
        <antcall target="prepare"/>
        <property name="licenselib" value="${lib-dir}/licensekey"/>
        <antcall target="compile"/>
        <example player-swf="${player-binary-versioned}" example-dir="example-free"/>
    </target>

119
120
121
122
123
124
125
126
127
128
129
    <target name="concat-flowplayer.js">
        <concat destfile="${dist-dir}/flowplayer.js">
            <fileset dir="${src-js}/flowplayer.js" includes="flowplayer-src.js"/>

            <fileset dir="${src-js}"
                     includes="flashembed.js"/>
        </concat>
    </target>

    <target name="flowplayer.js" depends="concat-flowplayer.js">
        <ant antfile="js.xml" target="min">
130
131
132
            <property name="source.file" value="${basedir}/${dist-dir}/flowplayer.js" />
            <property name="target.file" value="${basedir}/${dist-dir}/flowplayer-${flowplayer-js-version-info}.js" />
            <property name="target.dir" value="${basedir}/dist"/>
133
134
135
136
            <property name="yui.path" value="lib/yuicompressor-2.4.2.jar"/>
        </ant>
    </target>

137
    <target name="deploy" if="deploy.dir" description="copies swf and js to deploy dirs" depends="jsplugins">
Anssi Piirainen's avatar
Anssi Piirainen committed
138
        <copy todir="${deploy.dir}" overwrite="true" verbose="true">
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
            <fileset dir="${build-dir}">
                <include name="*swf"/>
            </fileset>
        </copy>
        <iterate-plugins target="deploy" buildfiles="${jsplugins.buildfiles}" basedirectory="${jsplugins.dir}" />
    </target>

    <target name="build" description="builds the free version, and plugins listed in build.properties" depends="dobuild, deploy" />
    <target name="build-all" description="builds all" depends="dobuild-all, build-biz"/>

    <target name="build-biz" description="builds all" depends="check-uptodate, build-lib, plugins"
            unless="uptodate.commercial">
        <antcall target="prepare"/>
        <property name="licenselib" value="${lib-dir}/licensekey"/>
        <antcall target="compile-commercial"/>
        <example player-swf="${commercial-player-binary-versioned}" example-dir="example-biz"/>
    </target>


158
    <target name="zip-bundled" depends="flowplayer.js">
159
        <antcall target="prepare"/>
Anssi Piirainen's avatar
Anssi Piirainen committed
160
        <echo message="zip-bundled: using license lib ${bundled-license-lib}" />
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
        <compile-player binary="${bundled-basename}.swf" commercial="true" free="false"
                        license-lib="${bundled-license-lib}" debug="false"/>
        <copy file="${build-dir}/${bundled-basename}.swf"
              tofile="${build-dir}/${bundled-basename}-${version-info}.swf"/>
        <example player-swf="${bundled-basename}-${version-info}.swf" example-dir="examble-bundled"/>
        <zip-player license="LICENSE_UNLIMITED.txt" player-swf="${bundled-basename}-${version-info}.swf"
                    player-swf-dir="${build-dir}" zip-name="${bundled-basename}-${version-info}.zip"
                    example-dir="examble-bundled"/>
    </target>

    <target name="compile">
        <compile-player binary="${player-binary}" commercial="false" free="true" license-lib="${licenselib}"
                        debug="false"/>
        <copy file="${build-dir}/${player-binary}" tofile="${build-dir}/${player-binary-versioned}"/>
    </target>

    <target name="build-debug" description="builds the debug version of the player" depends="prepare">
        <property name="licenselib" value="${lib-dir}/licensekey"/>
        <compile-player binary="${debug-player-binary}" commercial="false" free="true" license-lib="${licenselib}"
                        debug="true"/>
        <compile-player binary="${commercial-debug-player-binary}" commercial="true" free="false"
                        license-lib="${licenselib}" debug="true"/>
    </target>

    <target name="compile-commercial">
        <compile-player binary="${commercial-player-binary}" debug="false" commercial="true" free="false"
                        license-lib="${licenselib}"/>
        <copy file="${build-dir}/${commercial-player-binary}"
              tofile="${build-dir}/${commercial-player-binary-versioned}"/>
    </target>

    <macrodef name="example">
        <attribute name="player-swf"/>
        <attribute name="example-dir"/>
        <sequential>
            <echo message="building example"/>
            <delete dir="${build-dir}/@{example-dir}"/>
            <copy todir="${build-dir}/@{example-dir}" overwrite="true">
                <fileset dir="../flash/core/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}"/>
                </filterset>
            </copy>
            <copy todir="${build-dir}/@{example-dir}">
                <fileset dir="../flash/core/example">
                    <include name="*.js"/>
                    <include name="*.html"/>
                    <include name="*.css"/>
                </fileset>
            </copy>
        </sequential>
    </macrodef>

    <macrodef name="compile-player">
219

220
221
222
223
224
225
226
        <attribute name="binary"/>
        <attribute name="commercial"/>
        <attribute name="free"/>
        <attribute name="license-lib"/>
        <attribute name="debug"/>
        <sequential>
            <echo message="Building binary @{binary}, mxmlc is ${mxmlc_bin}"/>
227
228
229

            <echo message="secondaries: ${secondary-domains}" />

230
231
232
233
234
235
236
237
238
239
240
241
242
243
            <exec executable="${mxmlc_bin}" failonerror="true">
                <arg line="-define=CONFIG::commercialVersion,'@{commercial}'"/>
                <arg line="-define+=CONFIG::freeVersion,'@{free}'"/>
                <arg line="-define+=CONFIG::version1,'${version-1}'"/>
                <arg line="-define+=CONFIG::version2,'${version-2}'"/>
                <arg line="-define+=CONFIG::version3,'${version-3}'"/>
                <arg line="-define+=CONFIG::versionStatus,${version-status-quoted}"/>
                <arg line="-define+=CONFIG::controlsVersion,${controls-version-info-quoted}"/>
                <arg line="-define+=CONFIG::audioVersion,${audio-version-info-quoted}"/>
                <arg line="-define+=CONFIG::skin,'true'"/>
                <arg line="-define+=CONFIG::hasSlowMotion,'${has-slowmotion-buttons}'"/>
                <arg line="-define+=CONFIG::debug,'@{debug}'"/>
                <arg line="-define+=CONFIG::enableByteRange,'false'"/>
                <arg line="-define+=CONFIG::FLASH_10_1,'${flash.use.10.1}'"/>
244
                <arg line="-define+=CONFIG::secondaryDomains,${secondary-domains-quoted}"/>
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
                <arg line="${compiler.defines}"/>
                <arg line="-keep-as3-metadata=Value,External"/>
                <arg line="-source-path ${src-as} ${src-as-commercial} ${classpath} ${plugin-libs}"/>
                <arg line="-static-link-runtime-shared-libraries=true" />
                <!--<arg  line="-link-report build/link-report.xml" />-->
                <arg line="-library-path ${libs-path} ${src-flash} @{license-lib}"/>

                <arg line="-default-frame-rate=${framerate}"/>
                <arg line="-default-background-color=${bgcolor}"/>
                <arg line="-strict=true"/>
                <arg line="-incremental=true"/>
                <arg line="-debug=@{debug}"/>

                <arg line="-frame 'player' org.flowplayer.view.Launcher"/>
                
                <arg line="-file-specs '${src-as}/org/flowplayer/view/Preloader.as'"/>
                <arg line="-output '${build-dir}/@{binary}'"/>

            </exec>
        </sequential>
    </macrodef>


268
    <target name="build-lib" description="builds the FlowPlayer library" >
269
270
271
272
273
274
275
        <antcall target="prepare"/>
        <antcall target="compile-lib"/>
        <copy file="${build-dir}/${library-binary}" tofile="${build-dir}/${library-binary-versioned}"/>
        <copy file="${build-dir}/${library-binary}" todir="${devkit-dir}"/>
    </target>

    <target name="compile-lib">
276
277
        <echo message="running ${compc_bin} with classpath ${classpath}, using manifest ${manifest}" />

278
279
280
281
        <exec executable="${compc_bin}" failonerror="true">
            <arg line="-source-path ${src-as} ${src-as-commercial} ${classpath}"/>
            <arg line="-compute-digest=false"/>
            <arg line="-output '${build-dir}/${library-binary}'"/>
282
            <arg line="-namespace http://flowplayer.org/flowplayer/2008 ${basedir}/${manifest} -include-namespaces http://flowplayer.org/flowplayer/2008"/>
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
            <arg line="-library-path ${libs-path} ${src-flash} "/>
            <arg line="-default-frame-rate=${framerate}"/>
            <arg line="-default-background-color=${bgcolor}"/>
            <arg line="-strict=true"/>
            <arg line="-incremental=true"/>
			<arg line="-define+=CONFIG::debug,'false'"/>
            <arg line="-define+=CONFIG::FLASH_10_1,'${flash.use.10.1}'"/>

        </exec>
    </target>

    <target name="copyhtml" description="copies html and javascript to the build folder">
        <copy todir="${build-dir}">
            <fileset dir="${src-html}">
                <include name="*.html"/>
            </fileset>
            <fileset dir="${src-js}">
                <include name="*.js"/>
            </fileset>
        </copy>
    </target>

    <target name="test" description="build testrunner">
        <exec executable="${mxmlc_bin}" failonerror="true">
            <arg line="-source-path ${src-as} ${src-test} ${classpath} -library-path ${libs-path} ${lib-dir}/flexunit -default-frame-rate=${framerate} -default-background-color=${bgcolor} -strict=true '${src-test}/org/flowplayer/css/CssTest.as' -output '${build-dir}/Test.swf'"/>
        </exec>
    </target>

    <target name="prepare">
        <mkdir dir="${build-dir}/example"/>
        <mkdir dir="${dist-dir}"/>
    </target>

    <target name="check-uptodate">
        <uptodate property="uptodate.main" targetfile="${build-dir}/${player-binary}">
            <srcfiles dir="${src-as}">
                <include name="**/*.as"/>
            </srcfiles>
            <srcfiles dir="${src-as-commercial}">
                <include name="**/*.as"/>
            </srcfiles>
            <srcfiles dir="${src-as-builtin}">
                <include name="**/*.as"/>
            </srcfiles>
            <srcfiles dir="${basedir}">
                <include name="*.xml"/>
                <include name="*.properties"/>
                <include name="*.txt"/>
                <include name="*.as"/>
            </srcfiles>
            <srcfiles dir="${lib-dir}">
                <include name="**/*.as"/>
                <include name="**/*.swc"/>
            </srcfiles>
        </uptodate>
        <echo message="main up-to-date: ${uptodate.main}"/>

        <uptodate property="uptodate.commercial" targetfile="${build-dir}/${commercial-player-binary}">
            <srcfiles dir="${src-as}">
                <include name="**/*.as"/>
            </srcfiles>
            <srcfiles dir="${src-as-commercial}">
                <include name="**/*.as"/>
            </srcfiles>
            <srcfiles dir="${src-as-builtin}">
                <include name="**/*.as"/>
            </srcfiles>
            <srcfiles dir="${basedir}">
                <include name="*.xml"/>
                <include name="*.properties"/>
                <include name="*.txt"/>
            </srcfiles>
            <srcfiles dir="${lib-dir}">
                <include name="**/*.as"/>
                <include name="**/*.swc"/>
            </srcfiles>
        </uptodate>
        <echo message="main up-to-date: ${uptodate.commercial}"/>

        <uptodate property="uptodate.lib" targetfile="${build-dir}/${library-binary}">
            <srcfiles dir="${src-as}">
                <include name="**/*.as"/>
            </srcfiles>
            <srcfiles dir="${src-as-commercial}">
                <include name="**/*.as"/>
            </srcfiles>
        </uptodate>
        <echo message="lib up-to-date: ${uptodate.lib}"/>
    </target>

    <target name="plugins" description="Build all plugins">
        <iterate-plugins target="deploy"/>
        <iterate-plugins target="min" buildfiles="${jsplugins.buildfiles}" basedirectory="${jsplugins.dir}"/>
    </target>

    <target name="plugins-all" description="Build all plugins">
        <iterate-plugins target="deploy" buildfiles="${allplugins.buildfiles}"/>
        <iterate-plugins target="min" buildfiles="${alljsplugins.buildfiles}" basedirectory="${jsplugins.dir}"/>
    </target>

    <target name="plugin-names" description="Echoes all plugin names">
        <iterate-plugins target="echo-name"/>
    </target>

    <target name="clean-plugins" description="Cleans all plugins">
        <iterate-plugins target="clean"/>
    </target>

    <macrodef name="iterate-plugins">
        <attribute name="target"/>
        <attribute name="buildfiles" default="${plugin.buildfiles}"/>
        <attribute name="basedirectory" default="${plugins.dir}"/>
        <sequential>
            <echo message="plugin buildfiles @{buildfiles}" />
            <subant target="@{target}">
                <fileset dir="@{basedirectory}" includes="@{buildfiles}"/>
                <property name="remotedir" value="${remotedir}"/>
                <property name="all-swf-zip" value="${basedir}/dist/latest.zip"/>
                <property name="swfremotedir" value="${swfremotedir}"/>
                <property name="aws-accessId" value="${aws-accessId}"/>
                <property name="aws-secretKey" value="${aws-secretKey}"/>
                <property name="keyfile" value="${keyfile}"/>
                <property name="url-file" value="${url-file}"/>
                <property name="yaml-file" value="${yaml-file}"/>
                <property name="dist-file" value="${dist-file}" />
                <property name="devkit-dir" value="../${devkit-dir}"/>
                <property name="js.deploy.dir" value="${js.deploy.dir}"/>
                <property name="mxmlc-bin" value="${mxmlc-bin}" />
411
                <property name="secondary-domains-quoted" value="${secondary-domains-quoted}" />
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
            </subant>
        </sequential>
    </macrodef>

    <target name="release-plugin" description="releases one plugin, specify the plugin name with -Dplugin=">
        <ant antfile="build.xml" target="release-remote" dir="../plugins/${plugin}">
            <property name="remotedir" value="${remotedir}"/>
            <property name="all-swf-zip" value="${basedir}/dist/latest.zip"/>
            <property name="swfremotedir" value="${swfremotedir}"/>
            <property name="aws-accessId" value="${aws-accessId}"/>
            <property name="aws-secretKey" value="${aws-secretKey}"/>
            <property name="url-file" value="${url-file}"/>
            <property name="keyfile" value="${keyfile}"/>
            <property name="devkit-dir" value="../${devkit-dir}"/>
        </ant>
    </target>


    <target name="release-js-plugin" description="releases one JS plugin, specify the plugin name with -Dplugin=">
        <ant antfile="build.xml" target="release-remote" dir="${jsplugins.dir}/${plugin}">
            <property name="devkit-dir" value="../${devkit-dir}"/>
        </ant>
    </target>

    <target name="doc" description="generates the apidocs">
        <!--<exec executable="${asdoc_bin}" failonerror="true">-->
            <!--<arg line="-source-path ${src-as} ${classpath}"/>-->
            <!--<arg line="-library-path ${libs-path} ${src-flash}"/>-->
            <!--<arg line="-doc-classes ${doc-classes}"/>-->
            <!--<arg line="-exclude-dependencies"/>-->
            <!--<arg line="-output ${apidoc-dir}"/>-->
            <!--<arg line="-main-title 'FlowPlayer ${version-1}.${version-2}.${version-3} API documentation'"/>-->
            <!--<arg line="-window-title 'FlowPlayer ${version-1}.${version-2}.${version-3} API documentation'"/>-->
            <!--<arg line="-define+=CONFIG::debug,'false'"/>-->
        <!--</exec>-->
    </target>

    <target name="zip" description="creates a distribution zip package">
        <zip-player zip-name="${dist-name}" player-swf-dir="${build-dir}" player-swf="${player-binary-versioned}"
                    license="LICENSE.txt" example-dir="example-free"/>
        <copy file="${dist-dir}/${dist-name}" tofile="${dist-dir}/flowplayer.zip" />
        <copy file="${dist-dir}/${dist-name}" tofile="${dist-dir}/${dist-target-name}" />
        <copy file="${build-dir}/${player-binary}" todir="${dist-dir}" />
        <copy file="${build-dir}/${player-binary-versioned}" todir="${dist-dir}" />
    </target>

    <target name="zip-biz" description="creates a Commercial distribution zip package">
        <zip-player zip-name="${commercial-dist-name}" player-swf-dir="${build-dir}"
                    player-swf="${commercial-player-binary-versioned}" license="LICENSE_COMMERCIAL.txt"
                    example-dir="example-biz"/>
        <copy file="${dist-dir}/${commercial-dist-name}" tofile="${dist-dir}/flowplayer.commercial.zip" />
        <copy file="${dist-dir}/${commercial-dist-name}" tofile="${dist-dir}/${commercial-dist-target-name}" />
        <copy file="${build-dir}/${commercial-player-binary}" todir="${dist-dir}" />
        <copy file="${build-dir}/${commercial-player-binary-versioned}" todir="${dist-dir}" />

        <zip-player zip-name="${multidomain-dist-name}" player-swf-dir="${build-dir}"
                    player-swf="${commercial-player-binary-versioned}" license="LICENSE_MULTIDOMAIN.txt"
                    example-dir="example-biz"/>

        <copy file="${dist-dir}/${multidomain-dist-name}" tofile="${dist-dir}/${multidomain-dist-target-name}" />
    </target>

    <macrodef name="zip-player">
        <attribute name="zip-name"/>
        <attribute name="player-swf"/>
        <attribute name="player-swf-dir"/>
        <attribute name="license"/>
        <attribute name="example-dir"/>
        <sequential>
            <echo message="++ Zipping @{zip-name} +++"></echo>

            <zip destfile="${dist-dir}/@{zip-name}" update="false">
                <zipfileset prefix="flowplayer" dir="../flash/core">
                    <include name="@{license}"/>
                    <!--<include name="flowplayer-${flowplayer-js-version-info}.min.js" />-->
                    <include name="README.txt"/>
                </zipfileset>
489
                <zipfileset prefix="flowplayer" dir="${basedir}/${dist-dir}">
490
491
492
493
494
                    <include name="flowplayer-${flowplayer-js-version-info}.min.js"/>
                </zipfileset>
                <zipfileset prefix="flowplayer" dir="@{player-swf-dir}">
                    <include name="@{player-swf}"/>
                </zipfileset>
495
                <zipfileset prefix="flowplayer" dir="${basedir}/${dist-dir}">
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
                    <include name="flowplayer.controls-${controls-version-info}.swf"/>
                </zipfileset>
                <zipfileset prefix="flowplayer/example" dir="${build-dir}/@{example-dir}">
                    <include name="*"/>
                    <exclude name="index.html.tmpl"/>
                </zipfileset>
            </zip>
            <verify-zip zip-name="@{zip-name}" player-swf="@{player-swf}" license="@{license}"/>
        </sequential>
    </macrodef>

    <target name="source-dist" description="prepares the source distribution package">
        <zip zipfile="${dist-dir}/${source-dist-name}">
            <zipfileset prefix="${source-dist-root-folder}" dir="../flash/core"
                        includes="${src-as}/**/*.as, ${src-as-commercial}/**/*.as, ${src-as-builtin}/**/*.as, ${src-flash}/**/*"/>
            <zipfileset prefix="${source-dist-root-folder}" dir="../flash/core" includes="example/**/*"/>
            <zipfileset prefix="${source-dist-root-folder}" dir="../flash/core" includes="lib/**/*"/>
            <zipfileset prefix="${source-dist-root-folder}" dir="../flash/core">
                <include name="LICENSE*.txt"/>
                <include name="README.txt"/>
                <include name="build.xml"/>
                <include name="manifest.xml"/>
                <include name="build.properties"/>
            </zipfileset>
        </zip>
        <copy file="${dist-dir}/${source-dist-name}" tofile="${dist-dir}/flowplayer-src.zip" />
    </target>

    <macrodef name="verify-zip">
        <attribute name="zip-name"/>
        <attribute name="player-swf"/>
        <attribute name="license"/>
        <sequential>
            <echo message="verifying @{zip-name} contents"/>
            <delete dir="${dist-dir}/flowplayer"/>
            <unzip src="${dist-dir}/@{zip-name}" dest="${dist-dir}"/>
            <condition property="${resources-available}" value="true">
                <and>
                    <available file="${dist-dir}/flowplayer/@{player-swf}"/>
                    <available file="${dist-dir}/flowplayer/flowplayer.controls-${controls-version-info}.swf"/>
                    <available file="${dist-dir}/flowplayer/@{license}"/>
                    <available file="${dist-dir}/flowplayer/README.txt"/>
                    <available file="${dist-dir}/flowplayer/example/index.html"/>
                    <available file="${dist-dir}/flowplayer/example/style.css"/>
                    <available file="${dist-dir}/flowplayer/flowplayer-${flowplayer-js-version-info}.min.js"/>
                </and>
            </condition>
            <fail unless="${resources-available}" message="Not all required resources present in @{zip-name}"/>
        </sequential>
    </macrodef>

    <target name="zip-devkit" depends="doc, build-lib">
        <zip destfile="${dist-dir}/${devkit-dist-name}">
            <zipfileset prefix="flowplayer.devkit" dir="${devkit-dir}">
                <include name="LICENSE.txt"/>
                <include name="README.txt"/>
                <include name="*.properties"/>
                <include name="*.xml"/>
            </zipfileset>
            <zipfileset prefix="flowplayer.devkit" dir="${build-dir}">
                <include name="${library-binary}"/>
            </zipfileset>
            <zipfileset prefix="flowplayer.devkit/example" dir="${devkit-dir}/example">
                <include name="*.xml"/>
                <include name="*.fla"/>
                <include name="*.properties"/>
                <include name="src/**/*"/>
            </zipfileset>
            <!--<zipfileset prefix="flowplayer.devkit/doc" dir="${apidoc-dir}">-->
                <!--<include name="**/*"/>-->
            <!--</zipfileset>-->
        </zip>
    </target>

570
571
    <target name="dist" description="Create distribution packages" depends="build-all">
        <iterate-plugins target="dist" buildfiles="${allplugins.buildfiles}"/>
572
573
574
575
        <ant target="zip"/>
        <ant target="zip-biz"/>
        <ant target="zip-devkit"/>
        <ant target="source-dist"/>
576
        <!--<copy file="${src-js}/flowplayer.js/flowplayer-${flowplayer-js-version-info}.min.js" todir="${dist-dir}" />-->
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
    </target>

    <target name="all-dist" description="Create distribution packages for all plugins">
        <iterate-plugins target="dist" buildfiles="${allplugins.buildfiles}" />
        <ant target="zip"/>
        <ant target="zip-biz"/>
        <ant target="zip-devkit"/>
        <ant target="source-dist"/>
    </target>

    <!-- following is used when building from a webapp in our compile farm -->
    <target name="copy" if="copy-source">
        <copy file="${copy-source}" tofile="${copy-target}" verbose="true"/>
    </target>

    <target name="quick" description="builds the player quickly" depends="prepare">
        <property name="licenselib" value="${lib-dir}/licensekey"/>
        <antcall target="compile"/>
    </target>

    <target name="quick-biz" description="builds the player quickly" depends="prepare">
        <property name="licenselib" value="${lib-dir}/licensekey"/>
        <antcall target="compile-commercial"/>
    </target>

    <target name="echo-version" description="echos the flowpalyer version number">
        <echo message="version-1: ${version-1}"/>
        <echo message="version-2: ${version-2}"/>
        <echo message="version-3: ${version-3}"/>
        <echo message="version-status: ${version-status}"/>
    </target>

    <target name="jsplugins">
        <iterate-plugins target="min" buildfiles="${jsplugins.buildfiles}" basedirectory="${jsplugins.dir}"/>
    </target>

	<target name="debug-js">
		 <get src="http://flowplayer.org/js/tools/tools.flashembed-1.0.4.js" dest="${dist-dir}/flowplayer-debug.js"/>
		
		<concat destfile="${dist-dir}/flowplayer-debug.js" append="true">

			<fileset dir="${src-js}/flowplayer.js" includes="flowplayer-src.js"/>
		</concat>
	</target>

</project>