-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
393 lines (357 loc) · 18.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
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<!--
********************************************************************************
Jimm - Mobile Messaging - J2ME ICQ clone
Copyright (C) 2003-05 Jimm Project
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
********************************************************************************
File: build.xml
Version: ###VERSION### Date: ###DATE###
Author(s): Manuel Linsmayer, Andreas Rossbacher
********************************************************************************
-->
<project name="SmapeR" default="dist">
<!-- ******************************************************************* -->
<!-- CONFIGURATION SECTION - CHANGE VALUES TO REFLECT YOUR ENVIRONMENT -->
<!-- ******************************************************************* -->
<!-- Change this to the directory where a MIDP SDK is installed. You can -->
<!-- use both the slash and the backslash for separating path -->
<!-- components. -->
<property name="DEFAULT/midp" value="C:\WTK25-Beta2" />
<property name="MIDP2/midp" value="C:\WTK25-Beta2" />
<property name="RIM/midp" value="CHANGE ME" />
<property name="SIEMENS1/midp" value="CHANGE ME" />
<property name="SIEMENS2/midp" value="C:\WTK25-Beta2" />
<property name="MOTOROLA/midp" value="C:\WTK25-Beta2" />
<!-- ******************************************************************* -->
<!-- This property must point at the MIDP API classes and all extension -->
<!-- classes required by the chosen target. -->
<property name="DEFAULT/midp/lib" value="${DEFAULT/midp}/lib/cldcapi10.jar;${DEFAULT/midp}/lib/midpapi10.jar"/>
<property name="MIDP2/midp/lib" value="${DEFAULT/midp}/lib/LightAPIs.jar;${MIDP2/midp}/lib/cldcapi10.jar;${MIDP2/midp}/lib/midpapi20.jar;${MIDP2/midp}/lib/mmapi.jar;${MIDP2/midp}/lib/jsr75.jar"/>
<property name="RIM/midp/lib" value="${RIM/midp}/lib/net_rim_api.jar" />
<property name="SIEMENS1/midp/lib" value="${SIEMENS1/midp}/lib/API.jar" />
<property name="SIEMENS2/midp/lib" value="${DEFAULT/midp}/lib/LightAPIs.jar;${SIEMENS2/midp}/lib/api.jar;res/SIEMENS2/lib/fileaccess.jar" />
<property name="MOTOROLA/midp/lib" value="${DEFAULT/midp}/lib/LightAPIs.jar;${MIDP2/midp}/lib/cldcapi10.jar;${MIDP2/midp}/lib/midpapi20.jar;${MIDP2/midp}/lib/mmapi.jar;res/MOTOROLA/lib/fileaccess.jar;${MIDP2/midp}/lib/jsr75.jar" />
<!-- ******************************************************************* -->
<!-- Change this to the directory where ProGuard is installed. You can -->
<!-- use both the slash and the backslash for separating path components. -->
<property name="proguard" value="C:\Program Files\NetBeans 6.1\mobility8\external\proguard" />
<!-- ******************************************************************* -->
<!-- This property must point at the ProGuard JAR file, normally found -->
<!-- in the lib directory of the ProGuard distribution. -->
<property name="proguard/lib" value="${proguard}/lib/proguard.jar" />
<!-- ******************************************************************* -->
<!-- CUSTOMIZATION SECTION - CHANGE VALUES TO GET YOUR CUSTOM BUILD -->
<!-- ******************************************************************* -->
<!-- Build target. Currently there are the following build available: -->
<!-- DEFAULT - Standard MIDP1 -->
<!-- SIEMENS1 - For Siemens MIDP1-devices (like the x55 series -->
<!-- SIEMENS2 - For Siemens MIDP2-devices (like the x65 series -->
<!-- MIDP2 - Standard MIDP2 -->
<!-- RIM - For RIM Blackberry devices -->
<!-- MOTOROLA - For Motorola MIDP2 devices -->
<property name="target" value="MOTOROLA" />
<!-- ******************************************************************* -->
<!-- This value is a comma separated list of modules which should be -->
<!-- included in the build. Realised modules are: -->
<!-- TRAFFIC - module for traffic calculation -->
<!-- HISTORY - module for storing history of text messages -->
<!-- FILES - module for transferring files -->
<!-- SMILES - module for using emotions int messages text -->
<!-- PROXY - module for connecting via a socks proxy -->
<property name="modules" value="TRAFFIC,HISTORY,FILES,SMILES,PROXY" />
<!-- ******************************************************************* -->
<!-- This value is a comma separated list of languages packs which -->
<!-- should be included in the build. Currently, the distribution -->
<!-- includes English (EN), Bulgarian (BG), Brazilian Portuguese (BR), -->
<!-- Czech (CZ), German (DE), Spanish (ES), Hewbrew (HE), Italian (IT), -->
<!-- Lithuanian (LT), Polish (PL), Russian (RU), Swedish (SE), -->
<!-- Serbian (SR) and Ukrainian(UA) language packs. -->
<property name="lang" value="RU"/>
<!-- ******************************************************************* -->
<!-- Version number of the build. The value can be in any format (e.g. -->
<!-- 0.2cvs). -->
<property name="version/jimm" value="1.11j" />
<!-- ******************************************************************* -->
<!-- Version number of the build in the standardized format -->
<!-- <major>[.<minor>[.<micro>]] (e.g. 0.2). This value should -->
<!-- correspond to the version property (see above). -->
<property name="version/java" value="1.11" />
<!-- ******************************************************************* -->
<!-- CHANGE NOTHING BELOW THIS LINE, UNLESS YOU KNOW WHAT YOU'RE DOING -->
<!-- ******************************************************************* -->
<!-- Buildfile description -->
<description>SmapeR buildfile</description>
<!-- Set global properties for this build -->
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="src" location="src" />
<property name="res" location="res" />
<property name="res/all" location ="res/ALL_TARGETS" />
<property name="res/target" location="${res}/${target}" />
<property name="util" location="util" />
<property name="util/sijapp" location="${util}/sijapp" />
<property name="util/sijapp/lib" location="${util/sijapp}/dist/lib/sijapp.jar" />
<property name="util/langs" location="${util}/langs" />
<property name="util/langs/lib" location="${util/langs}/dist/lib/langs.jar" />
<property name="util/jarsizetask" location="${util}/jarsizetask" />
<property name="util/jarsizetask/lib" location="${util/jarsizetask}/dist/lib/jarsizetask.jar" />
<property name="util/jlft" location="${util}/jlft" />
<!-- Auxiliary property -->
<property name="3ns" value="###" />
<!-- Register Proguard task -->
<taskdef name="proguard" classname="proguard.ant.ProGuardTask" classpath="${proguard/lib}" />
<!-- Internal target: init -->
<target name="init">
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<tstamp>
<format property="date" pattern="yyyy/MM/dd" timezone="GMT+00:00" />
</tstamp>
<condition property="midp" value="${DEFAULT/midp}">
<equals arg1="${target}" arg2="DEFAULT" />
</condition>
<condition property="midp" value="${SIEMENS1/midp}">
<equals arg1="${target}" arg2="SIEMENS1" />
</condition>
<condition property="midp" value="${SIEMENS2/midp}">
<equals arg1="${target}" arg2="SIEMENS2" />
</condition>
<condition property="midp" value="${MIDP2/midp}">
<equals arg1="${target}" arg2="MIDP2" />
</condition>
<condition property="midp" value="${RIM/midp}">
<equals arg1="${target}" arg2="RIM" />
</condition>
<condition property="midp" value="${MOTOROLA/midp}">
<equals arg1="${target}" arg2="MOTOROLA" />
</condition>
<condition property="midp/lib" value="${DEFAULT/midp/lib}">
<equals arg1="${target}" arg2="DEFAULT" />
</condition>
<condition property="midp/lib" value="${SIEMENS1/midp/lib}">
<equals arg1="${target}" arg2="SIEMENS1" />
</condition>
<condition property="midp/lib" value="${SIEMENS2/midp/lib}">
<equals arg1="${target}" arg2="SIEMENS2" />
</condition>
<condition property="midp/lib" value="${MIDP2/midp/lib}">
<equals arg1="${target}" arg2="MIDP2" />
</condition>
<condition property="midp/lib" value="${RIM/midp/lib}">
<equals arg1="${target}" arg2="RIM" />
</condition>
<condition property="midp/lib" value="${MOTOROLA/midp/lib}">
<equals arg1="${target}" arg2="MOTOROLA" />
</condition>
<condition property="midp_profile" value="MIDP-1.0">
<equals arg1="${target}" arg2="DEFAULT" />
</condition>
<condition property="midp_profile" value="MIDP-1.0">
<equals arg1="${target}" arg2="SIEMENS1" />
</condition>
<condition property="midp_profile" value="MIDP-2.0">
<equals arg1="${target}" arg2="SIEMENS2" />
</condition>
<condition property="midp_profile" value="MIDP-2.0">
<equals arg1="${target}" arg2="MIDP2" />
</condition>
<condition property="midp_profile" value="MIDP-1.0">
<equals arg1="${target}" arg2="RIM" />
</condition>
<condition property="midp_profile" value="MIDP-2.0">
<equals arg1="${target}" arg2="MOTOROLA" />
</condition>
</target>
<!-- Internal target: sijapp -->
<target name="sijapp">
<ant dir="${util/sijapp}" inheritAll="false" />
<taskdef name="sijapp" classname="sijapp.SijappTask" classpath="${util/sijapp/lib}" />
</target>
<!-- Internal target: langs -->
<target name="langs">
<ant dir="${util/langs}" inheritAll="false" />
<taskdef name="langs" classname="langs.LangsTask" classpath="${util/langs/lib}" />
</target>
<!-- Internal target: preprocess-source -->
<target name="preprocess-source" depends="init,sijapp,langs">
<condition property="modules/TRAFFIC" value="true">
<contains string="${modules}" substring="TRAFFIC" />
</condition>
<condition property="modules/DEBUGLOG" value="true">
<contains string="${modules}" substring="DEBUGLOG" />
</condition>
<condition property="modules/HISTORY" value="true">
<contains string="${modules}" substring="HISTORY" />
</condition>
<condition property="modules/PROXY" value="true">
<contains string="${modules}" substring="PROXY" />
</condition>
<condition property="modules/FILES" value="true">
<contains string="${modules}" substring="FILES" />
</condition>
<condition property="files_dir" value="res/MODULES/FILES">
<and>
<contains string="${modules}" substring="FILES" />
<OR>
<contains string="${target}" substring="MIDP2"/>
<contains string="${target}" substring="SIEMENS2"/>
<contains string="${target}" substring="MOTOROLA"/>
</OR>
</and>
</condition>
<condition property="modules/SMILES" value="true">
<contains string="${modules}" substring="SMILES" />
</condition>
<condition property="modules/SMILES" value="true">
<contains string="${modules}" substring="SMILES" />
</condition>
<condition property="smiles_dir" value="res/MODULES/SMILES_BIG">
<and>
<contains string="SIEMENS2,MIDP2,MOTOROLA" substring="${target}" />
<istrue value="${modules/SMILES}" />
</and>
</condition>
<condition property="smiles_dir" value="res/MODULES/SMILES_SMALL">
<and>
<contains string="DEFAULT,SIEMENS1,RIM" substring="${target}" />
<istrue value="${modules/SMILES}" />
</and>
</condition>
<condition property="smiles_dir" value="res/MODULES/SMILES_NO">
<not>
<contains string="${modules}" substring="SMILES" />
</not>
</condition>
<mkdir dir="${build}/init/src" />
<sijapp srcdir="${src}" destdir="${build}/init/src">
<define name="target" value="${target}" />
<define name="modules_TRAFFIC" value="${modules/TRAFFIC}" />
<define name="modules_DEBUGLOG" value="${modules/DEBUGLOG}" />
<define name="modules_HISTORY" value="${modules/HISTORY}" />
<define name="modules_PROXY" value="${modules/PROXY}" />
<define name="modules_FILES" value="${modules/FILES}" />
<define name="modules_SMILES" value="${modules/SMILES}" />
</sijapp>
<replace dir="${build}/init/src" encoding="UTF-8">
<replacefilter token="${3ns}VERSION${3ns}" value="${version/jimm}" />
<replacefilter token="${3ns}VERSION-JAVA${3ns}" value="${version/java}" />
<replacefilter token="${3ns}DATE${3ns}" value="${date}" />
<replacefilter token="${3ns}TARGET${3ns}" value="${target}" />
<replacefilter token="${3ns}MODULES${3ns}" value="${modules}" />
</replace>
<mkdir dir="${build}/res" />
<langs languages="${lang}" inDir="${build}/init/src/lng" outDir="${build}/res" srcDir="${build}/init/src/" idealLang="RU"/>
</target>
<!-- Internal target: compile -->
<target name="compile" depends="preprocess-source">
<ant dir="${util/jlft}" inheritAll="false" />
<mkdir dir="${build}/compile/classes" />
<javac srcdir="${build}/init/src" destdir="${build}/compile/classes" bootclasspath="${midp/lib}" encoding="utf-8" debug="off" />
</target>
<!-- Internal target: obfuscate -->
<target name="obfuscate" depends="compile" unless="skip-obfuscate">
<mkdir dir="${build}/obfuscate/classes" />
<proguard note="off" defaultpackage="" usemixedcaseclassnames="off" overloadaggressively="on" obfuscate = "true" optimize = "true" allowaccessmodification="true">
<injar name="${build}/compile/classes" />
<outjar name="${build}/obfuscate/classes" />
<keep access="public" type="class" extends="javax.microedition.midlet.MIDlet" />
<libraryjar path="${midp/lib}" />
</proguard>
</target>
<!-- Internal target: skip-obfuscate -->
<target name="skip-obfuscate" depends="compile" if="skip-obfuscate">
<mkdir dir="${build}/obfuscate/classes" />
<copy todir="${build}/obfuscate/classes">
<fileset dir="${build}/compile/classes" />
</copy>
</target>
<!-- Internal target: preverify -->
<target name="preverify" depends="obfuscate,skip-obfuscate">
<mkdir dir="${build}/preverified/classes" />
<exec executable="${midp}/bin/preverify">
<arg line="-classpath '${midp/lib}'" />
<arg line="-d '${build}/preverified/classes'" />
<arg line="'${build}/obfuscate/classes'" />
<arg line="-cldc" />
</exec>
</target>
<!-- Internal target: preprocess-manifest -->
<target name="preprocess-manifest" depends="init">
<copy file="${res}/MANIFEST.MF" todir="${build}" />
<replace file="${build}/MANIFEST.MF" encoding="UTF-8">
<replacefilter token="${3ns}VERSION${3ns}" value="${version/jimm}" />
<replacefilter token="${3ns}VERSION-JAVA${3ns}" value="${version/java}" />
<replacefilter token="${3ns}DATE${3ns}" value="${date}" />
<replacefilter token="${3ns}MIDP-PROFILE${3ns}" value="${midp_profile}" />
</replace>
</target>
<!-- Internal target: preprocess-resources -->
<target name="preprocess-resources">
<mkdir dir="${build}/res" />
<copy todir="${build}/res" flatten="true" includeEmptyDirs="false" failonerror="false">
<fileset dir="${files_dir}" />
</copy>
<copy todir="${build}/res" flatten="true" includeEmptyDirs="false" failonerror="false">
<fileset dir="${smiles_dir}" />
</copy>
<copy todir="${build}/res" includeEmptyDirs="false">
<fileset dir="${res}" includes="*" excludes="MANIFEST.MF" />
</copy>
<copy todir="${build}/res" flatten="true" includeEmptyDirs="false">
<fileset dir="${res/all}" />
</copy>
<copy todir="${build}/res" flatten="true" includeEmptyDirs="false" failonerror="false">
<fileset dir="${res/target}">
<exclude name="lib/**" />
</fileset>
</copy>
</target>
<!-- Internal target: jarsizetask -->
<target name="jarsizetask">
<ant dir="${util/jarsizetask}" inheritAll="false" />
<taskdef name="jarsize" classname="JarSizeTask" classpath="${util/jarsizetask/lib}" />
</target>
<!-- Target: dist -->
<target name="dist" depends="preverify,preprocess-manifest,preprocess-resources,jarsizetask" description="Generate the distribution">
<mkdir dir="${dist}/bin" />
<jar destfile="${dist}/bin/smaper.jar" manifest="${build}/MANIFEST.MF">
<fileset dir="${build}/preverified/classes" />
<fileset dir="${build}/res" />
</jar>
<jarsize file="${dist}/bin/smaper.jar" />
<unjar src="${dist}/bin/smaper.jar" dest="${dist}/bin">
<patternset includes="META-INF/MANIFEST.MF" />
</unjar>
<move file="${dist}/bin/META-INF/MANIFEST.MF" tofile="${dist}/bin/smaper.jad" />
<delete dir="${dist}/bin/META-INF" />
</target>
<!-- Internal target: del_build -->
<target name="del_build" description="Delete the build dir">
<delete dir="${build}" />
</target>
<!-- Internal target: del_dist -->
<target name="del_dist" description="Delete the dist dir">
<delete dir="${dist}" />
</target>
<!-- Internal target: del_utils -->
<target name="del_utils" description="Delete the utils dist and build dirs">
<ant dir="${util/sijapp}" inheritAll="false" target="clean" />
<ant dir="${util/jarsizetask}" inheritAll="false" target="clean" />
<ant dir="${util/jlft}" inheritAll="false" target="clean" />
<ant dir="${util/langs}" inheritAll="false" target="clean" />
</target>
<!-- Target: clean without cleaning utils -->
<target name="clean" description="Clean the distribution(without utils)" depends="del_build,del_dist" />
<!-- Target: clean all -->
<target name="clean-all" description="Clean the distribution" depends="clean,del_utils" />
</project>