Menu

[r2333]: / osmf / trunk / buildtools / utils.xml  Maximize  Restore  History

Download this file

355 lines (302 with data), 13.3 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
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
<project name="macroDefinitions">
<!-- properties -->
<!-- Set output directory -->
<condition property="output.bin" value="bin">
<equals arg1="${debug}" arg2="false"/>
</condition>
<condition property="output.bin" value="bin-debug">
<equals arg1="${debug}" arg2="true"/>
</condition>
<property name="osmf.swc.path" value="${source.dir}/framework/osmf/${output.bin}/OSMF.swc" />
<property name="smp.swf.path" value="${source.dir}/player/StrobeMediaPlayer/${output.bin}/StrobeMediaPlayer.swf" />
<!-- Define a task for changing tokens in -build-config.xml -->
<macrodef name="OSMF.set.path">
<attribute name="project" />
<attribute name="projectDir" />
<sequential>
<!-- Copy the .-build-config.xml file to a temporary file *-build-congif.tmp.xml and replace the tokens with specified paths -->
<copy file="@{projectDir}/@{project}-build-config.xml" tofile="@{projectDir}/@{project}-build-config.tmp.xml" force="true">
<filterchain>
<replacetokens begintoken="#" endtoken="#">
<token key="osmf.swc.path" value="${osmf.swc.path}"/>
<token key="smp.swf.path" value="${smp.swf.path}"/>
<token key="output.bin" value="${output.bin}"/>
</replacetokens>
</filterchain>
</copy>
</sequential>
</macrodef>
<!-- Define a task for compiling an application project. -->
<macrodef name="OSMF.application.compile">
<attribute name="project" />
<attribute name="projectDir" />
<attribute name="srcDir" default="/src" />
<attribute name="width" default="800" />
<attribute name="height" default="600" />
<sequential>
<OSMF.set.path project="@{project}" projectDir="@{projectDir}" />
<mxmlc
output="@{projectDir}/${output.bin}/@{project}.swf"
file="@{projectDir}@{srcDir}/@{project}.as"
optimize="true"
debug="${debug}"
fork="false"
target-player="${flash.target.player}"
swf-version="${swfversion}"
static-link-runtime-shared-libraries="true"
static-rsls="false"
>
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<define name="CONFIG::PLATFORM" value="${platform}" />
<define name="CONFIG::MOCK" value="${mock}" />
<load-config filename="@{projectDir}/@{project}-build-config.tmp.xml" />
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/${flash.target.player.base}" append="true">
<include name="playerglobal.swc" />
</compiler.external-library-path>
</mxmlc>
<copy todir="@{projectDir}/${output.bin}" overwrite="true" failonerror="false">
<fileset dir="@{projectDir}/html-template" />
</copy>
<move file="@{projectDir}/${output.bin}/index.template.html" tofile="@{projectDir}/${output.bin}/@{project}.html" overwrite="true" failonerror="false" />
<html-wrapper
title="@{project}"
file="@{project}.html"
swf="@{project}"
output="@{projectDir}/${output.bin}"
width="@{width}"
height="@{height}"
/>
<delete quiet="true" file="@{projectDir}/@{project}-build-config.tmp.xml" />
</sequential>
</macrodef>
<!-- Define a task for building a component project. -->
<macrodef name="OSMF.component.compile">
<attribute name="project" />
<attribute name="projectDir" />
<sequential>
<OSMF.generateClassList project="@{project}" projectDir="@{projectDir}" />
<OSMF.set.path project="@{project}" projectDir="@{projectDir}" />
<compc
output="@{projectDir}/${output.bin}/@{project}.swc"
include-classes="${@{project}.classes}"
optimize="true"
debug="${debug}"
fork="false"
target-player="${flash.target.player}"
>
<define name="CONFIG::useFlexClasses" value="true" />
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<define name="CONFIG::PLATFORM" value="${platform}" />
<define name="CONFIG::MOCK" value="${mock}" />
<load-config filename="@{projectDir}/@{project}-build-config.tmp.xml" />
<warnings>true</warnings>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/${flash.target.player.base}" append="true">
<include name="playerglobal.swc" />
</compiler.external-library-path>
</compc>
<delete quiet="true" file="@{projectDir}/@{project}-build-config.tmp.xml"/>
</sequential>
</macrodef>
<!-- Define a task for generating the class list for compc from the appropriate .flexLibProperties file -->
<macrodef name="OSMF.generateClassList">
<attribute name="project" />
<attribute name="projectDir" />
<sequential>
<xmlproperty
file="@{projectDir}/.flexLibProperties"
prefix="@{project}"
keepRoot="false"
collapseAttributes="true"
/>
<propertyregex
property="@{project}.classes"
input="${@{project}.includeClasses.classEntry.path}"
regexp=","
replace=" "
/>
</sequential>
</macrodef>
<!-- Define a task for compiling a unit test project. -->
<macrodef name="OSMF.mxml.compile">
<attribute name="project" />
<attribute name="projectDir" />
<attribute name="srcDir" default="/src" />
<attribute name="width" default="800" />
<attribute name="height" default="600" />
<sequential>
<OSMF.set.path project="@{project}" projectDir="@{projectDir}" />
<mxmlc
output="@{projectDir}/${output.bin}/@{project}.swf"
file="@{projectDir}@{srcDir}/@{project}.mxml" keep-generated-actionscript="false"
debug="${debug}"
fork="false"
target-player="${flash.target.player}"
swf-version="${swfversion}"
static-link-runtime-shared-libraries="true"
static-rsls="false"
>
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<define name="CONFIG::PLATFORM" value="${platform}" />
<define name="CONFIG::MOCK" value="${mock}" />
<load-config filename="@{projectDir}/@{project}-build-config.tmp.xml" />
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/${flash.target.player.base}" append="true">
<include name="playerglobal.swc" />
</compiler.external-library-path>
</mxmlc>
<html-wrapper
title="@{project}"
file="@{project}.html"
swf="@{project}"
output="@{projectDir}/${output.bin}"
width="@{width}"
height="@{height}"
/>
<delete quiet="true" file="@{projectDir}/@{project}-build-config.tmp.xml" />
</sequential>
</macrodef>
<!-- Define a task for compiling a plugin project. -->
<macrodef name="OSMF.plugin.compile">
<attribute name="project" />
<attribute name="projectDir" />
<attribute name="srcDir" default="/src" />
<sequential>
<OSMF.set.path project="@{project}" projectDir="@{projectDir}" />
<mxmlc
output="@{projectDir}/${output.bin}/@{project}.swf"
file="@{projectDir}@{srcDir}/@{project}.as"
optimize="true"
debug="${debug}"
fork="false"
target-player="${flash.target.player}"
swf-version="${swfversion}"
static-link-runtime-shared-libraries="true"
>
<load-config filename="@{projectDir}/@{project}-build-config.tmp.xml" />
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/${flash.target.player.base}" append="true">
<include name="playerglobal.swc" />
</compiler.external-library-path>
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<define name="CONFIG::PLATFORM" value="${platform}" />
<define name="CONFIG::MOCK" value="${mock}" />
</mxmlc>
<delete quiet="true" file="@{projectDir}/@{project}-build-config.tmp.xml" />
</sequential>
</macrodef>
<!-- Define a task for compiling smp project. -->
<macrodef name="OSMF.smp.compile">
<attribute name="project" />
<attribute name="projectDir" />
<attribute name="srcDir" default="/src" />
<attribute name="width" default="800" />
<attribute name="height" default="600" />
<sequential>
<OSMF.set.path project="@{project}" projectDir="@{projectDir}" />
<mxmlc
output="@{projectDir}/${output.bin}/@{project}.swf"
file="@{projectDir}@{srcDir}/@{project}.as"
optimize="true"
debug="${debug}"
fork="false"
target-player="${flash.target.player}"
swf-version="${swfversion}"
static-link-runtime-shared-libraries="true"
static-rsls="false"
>
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<define name="CONFIG::PLATFORM" value="${platform}" />
<define name="CONFIG::MOCK" value="${mock}" />
<load-config filename="@{projectDir}/@{project}-build-config.tmp.xml" />
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/${flash.target.player.base}" append="true">
<include name="playerglobal.swc" />
</compiler.external-library-path>
</mxmlc>
<copy todir="@{projectDir}/${output.bin}" overwrite="true" failonerror="false">
<fileset dir="@{projectDir}/html-template" />
</copy>
<move file="@{projectDir}/${output.bin}/index.template.html" tofile="@{projectDir}/${output.bin}/@{project}.html" overwrite="true" failonerror="false" />
<delete quiet="true" file="@{projectDir}/@{project}-build-config.tmp.xml" />
</sequential>
</macrodef>
<!-- Define a task for compiling a unit test project. -->
<macrodef name="OSMF.unittest.compile">
<attribute name="project" />
<attribute name="projectDir" />
<attribute name="srcDir" default="/src" />
<sequential>
<OSMF.set.path project="@{project}" projectDir="@{projectDir}" />
<mxmlc
output="@{projectDir}/${output.bin}/@{project}.swf"
file="@{projectDir}@{srcDir}/@{project}.mxml" keep-generated-actionscript="false"
debug="${debug}"
fork="false"
target-player="${flash.target.player}"
>
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<define name="CONFIG::PLATFORM" value="${platform}" />
<define name="CONFIG::MOCK" value="${mock}" />
<!-- List of SWC files or directories that contain SWC files. -->
<compiler.library-path dir="${FLEX_UNIT_HOME}/" append="true">
<include name="flexunit-aircilistener-4.1.0-8-4.1.0.16076.swc" />
<include name="flexunit-cilistener-4.1.0-8-4.1.0.16076.swc" />
<include name="turnkey/libs/hamcrest-as3-flex-1.1.3.swc" />
<include name="turnkey/libs/flexunit-4.1.0-8-flex_4.1.0.16076.swc" />
</compiler.library-path>
<load-config filename="@{projectDir}/@{project}-build-config.tmp.xml" />
<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/player/${flash.target.player.base}" append="true">
<include name="playerglobal.swc" />
</compiler.external-library-path>
<compiler.verbose-stacktraces>false</compiler.verbose-stacktraces>
<compiler.headless-server>true</compiler.headless-server>
</mxmlc>
<delete quiet="true" file="@{projectDir}/@{project}-build-config.tmp.xml" />
</sequential>
</macrodef>
<!-- Define a task for running an unit test -->
<macrodef name="OSMF.unittest.run">
<attribute name="project" />
<attribute name="projectDir" />
<attribute name="flexUnitPlayer" default="air" />
<sequential>
<mkdir dir="${reports.dir}/@{project}/xml-format" />
<flexunit
player="@{flexUnitPlayer}" headless="false" localTrusted="true"
swf="@{projectDir}/${output.bin}/@{project}.swf"
toDir="${reports.dir}/@{project}/xml-format"
haltonfailure="false"
verbose="false"
failureproperty="flexunit.failed"
timeout = "120000"
/>
<junitreport todir="${reports.dir}/@{project}/xml-format">
<fileset dir="${reports.dir}/@{project}/xml-format">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${reports.dir}/@{project}" />
</junitreport>
<!--<fail message="One or more flexunit tests failed. See test reports for details." if="flexunit.failed" -->
</sequential>
</macrodef>
<macrodef name="OSMF.component.doc">
<attribute name="project" />
<attribute name="projectDir" />
<attribute name="srcDir" default="/org" />
<sequential>
<OSMF.generateClassList project="@{project}" projectDir="@{projectDir}" />
<asdoc output="${dist.dir}/@{project}" lenient="true" failonerror="true">
<load-config filename="@{projectDir}/@{project}-build-config.xml" />
<define name="CONFIG::useFlexClasses" value="true" />
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<define name="CONFIG::PLATFORM" value="${platform}" />
<define name="CONFIG::MOCK" value="${mock}" />
<doc-sources path-element="@{projectDir}@{srcDir}" />
</asdoc>
</sequential>
</macrodef>
</project>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.