Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r227]: trunk / build.xml Maximize Restore History

Download this file

build.xml    285 lines (255 with data), 11.0 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="StrobeMediaPlayback" default="all" basedir=".">
<property environment="env"/>
<!-- load external values -->
<property file="${basedir}/build.properties" />
<taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
<taskdef resource="flexUnitTasks.tasks" classpath="${buildtools.dir}/libs/flexUnitTasks-4.0.0.jar"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildtools.dir}/libs/ant-contrib-1.0b3.jar"/>
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${reports.dir}" />
</target>
<!-- cleans the output directory -->
<target name="clean.bin">
<sequential>
<delete includeemptydirs="true" quiet="true">
<fileset dir="${source.dir}" includes="**/bin/**/*" />
</delete>
<delete includeemptydirs="true" quiet="true">
<fileset dir="${source.dir}" includes="**/bin" />
</delete>
</sequential>
</target>
<target name="clean">
<antcall target="clean.bin"/>
<sequential>
<delete includeemptydirs="true" quiet="true">
<fileset dir="${dist.dir}" />
</delete>
<delete includeemptydirs="true" quiet="true">
<fileset dir="${build.dir}" />
</delete>
</sequential>
</target>
<!-- main -->
<target name="all">
<antcall target="clean"/>
<antcall target="build"/>
<antcall target="dist"/>
<antcall target="source"/>
</target>
<target name="build">
<antcall target="init"/>
<antcall target="clean.bin"/>
<antcall target="compile.osmf"/>
<antcall target="compile.strobe"/>
<antcall target="compile.unittest"/>
<antcall target="compile.plugins"/>
<antcall target="run.unittest"/>
</target>
<target name="dist">
<copy todir="${dist.dir}" overwrite="true" failonerror="false">
<fileset dir="${source.dir}/player/StrobeMediaPlayback/bin"/>
</copy>
<copy todir="${dist.dir}" overwrite="true" failonerror="false">
<fileset dir="${source.dir}/plugins/YouTubePlugin/bin"/>
</copy>
<zip destfile="${dist.dir}/StrobeMediaPlayback_for_Flash_Player_${flash.target.player.base}.zip" >
<zipfileset dir="${source.dir}/player/StrobeMediaPlayback/bin" excludes="10.0/**, *.zip, history/**, Flash*.*, MediaPlayback**, dist/**, *Test/**, *.xml, Configuration*, *.swz, NetMocker.*"/>
</zip>
</target>
<target name="source">
<zip destfile="${source.dir}/../StrobeMediaPlayback_source_code.zip" >
<zipfileset dir="${source.dir}" prefix="StrobeMediaPlayback" excludes="preloader/**, plugins/Youtube*/**, dist/**, build/**, **/bin/**"/>
</zip>
<move file="${source.dir}/../StrobeMediaPlayback_source_code.zip" todir="${dist.dir}" overwrite="true" failonerror="false"/>
</target>
<!-- compile OSMF -->
<target name="compile.osmf">
<component.compile project="OSMF" projectDir="${source.dir}/framework/OSMF"/>
</target>
<target name="compile.NetMocker">
<replace file="${source.dir}/libs/testing/NetMocker/netmocker-build-config.xml">
<replacetoken><![CDATA[../../../build/lib/OSMF.swc]]></replacetoken>
<replacevalue><![CDATA[../../../framework/OSMF/bin/OSMF.swc]]></replacevalue>
</replace>
<component.compile project="NetMocker" projectDir="${source.dir}/libs/testing/NetMocker"/>
</target>
<!-- compile player -->
<target name="compile.strobe">
<application.compile project="StrobeMediaPlayback" projectDir="${source.dir}/player/StrobeMediaPlayback" />
</target>
<!-- compile unit tests -->
<target name="compile.unittest">
<antcall target="compile.NetMocker"/>
<unittest.compile project="StrobeMediaPlaybackTest" projectDir="${source.dir}/player/StrobeMediaPlaybackTest" />
</target>
<!-- compile plugins -->
<target name="compile.plugins">
<antcall target="compile.YouTubePlugin"/>
</target>
<target name="compile.YouTubePlugin">
<plugin.compile project="YouTubePlugin" projectDir="${source.dir}/plugins/YouTubePlugin"/>
</target>
<!-- prepare and run unit tests -->
<target name="run.unittest">
<unittest.run project="StrobeMediaPlaybackTest" projectDir="${source.dir}/player/StrobeMediaPlaybackTest"/>
</target>
<!-- Define a task for generating the class list for compc from the
appropriate .flexLibProperties file -->
<macrodef name="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 building a component project. -->
<macrodef name="component.compile">
<attribute name="project"/>
<attribute name="projectDir"/>
<sequential>
<generateClassList project="@{project}" projectDir="@{projectDir}"/>
<compc output="@{projectDir}/bin/@{project}.swc"
include-classes="${@{project}.classes}"
optimize="true"
debug="false"
fork="false"
target-player="${flash.target.player}">
<define name="CONFIG::FLASH_10_1" value="${flash.use.10.1}" />
<define name="CONFIG::LOGGING" value="${logging}" />
<warnings>true</warnings>
<load-config filename="@{projectDir}/@{project}-build-config.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>
</compc>
</sequential>
</macrodef>
<!-- Define a task for compiling an application project. -->
<macrodef name="application.compile">
<attribute name="project"/>
<attribute name="projectDir"/>
<sequential>
<mxmlc output="@{projectDir}/bin/@{project}.swf"
file="@{projectDir}/src/@{project}.as"
optimize="true"
debug="${logging}"
fork="false"
target-player="${flash.target.player}">
<load-config filename="@{projectDir}/@{project}-build-config.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}" />
</mxmlc>
<copy todir="@{projectDir}/bin" overwrite="true" failonerror="false">
<fileset dir="@{projectDir}/html-template"/>
</copy>
<move file="@{projectDir}/bin/index.template.html" tofile="@{projectDir}/bin/@{project}.html" overwrite="true" failonerror="false"/>
</sequential>
</macrodef>
<!-- Define a task for compiling a plugin project. -->
<macrodef name="plugin.compile">
<attribute name="project"/>
<attribute name="projectDir"/>
<sequential>
<mxmlc output="@{projectDir}/bin/@{project}.swf"
file="@{projectDir}/src/@{project}.as"
optimize="true"
debug="${logging}"
fork="false"
target-player="${flash.target.player}">
<load-config filename="@{projectDir}/@{project}-build-config.xml"/>
<compiler.library-path dir="${build.dir}" append="true">
<include name="*.swc" />
</compiler.library-path>
<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}" />
</mxmlc>
</sequential>
</macrodef>
<!-- Define a task for compiling a unit test project. -->
<macrodef name="unittest.compile">
<attribute name="project"/>
<attribute name="projectDir"/>
<sequential>
<mkdir dir="${build.dir}/@{project}"/>
<mxmlc output="@{projectDir}/bin/@{project}.swf"
file="@{projectDir}/src/@{project}.mxml" keep-generated-actionscript="true"
debug="${logging}"
fork="false"
target-player="${flash.target.player}">
<load-config filename="@{projectDir}/@{project}-build-config.xml"/>
<!-- List of SWC files or directories that contain SWC files. -->
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="libs/air" />
<include name="*.swc" />
</compiler.library-path>
<compiler.library-path dir="${FLEX_UNIT_HOME}" append="true">
<include name="libs/version4libs/Common/*.swc" />
<include name="libs/version4libs/FlexProject/*.swc" />
<include name="locale/version4locale/*.swc" />
<include name="*.swc"/>
</compiler.library-path>
<compiler.library-path dir="${buildtools.dir}/libs" append="true">
<include name="*.swc"/>
</compiler.library-path>
<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="false" />
<compiler.verbose-stacktraces>false</compiler.verbose-stacktraces>
<compiler.headless-server>true</compiler.headless-server>
</mxmlc>
</sequential>
</macrodef>
<!-- Define a task for running an unit test -->
<macrodef name="unittest.run">
<attribute name="project"/>
<attribute name="projectDir"/>
<sequential>
<mkdir dir="${reports.dir}/@{project}"/>
<flexunit player="air" headless="false" localTrusted="true"
swf="@{projectDir}/bin/@{project}.swf"
toDir="${reports.dir}/@{project}"
haltonfailure="false"
verbose="false"
failureproperty="flexunit.failed"
timeout = "120000"
/>
<!--junitreport todir="${reports.dir}/@{project}">
<fileset dir="${reports.dir}/@{project}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dist.dir}/test-reports/@{project}"/>
</junitreport-->
<!-- antcall target="unittest.reports">
</antcall -->
<junitreport todir="${reports.dir}/@{project}">
<fileset dir="${reports.dir}/@{project}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${dist.dir}/test-reports/@{project}"/>
</junitreport>
<fail message="One or more flexunit tests failed. See test reports for details." if="flexunit.failed" />
</sequential>
</macrodef>
<target name="unittest.reports" if="flexunit.failed">
</target>
</project>