forked from fljot/GestouchExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
302 lines (261 loc) · 9.49 KB
/
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
<?xml version="1.0" encoding="utf-8"?>
<project name="GestouchExamples" default="usage" basedir=".">
<!-- Load properties -->
<property file="build.properties" />
<property file="version.properties" />
<!-- Additional tasks -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${build.dir}/libs/ant-contrib-1.0b3.jar" />
<!-- Visible targets -->
<target name="usage">
<echo>Usage:
- Use debug.air task to compile and run example application on desktop.
- Use debug.apk task to compile & run (debug) on Android device.
- Use package.ipa task to compile for iOS device.
</echo>
</target>
<target name="debug.air" description="">
<var name="example.name" value="GestouchExamples"/>
<compile.debug input="${project.examplesPackage.dir}/${example.name}.mxml"
output="${example.name}.swf"
compilerArguments=""
/>
<copy file="${build.dir}/air/descriptor-template-app.xml" tofile="${bindebug.dir}/${example.name}-app.xml" overwrite="true">
<filterset>
<filter token="ID" value="com.velvet.PankTest" />
<filter token="FILENAME" value="${example.name}" />
<filter token="VERSION" value="0.2" />
<filter token="CONTENT" value="${example.name}.swf" />
</filterset>
</copy>
<antcall target="ide.startDebugger" />
<!--
<antcall target="ide.startProfiler" />
-->
<exec executable="${flexSDK.adl}">
<arg value="${bindebug.dir}/${example.name}-app.xml" />
<arg value="${bindebug.dir}" />
</exec>
</target>
<target name="package.ipa" description="" depends="ide.resetCompiler">
<var name="example.name" value="GestouchExamples" />
<compile.debug input="${project.examplesPackage.dir}/${example.name}.mxml"
output="${example.name}.swf"
compilerArguments=""
/>
<if>
<equals arg1="${project.ios.certificate.password}" arg2=""/>
<then>
<input message="Certificate password:"
addproperty="var.project.app.certificate.password"/>
</then>
<else>
<var name="var.project.app.certificate.password" value="${project.ios.certificate.password}" />
</else>
</if>
<var name="var.project.app.descriptor" value="${bindebug.dir}/${example.name}-ipa.xml"/>
<copy file="${project.ios.descriptor.template}" tofile="${var.project.app.descriptor}" overwrite="true">
<filterset>
<filter token="ID" value="${project.ios.appID}" />
<filter token="FILENAME" value="${example.name}" />
<filter token="VERSION" value="${project.version}" />
<filter token="CONTENT" value="${example.name}.swf" />
</filterset>
</copy>
<var name="ipaTarget" value="ipa-test"/>
<java jar="${flexSDK.adt}" fork="true" failonerror="true">
<arg value="-package"/>
<arg line="-target ${ipaTarget}"/>
<arg line="-provisioning-profile ${project.ios.provisionprofile}"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="${project.ios.certificate}"/>
<arg value="-storepass"/>
<arg value="${var.project.app.certificate.password}"/>
<arg value="${bindebug.dir}/${example.name}.ipa" />
<arg value="${var.project.app.descriptor}" />
<arg value="-C"/>
<arg value="${bindebug.dir}" />
<arg value="${example.name}.swf" />
</java>
</target>
<target name="debug.apk" description="" depends="ide.resetCompiler">
<var name="example.name" value="GestouchExamples" />
<compile.debug input="${project.examplesPackage.dir}/${example.name}.mxml"
output="${example.name}.swf"
compilerArguments=""
/>
<if>
<equals arg1="${project.android.certificate.password}" arg2=""/>
<then>
<input message="Certificate password:"
addproperty="var.project.app.certificate.password"/>
</then>
<else>
<var name="var.project.app.certificate.password" value="${project.android.certificate.password}" />
</else>
</if>
<var name="var.project.app.descriptor" value="${bindebug.dir}/${example.name}-apk.xml"/>
<copy file="${project.android.descriptor.template}" tofile="${var.project.app.descriptor}" overwrite="true">
<filterset>
<filter token="ID" value="${project.android.appID}" />
<filter token="FILENAME" value="${example.name}" />
<filter token="VERSION" value="${project.version}" />
<filter token="CONTENT" value="${example.name}.swf" />
</filterset>
</copy>
<var name="var.debug.port" value="7935" />
<java jar="${flexSDK.adt}" fork="true" failonerror="true">
<arg value="-package" />
<arg value="-target" />
<arg value="apk-debug" />
<arg line="-listen ${var.debug.port}" />
<arg value="-storetype" />
<arg value="pkcs12" />
<arg value="-keystore" />
<arg value="${project.android.certificate}"/>
<arg value="-storepass" />
<arg value="${var.project.app.certificate.password}" />
<arg value="${bindebug.dir}/${example.name}.apk" />
<arg value="${var.project.app.descriptor}" />
<arg value="-C" />
<arg value="${bindebug.dir}" />
<arg value="${example.name}.swf" />
</java>
<!-- Installing the published application on to the emulator -e for emulator, -d for device -->
<exec executable="${android.adb}">
<arg line="-d"/>
<arg line="install"/>
<arg line="-r"/>
<arg line="${bindebug.dir}/${example.name}.apk"/>
</exec>
<exec executable="${android.adb}" failonerror="true">
<arg line="forward tcp:${var.debug.port} tcp:${var.debug.port}"/>
</exec>
<antcall target="ide.startDebugger">
<param name="asclient" value="true"/>
<param name="port" value="${var.debug.port}"/>
</antcall>
<java jar="${flexSDK.adt}" fork="true" failonerror="true">
<arg value="-launchApp" />
<arg value="-platform" />
<arg value="android" />
<arg value="-platformsdk" />
<arg value="${androidSDK.dir}" />
<arg value="-appid" />
<arg value="${project.android.appID}"/>
</java>
</target>
<target name="ide.startDebugger" description="Starts IDE Debugger">
<if>
<equals arg1="${user.ide}" arg2="FDT4"/>
<then>
<if>
<isset property="port"/>
<then>
<fdt.startDebugger projectname="${project.name}" asclient="${asclient}" port="${port}" />
</then>
<else>
<fdt.startDebugger projectname="${project.name}"/>
</else>
</if>
</then>
<else>
<echo>ide.startDebugger task is available only for FDT4. TODO: tasks for other IDEs</echo>
</else>
</if>
</target>
<target name="ide.startProfiler" description="Starts IDE Profiler">
<if>
<equals arg1="${user.ide}" arg2="FDT4"/>
<then>
<fdt.startProfiler projectname="${project.name}"/>
</then>
<else>
<echo>ide.startProfiler task is available only for FDT4. TODO: tasks for other IDEs</echo>
</else>
</if>
</target>
<target name="ide.resetCompiler" description="">
<if>
<equals arg1="${user.ide}" arg2="FDT4"/>
<then>
<!--<fdt.launch.resetFlexCompiler />-->
</then>
<else>
<echo>ide.resetCompiler task is available only for FDT4. TODO: tasks for other IDEs</echo>
</else>
</if>
</target>
<!-- Hidden targets and macro definitions-->
<macrodef name="compile.example">
<attribute name="exampleName" />
<attribute name="compilerArguments" default="" />
<attribute name="air" default="true" />
<attribute name="openSWF" default="false" />
<sequential>
<compile.debug input="${project.examplesPackage.dir}/@{exampleName}.as"
output="@{exampleName}.swf"
compilerArguments="@{compilerArguments}"
air="@{air}"
openSWF="@{openSWF}"
/>
</sequential>
</macrodef>
<macrodef name="compile.debug">
<attribute name="input" />
<attribute name="output" />
<attribute name="air" default="true" />
<attribute name="compilerArguments" default="" />
<attribute name="openSWF" default="false" />
<sequential>
<var name="var.compilerArguments" value="${project.baseCompilerArguments} ${project.debugCompilerArguments} @{compilerArguments}" />
<if>
<equals arg1="@{air}" arg2="true" />
<then>
<var name="var.compilerArguments" value="${var.compilerArguments} ${project.mobileCompilerArguments} +configname=airmobile" />
</then>
</if>
<if>
<equals arg1="${user.ide}" arg2="FDT4"/>
<then>
<fdt.launch.application projectname="${project.name}"
compilerarguments="${var.compilerArguments}"
mainclass="${src.dir}/@{input}"
debug="true"
profile="false"
target="${bindebug.dir}/@{output}"
startswf="@{openSWF}"
swflauncher="Adobe Flash Player"
/>
</then>
<else>
<java jar="${flexSDK.dir}/lib/mxmlc.jar" dir="${flexSDK.dir}/frameworks" fork="true" failonerror="true">
<arg value="${src.dir}/@{input}"/>
<arg value="-incremental=false"/>
<arg value="-headless-server=true"/>
<arg value="-debug=true"/>
<!--<arg value="+configname=flex"/>-->
<arg value="-source-path+=${src.dir}"/>
<arg value="-source-path+=${src_framework.dir}"/>
<arg value="-source-path+=${src_external.dir}"/>
<arg value="-library-path+=${flexSDK.dir}/frameworks/libs"/>
<arg value="-library-path+=${flexSDK.dir}/frameworks/libs/mx"/>
<arg value="-library-path+=${libs.dir}"/>
<arg value="-output=${bindebug.dir}/@{output}"/>
<arg line="${var.compilerArguments}"/>
</java>
<if>
<equals arg1="@{openSWF}" arg2="true" />
<then>
<exec executable="open" vmlauncher="true" spawn="false" failonerror="true">
<arg line="-a '${flashPlayer}'" />
<arg line="${bindebug.dir}/@{output}" />
</exec>
</then>
</if>
</else>
</if>
</sequential>
</macrodef>
</project>