-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·264 lines (221 loc) · 12.3 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
<?xml version="1.0" encoding="iso-8859-1" ?>
<project name="MobileMedia-COSMOS - Version 2" default="full-build-and-run-default" basedir=".">
<!-- Define all relevant properties here. -->
<property name="workspace.dir" location="${basedir}"/>
<!-- <property file="homeBuild.properties"/>-->
<property file="labBuild.properties"/>
<!-- <property file="laptopBuild.properties"/>-->
<property name="antenna.jar" location="${antenna.home}//${antenna.name}"/>
<!-- Define COSMOS library -->
<!-- property name="cosmos-embedded.jar" location="${cosmos.home}/cosmos-embedded.jar"/ -->
<!-- Define JRE 6 library -->
<!-- property name="jre6.jar" location="${jre6.home}/lib/rt.jar"/ -->
<!-- Define core MIDP libraries -->
<!-- MIDP 1.0 CLDC 1.0 -->
<property name="midpapi10.jar" location="${wtk.home}/lib/midpapi10.jar"/>
<property name="cldcapi10.jar" location="${wtk.home}/lib/cldcapi10.jar"/>
<!-- MIDP 2.0 CLDC 1.1 -->
<property name="midpapi20.jar" location="${wtk.home}/lib/midpapi20.jar"/>
<property name="cldcapi11.jar" location="${wtk.home}/lib/cldcapi11.jar"/>
<!-- Define Third Party and optional MIDP Libraries -->
<property name="moto730.zip" location="${motorola.home}/lib/i730/Motorola730.zip"/>
<property name="wma.jar" location="${wtk.home}/lib/wma.jar"/>
<property name="mmapi.jar" location="${wtk.home}/lib/mmapi.jar"/>
<property name="jsr75.jar" location="${wtk.home}/lib/jsr75.jar"/>
<property name="blackberryLib.jar" location="${blackberry.jde.home}/lib/net_rim_api.jar"/>
<property name="siemensLib.zip" location="${siemens.home}/SiemensJ2MElib.zip"/>
<!-- Set the classpath to be used -->
<!-- <property name="build.classpath" value="${midpapi20.jar};${cldcapi11.jar};${wma.jar};${mmapi.jar};${jsr75.jar};${moto730.zip};${siemensLib.zip};${blackberryLib.jar};${antenna.jar}"/>-->
<property name="build.classpath" value="${midpapi20.jar};${cldcapi11.jar};${antenna.jar}"/>
<!-- property name="build.classpath" value="${midpapi20.jar};${cldcapi11.jar};${antenna.jar};${jre6.jar}"/ -->
<!-- Directories created or used during the build process -->
<property name="rapc-compiled.dir" location="${workspace.dir}/rapc-compiled"/>
<property name="prc-compiled.dir" location="${workspace.dir}/prc-compiled"/>
<property name="midp-preprocessed.dir" location="${workspace.dir}/midp-preprocessed"/>
<property name="midp-compiled.dir" location="${workspace.dir}/midp-compiled"/>
<property name="src.dir" location="${workspace.dir}/src"/>
<property name="preverified.dir" location="${workspace.dir}/preverified"/>
<property name="jar.dir" location="${workspace.dir}/jars"/>
<property name="palm.dir" location="${workspace.dir}/palm"/>
<property name="rim.dir" location="${workspace.dir}/rim"/>
<property name="images.dir" location="${workspace.dir}/images"/>
<!-- This resource is required for Antenna based tasks -->
<!-- <taskdef resource="antenna.properties" classpath="${antenna.jar}"/> -->
<taskdef resource="antenna.properties" classpath="${antenna.home}/${antenna.name}"/>
<!-- ============================================================= -->
<!-- Full Build (Default Target) -->
<!-- ============================================================= -->
<target name="full-build">
<antcall target="clean" />
<antcall target="midp-preprocess" />
<antcall target="midp-compile" />
<antcall target="copy-image-files" />
<antcall target="midp-preverify" />
<antcall target="make-jar" />
</target>
<target name="full-build-and-run-default">
<antcall target="clean" />
<antcall target="midp-preprocess" />
<antcall target="midp-compile" />
<antcall target="copy-image-files" />
<antcall target="midp-preverify" />
<antcall target="make-jar" />
<antcall target="run-default-phone-emulator" />
</target>
<!-- ============================================================= -->
<!-- Clean all targets -->
<!-- ============================================================= -->
<target name="clean" description="clean and create classes/jar dir, .ajesym files">
<!-- Delete all the directories and their contents -->
<delete quiet="on" dir="${preverified.dir}"/>
<delete quiet="on" dir="${midp-compiled.dir}"/>
<delete quiet="on" dir="${midp-preprocessed.dir}"/>
<delete quiet="on" dir="${rapc-compiled.dir}"/>
<delete quiet="on" dir="${prc-compiled.dir}"/>
<!-- Update the jar, don't delete it. This is only required for the
Motorola application, which needs the extra property in the jad file -->
<delete quiet="on">
<fileset dir="${jar.dir}" excludes="**/*.jad"/>
</delete>
<delete quiet="on">
<fileset dir="${workspace.dir}" includes="**/*.ajesym"/>
</delete>
<!-- Recreate the directories we just deleted -->
<mkdir dir="${preverified.dir}"/>
<mkdir dir="${midp-preprocessed.dir}/src"/>
<mkdir dir="${midp-compiled.dir}"/>
<mkdir dir="${rapc-compiled.dir}"/>
<mkdir dir="${prc-compiled.dir}"/>
<mkdir dir="${jar.dir}"/>
</target>
<!-- ============================================================= -->
<!-- PreProcess MIDP classes using antenna J2ME Preprocessor -->
<!-- ============================================================= -->
<target name="midp-preprocess">
<wtkpreprocess srcdir="${src.dir}" destdir="${midp-preprocessed.dir}/src" symbols="${preprocessor.symbols}" verbose="true" indent="false"/>
</target>
<!-- ============================================================= -->
<!-- Compile MIDP classes using standard midp (javac) compiler -->
<!-- ============================================================= -->
<target name="midp-compile">
<!-- NOTE: This is not used anymore. It has been replaced by the AspectJ Compiler Task -->
<!-- For Motorola Build, only update jad so it includes property: iDEN-Midlet-Phone: MainUIMidlet10 -->
<wtkjad jadfile="${jar.dir}/${jad.name}" jarfile="${midp-compiled.dir}/${jar.name}" name="${midlet.name}" update="true" vendor="Trevor Young" version="1.0.0">
<midlet name="${midlet.name}" class="${main.class}"/>
</wtkjad>
<!-- Compile everything, but don't preverify (yet}. Use bootclasspath to override MIDP 1.0/CLDC 1.0 apis-->
<wtkbuild srcdir="${midp-preprocessed.dir}" destdir="${midp-compiled.dir}" preverify="true" bootclasspath="${build.classpath};" >
<includesfile name="MobileMediaCompileList.lst"/>
</wtkbuild>
<!-- Package the compiled classes into a JAR and JAD file -->
<!-- Don't need to do this here
<wtkpackage jarfile="${midp-compiled.dir}/${jar.name}" jadfile="${jar.dir}/${jad.name}" obfuscate="false" preverify="false" >
<fileset dir="${workspace.dir}" includes="${main.class}.class"/>
</wtkpackage>
-->
</target>
<!-- ============================================================= -->
<!-- Copy Image Files so they are bundled with the jar file -->
<!-- ============================================================= -->
<target name="copy-image-files">
<mkdir dir="${preverified.dir}/images"/>
<copy todir="${preverified.dir}/images">
<fileset dir="${images.dir}"/>
</copy>
</target>
<!-- ============================================================= -->
<!-- Preverify MIDP classes, -->
<!-- ============================================================= -->
<target name="midp-preverify">
<wtkpreverify srcdir="${midp-compiled.dir}" destdir="${preverified.dir}" classpath="${build.classpath};" />
</target>
<!-- ============================================================= -->
<!-- Generate the final JAR file that will run on MIDP devices and update JAD-->
<!-- ============================================================= -->
<target name="make-jar">
<!-- Package the compiled classes into a JAR and JAD file -->
<wtkpackage jarfile="${jar.dir}/${jar.name}" jadfile="${jar.dir}/${jad.name}" basedir="${preverified.dir}" obfuscate="false" preverify="false" >
</wtkpackage>
</target>
<!-- ============================================================= -->
<!-- Compile / convert Jar file for BlackBerry using rapc.exe compiler -->
<!-- ============================================================= -->
<target name="rapc-compile">
<exec executable=""${blackberry.jde.home}/bin/rapc.exe"">
<arg line="import="${blackberry.jde.home}/lib/net_rim_api.jar;" codename=${midlet.name} -midlet "${jar.dir}/${jar.name}" "${jar.dir}/${jad.name}""/>
</exec>
<copy todir="${rapc-compiled.dir}">
<fileset dir="${workspace.dir}">
<include name="*.debug"/>
<include name="*.cod"/>
<include name="*.cso"/>
</fileset>
</copy>
<delete quiet="on">
<fileset dir="${workspace.dir}" includes="*.debug"/>
<fileset dir="${workspace.dir}" includes="*.cso"/>
<fileset dir="${workspace.dir}" includes="*.cod"/>
</delete>
</target>
<!-- ============================================================= -->
<!-- Convert Jar file for Palm OS using Sun MIDP converter -->
<!-- ============================================================= -->
<target name="make-prc">
<!-- <wtkmakeprc jadfile="${jar.dir}/${jad.name}" prcfile="${midlet.name}.prc"/> -->
<exec executable="${palm.midp.home}/palmConverter.bat">
<arg line="${jar.dir}/${jad.name} ${jar.dir}/${jar.name}"/>
</exec>
</target>
<!-- ============================================================= -->
<!-- Run the Midlet in the standard Phone Emulator -->
<!-- ============================================================= -->
<target name="run-default-phone-emulator">
<!-- Start the MIDlet suite -->
<wtkrun jadfile="jars/${jad.name}" device="DefaultColorPhone" wait="true" heapsize="2M"/>
</target>
<!-- ============================================================= -->
<!-- Run the Midlet in the Motorola Phone Emulator -->
<!-- ============================================================= -->
<target name="run-motorola-V300-phone-emulator">
<exec executable=""${motorola.home}/bin/jblend"">
<arg line=" -Xdevice:V360_V361 -Xdescriptor:"${jar.dir}/${jad.name}""/>
</exec>
</target>
<!-- ============================================================= -->
<!-- Run the Midlet in the Motorola Phone Emulator -->
<!-- ============================================================= -->
<target name="run-motorola-L6-phone-emulator">
<!-- Start the MIDlet suite -->
<!-- <wtkrun jadfile="${jar.dir}/${jad.name}" device="DefaultColorPhone" wait="true"/> -->
<exec executable=""${motorola.home}/bin/jblend"">
<arg line=" -Xdevice:L2_L6_L6i -Xdescriptor:"${jar.dir}/${jad.name}""/>
</exec>
</target>
<!-- ============================================================= -->
<!-- Run the Midlet in the Siemens Phone Emulator -->
<!-- ============================================================= -->
<!--<target name="run-siemens-phone-emulator"> -->
<!-- <echo>${jar.dir}\${jad.name}</echo>-->
<!-- <exec executable="${siemens.home}/Emulators/S75/bin/emulator"> -->
<!-- <arg line=" -Xdescriptor:"${jar.dir}\${jad.name}""/>-->
<!-- </exec> -->
<!--</target> -->
<target name="run-siemens-phone-emulator-CX65">
<exec executable="E:\Nelio\Aplicacoes para avaliacao\MobileMedia\siemens.bat">
</exec>
</target>
<!-- ============================================================= -->
<!-- Run the Midlet in the Nokia 3410 Phone Emulator -->
<!-- ============================================================= -->
<target name="run-Sony Ericsson-phone-emulator">
<exec executable="${sonyericson.home}/bin/emulatorw.exe">
<arg line="-gui -Xdescriptor:"${jar.dir}/${jad.name}""/>
</exec>
</target>
<!-- Info Target: Echo usage and information about this build script -->
<target name="info" >
<echo>
Insert any relevant help information here...
</echo>
</target>
</project>