-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
192 lines (148 loc) · 6.09 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
<project name="WAG ERG Playbook" default="release-deploy" basedir=".">
<description>
Build file for Playbook Development
</description>
<!-- *****************************************************************
define an ANT Property BB_TABLET_SDK_HOME with the path to the
playbook sdk
(Eclipse Settings -> ANT -> runtime -> Properties -> Add Property)
project structure:
/src (AS3 sources)
/lib (swc libraries)
/bin (output folder)
*****************************************************************-->
<property file="local.properties"/>
<property file="build.properties" />
<!-- import project properties -->
<property environment="env"/>
<!-- compiler, packager, and deployer settings -->
<property name="sdk.home" value="${bbtablet.sdk.home}" />
<property name="sdk.adl" value="${sdk.home}/bin/adl"/>
<property name="sdk.bbpack" value="${sdk.home}/bin/blackberry-airpackager.bat" />
<property name="sdk.bbdeploy" value="${sdk.home}/bin/blackberry-deploy" />
<!-- flex tasks -->
<taskdef resource="flexTasks.tasks" classpath="${flex.sdk.home}/ant/lib/flexTasks.jar" />
<!-- =================================
debug targets
================================= -->
<!-- compile-debug -->
<target name="debug-compile" depends="clean" if="sdk.home" description="compile the app with debugging">
<macro_mxmlc mainclass="${project.mainclass}" output="${project.swf}" debug="true" />
</target>
<!-- compile the WagErgWeb.swf for local debugging with Flash player -->
<target name="debug-compile-web">
<macro_mxmlc mainclass="${project.src}/WagErgWeb.as" output="${project.bin}/WagErgWeb.swf" debug="false" />
</target>
<!-- debug deploy -->
<target name="debug-deploy" depends="debug-compile" if="sdk.home" description="create the app .bar debug package and deploy the app">
<!-- include all dirs in bin -->
<dirset dir="${project.bin}" id="bin.dirs">
<include name="*"/>
</dirset>
<pathconvert property="bin.dirs.string" refid="bin.dirs" pathsep=" " >
<map from="${project.bin}/" to=" "/>
</pathconvert>
<!-- package and deploy -->
<exec executable="${sdk.bbpack}" dir="${project.bin}">
<arg value="-target" />
<arg value="bar-debug" />
<arg value="-connect"/>
<arg value="${bbtablet.vmware.i}"/>
<arg value="-package" />
<arg value="${project.bar}" />
<arg value="-installApp" />
<arg value="-launchApp" />
<arg value="${project.xml}" />
<arg value="${project.swf}" />
<arg value="${blackberry-tablet.xml}" />
<arg value="-device" />
<arg value="${bbtablet.device.ip}" />
<arg value="-password"/>
<arg value="${bbtablet.device.password}"/>
<arg line="-C ${project.bin} ${bin.dirs.string}" />
</exec>
</target>
<!-- =================================
release targets
================================= -->
<!-- compile -->
<target name="release-compile" depends="clean" if="sdk.home" description="compile the app">
<macro_mxmlc mainclass="${project.mainclass}" output="${project.swf}" debug="false" />
</target>
<!-- create-package -->
<target name="release-create-package" depends="release-compile" if="sdk.home" description="create the app .bar package">
<!-- include all dirs in bin -->
<dirset dir="${project.bin}" id="bin.dirs">
<include name="*"/>
</dirset>
<pathconvert property="bin.dirs.string" refid="bin.dirs" pathsep=" " >
<map from="${project.bin}/" to=" "/>
</pathconvert>
<exec executable="${sdk.bbpack}" dir="${project.bin}">
<arg value="-package" />
<arg value="${project.bar}" />
<arg value="${project.xml}" />
<arg value="${project.swf}" />
<arg value="${blackberry-tablet.xml}" />
<arg line="-C ${project.bin} ${bin.dirs.string}" />
</exec>
</target>
<!-- deploy -->
<target name="release-deploy" depends="release-create-package" if="sdk.home" description="deploy the app in the standard configuration">
<exec executable="${sdk.bbdeploy}" dir="${project.bin}">
<arg value="-installApp" />
<arg value="-launchApp" />
<arg value="-device" />
<arg value="${device.ip}" />
<arg value="-password"/>
<arg value="${device.password}"/>
<arg value="-package" />
<arg value="${project.bar}" />
</exec>
</target>
<!-- =================================
other targets
================================= -->
<!-- clean -->
<target name="clean" description="remove all the compiled files">
<delete>
<fileset dir="${project.bin}">
<include name="*.swf" />
<include name="*.bar" />
<include name="BAR*.tmp" />
</fileset>
</delete>
</target>
<target name="uninstall" description="remove the app from the simulator">
<exec executable="${sdk.bbdeploy}" dir="${project.bin}">
<arg value="-uninstallApp" />
<arg value="-device" />
<arg value="${device.ip}" />
<arg value="-password"/>
<arg value="${device.password}"/>
<arg value="-package" />
<arg value="${project.bar}" />
</exec>
</target>
<!-- ########################### MACRO-DEFINITIONS ######################### -->
<macrodef name="macro_mxmlc">
<attribute name="mainclass" />
<attribute name="output" />
<attribute name="debug" />
<element name="settings" optional="true" />
<sequential>
<echo>=== compile class @{mainclass} to @{output} ===</echo>
<mxmlc fork="true" maxmemory="512m" file="@{mainclass}" output="@{output}" debug="@{debug}" verbose-stacktraces="@{debug}" optimize="true" strict="true" benchmark="false" actionscript-file-encoding="UTF-8" keep-generated-actionscript="false">
<!-- load SDK config -->
<load-config filename="${sdk.home}/frameworks/air-config.xml"/>
<!-- include lib swcs -->
<library-path dir="${project.lib}" append="true">
<include name="*.swc" />
</library-path>
<!-- additional settings -->
<settings />
<source-path path-element="${project.src}"/>
</mxmlc>
</sequential>
</macrodef>
</project>