Rev 266 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 266 | Rev 517 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #!/usr/bin/env ruby |
1 | #!/usr/bin/env ruby |
2 | # little ruby script to build DUBwise |
- | |
3 | # |
- | |
4 | # Author: Marcus -LiGi- Bueschleb |
- | |
5 | # |
- | |
6 | # see README for further Infos |
- | |
Line -... | Line 2... | ||
- | 2 | ||
- | 3 | ||
- | 4 | #################################### |
|
- | 5 | # # |
|
- | 6 | ### build-script for DUBwise ####### |
|
- | 7 | # # |
|
- | 8 | # Author: Marcus -LiGi- Bueschleb # |
|
- | 9 | # # |
|
- | 10 | # see README for further Infos # |
|
- | 11 | # # |
|
- | 12 | #################################### |
|
- | 13 | ||
- | 14 | ||
- | 15 | def p_usage |
|
- | 16 | puts "./BUILD [options] <profile> [bin_dir]" |
|
- | 17 | puts "options: |
|
- | 18 | -z -> 7Zip bindir |
|
- | 19 | -l -> regenerate strings |
|
- | 20 | -i -> regenerate images |
|
- | 21 | -d -> debug output |
|
- | 22 | -o -> obfuscate" |
|
- | 23 | end |
|
- | 24 | ||
- | 25 | ||
- | 26 | @log_flag=false |
|
- | 27 | def log str |
|
- | 28 | puts str if @log_flag |
|
- | 29 | end |
|
- | 30 | ||
- | 31 | ||
7 | 32 | start_time=Time.now |
|
Line -... | Line 33... | ||
- | 33 | ||
- | 34 | resdir="res/" |
|
- | 35 | ||
- | 36 | version_split=File.read("version").delete("\n\r").split(".") |
|
- | 37 | version_major=version_split[0] |
|
- | 38 | version_minor=version_split[1] |
|
- | 39 | version_patch=version_split[2] |
|
- | 40 | ||
- | 41 | ||
- | 42 | advzip_flags="-4" |
|
- | 43 | if ARGV.include?("-f") |
|
- | 44 | advzip_flags="" |
|
- | 45 | ARGV.delete("-f") |
|
- | 46 | end |
|
- | 47 | ||
- | 48 | zip_bindir= ARGV.include?("-z") |
|
- | 49 | obfuscate= ARGV.include?("-o") |
|
- | 50 | ||
- | 51 | @log_flag= ARGV.include?("-d") |
|
- | 52 | ||
- | 53 | ARGV.delete("-d") |
|
8 | 54 | ARGV.delete("-z") |
|
9 | resdir="res/" |
55 | ARGV.delete("-o") |
10 | 56 | ||
11 | if ARGV.include?("-l") |
57 | if ARGV.include?("-l") |
12 | puts "regenerating language strings" |
58 | puts "regenerating language strings" |
Line 13... | Line 59... | ||
13 | p `cd res ; ruby lang_gen.rb ; cd ..` |
59 | p `cd res ; ruby lang_gen.rb ; cd ..` |
14 | ARGV.delete("-l") |
60 | ARGV.delete("-l") |
15 | end |
61 | end |
16 | 62 | ||
17 | if ARGV.include?("-i") |
- | |
18 | puts "regenerating images" |
63 | if ARGV.include?("-i") |
Line -... | Line 64... | ||
- | 64 | puts "regenerating images" |
|
- | 65 | p `cd res ; ruby image_gen.rb ; cd ..` |
|
- | 66 | ARGV.delete("-i") |
|
19 | p `cd res ; ruby image_gen.rb ; cd ..` |
67 | end |
20 | ARGV.delete("-i") |
68 | |
21 | 69 | ||
22 | end |
- | |
23 | - | ||
24 | 70 | bindir="bin" |
|
Line -... | Line 71... | ||
- | 71 | set="test" |
|
- | 72 | ||
- | 73 | if ARGV.length==2 |
|
- | 74 | bindir=ARGV[1] |
|
- | 75 | puts `rm -rf #{bindir}` |
|
- | 76 | end |
|
- | 77 | ||
- | 78 | ||
- | 79 | ||
- | 80 | screensizes=["240x320"] |
|
- | 81 | voice_modes=["en_speedy"] |
|
- | 82 | bluetooth_modes=["on"] |
|
- | 83 | fileapi_modes=["on"] |
|
- | 84 | devicecontrol_modes=["on"] |
|
- | 85 | cldc11_modes=["on"] |
|
25 | if ARGV.length==2 |
86 | firmware_modes=["all_firmwares"] |
26 | bindir=ARGV[1] |
87 | location_modes=["no_location"] |
27 | puts `rm -rf #{bindir}` |
88 | #map_modes=["no_map","J2MEMap"] |
- | 89 | map_modes=["no_map"] |
|
- | 90 | ||
- | 91 | #defaults={{:screensizes=>["240x320"],:voice_moes=>["en_speedy"] , :bluetooth_modes=>["on"] , :devicecontrol_modes=>["on"],:fileapi_modes=>"off" |
|
- | 92 | #"loeti"=>[{:screensizes=>["176x220"],:voice_moes=>["en_speedy"] , :bluetooth_modes=>["on"] , :devicecontrol_modes=>["on"] } ] , |
|
- | 93 | ||
- | 94 | ARGV<<"" if ARGV==[] |
|
- | 95 | case ARGV[0] |
|
- | 96 | when "loeti" |
|
- | 97 | ||
- | 98 | when "xda" |
|
- | 99 | # screensizes=["480x640"] |
|
- | 100 | screensizes=["240x320"] |
|
- | 101 | # screensizes=["128x128"] |
|
- | 102 | voice_modes=["no_voice"] |
|
- | 103 | bluetooth_modes=["on"] |
|
- | 104 | devicecontrol_modes=["off"] |
|
- | 105 | fileapi_modes=["on"] |
|
- | 106 | cldc11_modes=["on"] |
|
- | 107 | firmware_modes=["no_firmwares"] |
|
- | 108 | location_modes=["no_location"] |
|
- | 109 | # location_modes=["jsr179"] |
|
- | 110 | map_modes=["J2MEMap"] |
|
- | 111 | # map_modes=["J2MEMap","no_maps"] |
|
- | 112 | ||
- | 113 | ||
- | 114 | when "openlapi" |
|
- | 115 | screensizes=["240x320"] |
|
- | 116 | # screensizes=["128x128"] |
|
- | 117 | voice_modes=["de_64kbit_tts"] |
|
- | 118 | bluetooth_modes=["on"] |
|
- | 119 | devicecontrol_modes=["on"] |
|
- | 120 | fileapi_modes=["off"] |
|
28 | else |
121 | cldc11_modes=["on"] |
- | 122 | firmware_modes=["no_firmwares"] |
|
29 | bindir="bin" |
123 | location_modes=["openlapi"] |
30 | end |
124 | # location_modes=["jsr179"] |
31 | 125 | map_modes=["J2MEMap"] |
|
32 | 126 | ||
33 | ARGV<<"" if ARGV==[] |
127 | |
- | 128 | when "k750" |
|
- | 129 | screensizes=["176x220"] |
|
- | 130 | # screensizes=["128x128"] |
|
- | 131 | voice_modes=["de_tts"] |
|
- | 132 | bluetooth_modes=["on"] |
|
- | 133 | devicecontrol_modes=["on"] |
|
- | 134 | fileapi_modes=["off"] |
|
- | 135 | cldc11_modes=["on"] |
|
- | 136 | firmware_modes=["no_firmwares"] |
|
- | 137 | location_modes=["no_location"] |
|
- | 138 | # location_modes=["jsr179"] |
|
- | 139 | map_modes=["J2MEMap"] |
|
- | 140 | ||
- | 141 | ||
- | 142 | when "location_test" |
|
- | 143 | screensizes=["128x128"] |
|
- | 144 | voice_modes=["de_64kbit_tts"] |
|
- | 145 | bluetooth_modes=["on"] |
|
- | 146 | devicecontrol_modes=["on"] |
|
- | 147 | fileapi_modes=["off"] |
|
- | 148 | cldc11_modes=["on"] |
|
- | 149 | firmware_modes=["no_firmwares"] |
|
- | 150 | location_modes=["no_location","jsr179","openlapi"] |
|
34 | case ARGV[0] |
151 | |
Line 35... | Line 152... | ||
35 | when "loeti" |
152 | when "sven" |
36 | screensizes=["176x220"] |
153 | screensizes=["128x128"] |
37 | voice_modes=["en_speedy"] |
154 | voice_modes=["de_64kbit_tts"] |
38 | bluetooth_modes=["on"] |
155 | bluetooth_modes=["on"] |
Line 51... | Line 168... | ||
51 | 168 | ||
52 | when "test" |
169 | when "test" |
53 | screensizes=["240x320"] |
170 | screensizes=["240x320"] |
54 | voice_modes=["en_speedy"] |
171 | voice_modes=["en_speedy"] |
55 | bluetooth_modes=["on"] |
172 | bluetooth_modes=["on"] |
56 | devicecontrol_modes=["on"] |
173 | devicecontrol_modes=["off","on"] |
57 | fileapi_modes=["on"] |
174 | fileapi_modes=["on"] |
58 | cldc11_modes=["on"] |
175 | cldc11_modes=["on"] |
59 | #firmware_modes=["fc_mk3mag_firmwares"] |
176 | #firmware_modes=["fc_mk3mag_firmwares"] |
Line 70... | Line 187... | ||
70 | cldc11_modes=["on"] |
187 | cldc11_modes=["on"] |
71 | #firmware_modes=["fc_mk3mag_firmwares"] |
188 | #firmware_modes=["fc_mk3mag_firmwares"] |
72 | #firmware_modes=["all_firmwares"] |
189 | #firmware_modes=["all_firmwares"] |
73 | firmware_modes=["all_firmwares"] |
190 | firmware_modes=["all_firmwares"] |
Line -... | Line 191... | ||
- | 191 | ||
- | 192 | when "gpstest" |
|
- | 193 | screensizes=["240x320"] |
|
- | 194 | voice_modes=["en_speedy"] |
|
- | 195 | bluetooth_modes=["on"] |
|
- | 196 | devicecontrol_modes=["on"] |
|
- | 197 | fileapi_modes=["on"] |
|
- | 198 | cldc11_modes=["on"] |
|
- | 199 | firmware_modes=["no_firmwares"] |
|
- | 200 | location_modes=["jsr179"] |
|
- | 201 | map_modes=["J2MEMap"] |
|
- | 202 | ||
- | 203 | when "gpstestola" |
|
- | 204 | screensizes=["240x320"] |
|
- | 205 | voice_modes=["en_speedy"] |
|
- | 206 | bluetooth_modes=["on"] |
|
- | 207 | devicecontrol_modes=["on"] |
|
- | 208 | fileapi_modes=["on"] |
|
- | 209 | cldc11_modes=["on"] |
|
- | 210 | firmware_modes=["no_firmwares"] |
|
- | 211 | location_modes=["openlapi"] |
|
- | 212 | map_modes=["J2MEMap"] |
|
- | 213 | ||
- | 214 | when "gpstestall" |
|
- | 215 | screensizes=["240x320"] |
|
- | 216 | voice_modes=["en_speedy"] |
|
- | 217 | bluetooth_modes=["on"] |
|
- | 218 | devicecontrol_modes=["on"] |
|
- | 219 | fileapi_modes=["on"] |
|
- | 220 | cldc11_modes=["on"] |
|
- | 221 | firmware_modes=["no_firmwares"] |
|
- | 222 | location_modes=["jsr179","openlapi"] |
|
- | 223 | map_modes=["J2MEMap","no_map"] |
|
- | 224 | ||
74 | 225 | ||
75 | when "bltest" |
226 | when "bltest" |
- | 227 | screensizes=["240x320"] |
|
76 | screensizes=["240x320"] |
228 | # screensizes=["176x220"] |
77 | voice_modes=["en_speedy"] |
229 | voice_modes=["en_speedy"] |
78 | bluetooth_modes=["on"] |
230 | bluetooth_modes=["on"] |
79 | devicecontrol_modes=["on"] |
231 | devicecontrol_modes=["on"] |
80 | fileapi_modes=["on"] |
232 | fileapi_modes=["on"] |
81 | cldc11_modes=["on"] |
233 | cldc11_modes=["on"] |
- | 234 | firmware_modes=["all_firmwares"] |
|
- | 235 | # location_modes=["jsr179"] |
|
- | 236 | location_modes=["no_location"] |
|
- | 237 | # map_modes=["J2MEMap"] |
|
- | 238 | map_modes=["no_map"] |
|
- | 239 | ||
- | 240 | when "voicetest" |
|
- | 241 | screensizes=["240x320"] |
|
- | 242 | # screensizes=["176x220"] |
|
- | 243 | voice_modes=["new_en_speedy_tts"] |
|
- | 244 | bluetooth_modes=["on"] |
|
- | 245 | devicecontrol_modes=["on"] |
|
- | 246 | fileapi_modes=["on"] |
|
- | 247 | cldc11_modes=["on"] |
|
- | 248 | firmware_modes=["all_firmwares"] |
|
- | 249 | # location_modes=["jsr179"] |
|
- | 250 | location_modes=["no_location"] |
|
- | 251 | # map_modes=["J2MEMap"] |
|
- | 252 | map_modes=["no_map"] |
|
- | 253 | ||
- | 254 | ||
- | 255 | when "voiceall" |
|
- | 256 | ||
- | 257 | screensizes=["176x220","200x300","240x320","340x400","480x640"] |
|
- | 258 | # screensizes=["176x220"] |
|
- | 259 | voice_modes=["new_en_speedy_tts"] |
|
- | 260 | bluetooth_modes=["on"] |
|
- | 261 | devicecontrol_modes=["on"] |
|
- | 262 | fileapi_modes=["on"] |
|
- | 263 | cldc11_modes=["on"] |
|
- | 264 | firmware_modes=["no_firmwares"] |
|
- | 265 | location_modes=["jsr179"] |
|
- | 266 | # location_modes=["no_location"] |
|
- | 267 | map_modes=["J2MEMap"] |
|
- | 268 | # map_modes=["no_map"] |
|
- | 269 | ||
- | 270 | ||
- | 271 | when "n95" |
|
- | 272 | screensizes=["240x320"] |
|
- | 273 | # screensizes=["176x220"] |
|
- | 274 | voice_modes=["en_speedy"] |
|
- | 275 | bluetooth_modes=["on"] |
|
- | 276 | devicecontrol_modes=["on"] |
|
- | 277 | fileapi_modes=["on"] |
|
- | 278 | cldc11_modes=["on"] |
|
- | 279 | firmware_modes=["no_firmwares"] |
|
- | 280 | location_modes=["jsr179"] |
|
- | 281 | # location_modes=["no_location"] |
|
- | 282 | map_modes=["J2MEMap"] |
|
- | 283 | # map_modes=["no_map"] |
|
- | 284 | ||
Line 82... | Line 285... | ||
82 | firmware_modes=["all_firmwares"] |
285 | |
83 | 286 | ||
84 | when "test2" |
287 | when "test2" |
85 | screensizes=["176x220"] |
288 | screensizes=["176x220"] |
Line 115... | Line 318... | ||
115 | cldc11_modes=["on"] |
318 | cldc11_modes=["on"] |
116 | firmware_modes=["all_firmwares"] |
319 | firmware_modes=["all_firmwares"] |
117 | when "common" |
320 | when "common" |
118 | screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
321 | screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
119 | voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
322 | voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
- | 323 | bluetooth_modes=["on","off"] |
|
- | 324 | fileapi_modes=["on","off"] |
|
- | 325 | devicecontrol_modes=["on","off"] |
|
- | 326 | cldc11_modes=["on","off"] |
|
- | 327 | firmware_modes=["all_firmwares"] |
|
- | 328 | location_modes=["no_location","jsr179"] |
|
- | 329 | ||
- | 330 | when "all" |
|
- | 331 | screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
|
- | 332 | voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
|
- | 333 | bluetooth_modes=["on","off"] |
|
- | 334 | fileapi_modes=["on","off"] |
|
- | 335 | devicecontrol_modes=["on","off"] |
|
- | 336 | cldc11_modes=["on","off"] |
|
- | 337 | firmware_modes=["all_firmwares","no_firmwares","fc_mk3mag_firmwares"] |
|
- | 338 | location_modes=["no_location","jsr179","openlapi"] |
|
- | 339 | ||
- | 340 | ||
- | 341 | when "allinstaller" |
|
- | 342 | screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
|
- | 343 | voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
|
- | 344 | bluetooth_modes=["on","off"] |
|
- | 345 | fileapi_modes=["on","off"] |
|
- | 346 | devicecontrol_modes=["on","off"] |
|
- | 347 | cldc11_modes=["on","off"] |
|
- | 348 | firmware_modes=["all_firmwares","no_firmwares","fc_mk3mag_firmwares"] |
|
- | 349 | location_modes=["no_location","jsr179"] |
|
- | 350 | # map_modes=["no_map","J2MEMap"] |
|
- | 351 | map_modes=["no_map"] |
|
- | 352 | ||
- | 353 | ||
- | 354 | when "allwm" |
|
- | 355 | screensizes=["240x320","340x400","480x640"] |
|
- | 356 | voice_modes=["no_voice"] |
|
120 | bluetooth_modes=["on"] |
357 | bluetooth_modes=["on"] |
121 | fileapi_modes=["on"] |
358 | fileapi_modes=["off"] |
122 | devicecontrol_modes=["on"] |
359 | devicecontrol_modes=["off"] |
123 | cldc11_modes=["on"] |
360 | cldc11_modes=["on"] |
124 | firmware_modes=["all_firmwares"] |
361 | firmware_modes=["no_firmwares"] |
- | 362 | location_modes=["no_location"] |
|
- | 363 | map_modes=["J2MEMap"] |
|
- | 364 | ||
- | 365 | when "alloff" |
|
- | 366 | screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
|
- | 367 | voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
|
- | 368 | bluetooth_modes=["off"] |
|
- | 369 | fileapi_modes=["off"] |
|
- | 370 | devicecontrol_modes=["off"] |
|
- | 371 | cldc11_modes=["off"] |
|
- | 372 | firmware_modes=["all_firmwares","no_firmwares","fc_mk3mag_firmwares"] |
|
- | 373 | location_modes=["no_location"] |
|
Line 125... | Line 374... | ||
125 | 374 | ||
126 | else |
375 | else |
127 | # screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
376 | # screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
128 | # voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
377 | # voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
Line 138... | Line 387... | ||
138 | 387 | ||
139 | puts `mv build.props build.props.bak` |
388 | puts `mv build.props build.props.bak` |
140 | puts `ant clean` |
389 | puts `ant clean` |
Line 141... | Line -... | ||
141 | puts `mkdir #{bindir}` |
- | |
142 | 390 | puts `mkdir #{bindir}` |
|
- | 391 | ||
Line -... | Line 392... | ||
- | 392 | propertys={} |
|
- | 393 | allthreads=[] |
|
143 | 394 | ||
- | 395 | build_count= map_modes.length*location_modes.length* firmware_modes.length* cldc11_modes.length* devicecontrol_modes.length*fileapi_modes.length* bluetooth_modes.length* screensizes.length* voice_modes.length |
|
- | 396 | ||
- | 397 | puts "build_count: " + build_count.to_s |
|
- | 398 | sleep 1 |
|
144 | propertys={} |
399 | |
- | 400 | ||
145 | 401 | build=0 |
|
146 | firmware_modes.each {|firmware| |
402 | last_time=Time.now |
147 | cldc11_modes.each { |cldc11| |
403 | new_build=true |
148 | devicecontrol_modes.each { |devicecontrol| |
404 | reprocess_lib=true |
149 | fileapi_modes.each { |fileapi| |
405 | puts "cleaning ressources" |
Line 150... | Line -... | ||
150 | bluetooth_modes.each { |bluetooth| |
- | |
151 | screensizes.each { |screensize| |
406 | p `rm -rf tmp/res ` |
152 | voice_modes.each { |voice_mode| |
407 | p `mkdir tmp/res ` |
153 | 408 | p `cp -v res/langpacks/* tmp/res/` |
|
154 | p "cleaning ressources" |
409 | |
- | 410 | cldc11_modes.each { |cldc11| |
|
- | 411 | reprocess_lib=true |
|
- | 412 | ||
155 | p `rm -rf tmp/res` |
413 | ### modifiers from here wont affect the communicator-lib |
156 | p `mkdir tmp/res` |
414 | map_modes.each { |map_mode| |
Line -... | Line 415... | ||
- | 415 | location_modes.each {|location_mode| |
|
- | 416 | devicecontrol_modes.each { |devicecontrol| |
|
157 | 417 | fileapi_modes.each { |fileapi| |
|
- | 418 | bluetooth_modes.each { |bluetooth| |
|
Line 158... | Line -... | ||
158 | p `cp -v res/images_by_screensize/#{screensize}/* tmp/res/` |
- | |
159 | p `cp -v res/langpacks/* tmp/res/` |
- | |
Line -... | Line 419... | ||
- | 419 | ||
- | 420 | new_build=true |
|
- | 421 | ### modifiers from here wont affect source - just ressources |
|
- | 422 | voice_modes.each { |voice_mode| |
|
- | 423 | new_voice=true |
|
- | 424 | ||
- | 425 | ||
- | 426 | screensizes.each { |screensize| |
|
- | 427 | new_screensize=true |
|
- | 428 | ||
- | 429 | firmware_modes.each {|firmware| |
|
- | 430 | # new_firmwares=true |
|
- | 431 | build=build+1 |
|
- | 432 | last_time=Time.now |
|
- | 433 | ||
- | 434 | propertys["screensize"]=screensize |
|
- | 435 | ||
- | 436 | ||
- | 437 | # if allthreads.length>7 |
|
- | 438 | ||
160 | p `cp -v res/firmwares/#{firmware}/* tmp/res/` |
439 | # allthreads.each { |t| |
161 | 440 | # p "waiting for thread" + t.inspect |
|
162 | propertys["screensize"]=screensize |
441 | # t.join |
163 | 442 | # } |
|
164 | p "voice_mode" + voice_mode |
443 | # allthreads=[] |
- | 444 | # end |
|
- | 445 | ||
- | 446 | propertys["voice_mode"]=voice_mode |
|
165 | p "Screensize " + screensize |
447 | propertys["bluetooth"]=bluetooth |
166 | 448 | propertys["fileapi"]=fileapi |
|
167 | propertys["voice_mode"]=voice_mode |
449 | propertys["devicecontrol"]=devicecontrol |
- | 450 | propertys["cldc11"]=cldc11 |
|
- | 451 | propertys["version_major"]=version_major |
|
- | 452 | propertys["version_minor"]=version_minor |
|
- | 453 | propertys["version_patch"]=version_patch |
|
- | 454 | ||
- | 455 | ||
- | 456 | propertys["basename"]="DUBwise-#{screensize}-#{voice_mode}-#{firmware}" |
|
- | 457 | ||
- | 458 | if location_mode=="jsr179" |
|
- | 459 | propertys["basename"]+="-LocationAPI" |
|
- | 460 | end |
|
- | 461 | ||
- | 462 | if location_mode=="openlapi" |
|
- | 463 | propertys["basename"]+="-OpenLAPI" |
|
- | 464 | end |
|
- | 465 | ||
- | 466 | if location_mode=="jsr179" |
|
- | 467 | propertys["jsr179"]="on" |
|
- | 468 | else |
|
- | 469 | propertys["jsr179"]="off" |
|
- | 470 | end |
|
- | 471 | ||
- | 472 | ||
- | 473 | if location_mode=="openlapi" |
|
- | 474 | propertys["openlapi"]="on" |
|
- | 475 | else |
|
- | 476 | propertys["openlapi"]="off" |
|
- | 477 | end |
|
- | 478 | ||
- | 479 | if ((location_mode=="jsr179" ) || (location_mode=="openlapi" )) |
|
- | 480 | propertys["location"]="on" |
|
- | 481 | else |
|
- | 482 | propertys["location"]="off" |
|
- | 483 | end |
|
- | 484 | ||
168 | propertys["bluetooth"]=bluetooth |
485 | |
- | 486 | ||
- | 487 | ||
169 | propertys["fileapi"]=fileapi |
488 | propertys["basename"]+="-CLDC11" if cldc11=="on" |
170 | propertys["devicecontrol"]=devicecontrol |
489 | propertys["basename"]+="-FileAPI" if fileapi=="on" |
- | 490 | propertys["basename"]+="-BluetoothAPI" if bluetooth=="on" |
|
- | 491 | propertys["basename"]+="-DeviceControl" if devicecontrol=="on" |
|
- | 492 | propertys["basename"]+="-J2MEMap" if map_mode=="J2MEMap" |
|
- | 493 | ||
171 | propertys["cldc11"]=cldc11 |
494 | propertys["bin_path"]="#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}/#{location_mode}" |
172 | 495 | ||
173 | 496 | ||
- | 497 | ||
- | 498 | if new_build |
|
- | 499 | ||
- | 500 | puts "compiling" |
|
- | 501 | prefs_file= File.new("build.props","w") |
|
- | 502 | propertys.each_pair {|name,value| |
|
- | 503 | prefs_file << name+"="+value+"\n" |
|
- | 504 | } |
|
- | 505 | # prefs_file << "libs=lib/J2meMap_lib_cldc11.jar:lib/openlapi-jsr179-0.9.11.jar:lib/openlapi-0.9.11.jar\n" |
|
- | 506 | # prefs_file << "classes=lib/classes_with_fileapi_and_jsr179.zip\n" |
|
- | 507 | # prefs_file << "classes=lib/classes_with_fileapi.zip\n" |
|
- | 508 | ||
- | 509 | prefs_file.close |
|
- | 510 | ||
- | 511 | if reprocess_lib |
|
- | 512 | puts `ant preprocess_lib` |
|
- | 513 | reprocess_lib=false |
|
174 | propertys["basename"]="DUBwise-#{screensize}-#{cldc11=="on"?"cldc11":"cldc10"}-#{voice_mode}-#{firmware}-bluetooth_#{bluetooth}-fileapi_#{fileapi}-devicecontrol_#{devicecontrol}" |
514 | end |
- | 515 | ||
- | 516 | build_params="" |
|
- | 517 | build_params+=" -Dobfuscate=true" if obfuscate |
|
- | 518 | build_params+=" -Dobfuscate=false" if !obfuscate |
|
- | 519 | ||
- | 520 | ||
- | 521 | build_params+=" -Dlibs=" |
|
- | 522 | build_params+="lib/J2meMap_lib_cldc11.jar" if map_mode=="J2MEMap" |
|
- | 523 | # build_params+=":lib/openlapi-jsr179-0.9.11.jar:lib/openlapi-0.9.11.jar" if location_mode=="openlapi" |
|
- | 524 | ||
- | 525 | build_params+=":lib/openlapi-0.9.11.jar" if location_mode=="openlapi" |
|
- | 526 | ||
- | 527 | ||
- | 528 | if location_mode=="jsr179" |
|
- | 529 | build_params+=" -Djsr179=on" |
|
- | 530 | build_params+=" -Dclasses=lib/classes_with_fileapi_and_jsr179.zip" |
|
- | 531 | else |
|
- | 532 | build_params+=" -Dclasses=lib/classes_with_fileapi.zip" |
|
- | 533 | build_params+=" -Djsr179=off" |
|
- | 534 | end |
|
- | 535 | ||
- | 536 | if map_mode=="J2MEMap" |
|
- | 537 | build_params+=" -Dj2memap=on" |
|
- | 538 | else |
|
- | 539 | build_params+=" -Dj2memap=off" |
|
- | 540 | end |
|
- | 541 | ||
175 | p `cp -v res/voice_samples_by_name/#{voice_mode}/* tmp/res/` |
542 | |
176 | 543 | p propertys.inspect |
|
- | 544 | `ant #{build_params} build`.each_line { |
|
- | 545 | |l| puts l |
|
- | 546 | exit if (l =~ /\[wtkbuild\].*error/) |
|
- | 547 | ||
- | 548 | ||
- | 549 | } |
|
- | 550 | new_build=false |
|
- | 551 | ||
- | 552 | `rm -rf tmp/bin` |
|
- | 553 | `mkdir -p tmp/bin` |
|
- | 554 | ||
- | 555 | ||
- | 556 | # `mv build/bin/#{propertys["basename"]}.jar tmp/bin` |
|
- | 557 | `mv build/bin/#{propertys["basename"]}.jar tmp/bin/tmp.jar` |
|
- | 558 | # `advzip -z -4 #{advzip_flags} tmp/bin/tmp.jar` |
|
- | 559 | ||
- | 560 | `rm build/bin/#{propertys["basename"]}.jad` |
|
- | 561 | ||
- | 562 | # `cd tmp/bin ; unzip #{propertys["basename"]}.jar ; rm #{propertys["basename"]}.jar ; cd ../..` |
|
- | 563 | ||
- | 564 | # else |
|
- | 565 | # `ant only_jar`.each_line { |
|
- | 566 | # |l| puts l |
|
- | 567 | # exit if (l =~ /\[wtkbuild\].*error/) |
|
- | 568 | ||
- | 569 | # } |
|
- | 570 | ||
- | 571 | end # new build |
|
- | 572 | ||
- | 573 | ||
- | 574 | ||
Line 177... | Line 575... | ||
177 | 575 | # if new_firmwares |
|
Line 178... | Line 576... | ||
178 | prefs_file= File.new("build.props","w") |
576 | ### p `rm -rf tmp/bin/*.bin ` |
Line 179... | Line 577... | ||
179 | propertys.each_pair {|name,value| |
577 | ### p `cp -v res/firmwares/#{firmware}/* tmp/bin` |
Line -... | Line 578... | ||
- | 578 | ||
Line 180... | Line -... | ||
180 | p "writing props " + name+"="+value+"\n" |
- | |
- | 579 | p `cp -v tmp/bin/tmp.jar #{bindir}/#{propertys["basename"]}.jar` |
|
Line 181... | Line 580... | ||
181 | prefs_file << name+"="+value+"\n" |
580 | #exit |
182 | } |
- | |
183 | prefs_file.close |
- | |
Line -... | Line 581... | ||
- | 581 | # p `advzip #{advzip_flags} -a #{bindir}/#{propertys["basename"]}.jar res/images_by_screensize/#{screensize}/*` |
|
- | 582 | ||
- | 583 | # p `advzip #{advzip_flags} -a #{bindir}/#{propertys["basename"]}.jar res/voice_samples_by_name/#{voice_mode}/*` |
|
- | 584 | ||
- | 585 | # p `advzip #{advzip_flags} -a #{bindir}/#{propertys["basename"]}.jar res/firmwares/#{firmware}/*` |
|
- | 586 | ||
- | 587 | # p `advzip #{advzip_flags} -u #{bindir}/#{propertys["basename"]}.jar res/images_by_screensize/#{screensize}/* res/voice_samples_by_name/#{voice_mode}/* res/firmwares/#{firmware}/*` |
|
- | 588 | ||
- | 589 | ||
- | 590 | # p `advzip #{advzip_flags} -u #{bindir}/#{propertys["basename"]}.jar res/images_by_screensize/#{screensize}/* res/voice_samples_by_name/#{voice_mode}/* res/firmwares/#{firmware}/*` |
|
- | 591 | ||
- | 592 | # |
|
- | 593 | ||
- | 594 | # p `7z #{advzip_flags} a -x.svn* #{bindir}/#{propertys["basename"]}.jar res/images_by_screensize/#{screensize}/* res/voice_samples_by_name/#{voice_mode}/* res/firmwares/#{firmware}/*` |
|
- | 595 | ||
- | 596 | ||
- | 597 | # p `7z #{advzip_flags} a -x.svn* #{bindir}/#{propertys["basename"]}.jar res/images_by_screensize/#{screensize}/* res/voice_samples_by_name/#{voice_mode}/* res/firmwares/#{firmware}/*` |
|
- | 598 | ||
- | 599 | # allthreads<< Thread.new |
|
- | 600 | #{ |
|
- | 601 | ||
- | 602 | ||
- | 603 | ||
- | 604 | @basename=propertys["basename"] |
|
- | 605 | # ` mkdir tmp/#{@basename} ` |
|
- | 606 | @screensize=screensize |
|
- | 607 | @firmware=firmware |
|
- | 608 | @voice_mode=voice_mode |
|
- | 609 | ||
- | 610 | ||
- | 611 | ||
- | 612 | log "compressing images" |
|
- | 613 | log `cd res/images_by_screensize/#{@screensize} ; 7z a -x\!.svn* -w../../../tmp/ ../../../#{bindir}/#{@basename}.jar * ; cd ../../.. ` # res/images_by_screensize/#{screensize}/* res/voice_samples_by_name/#{voice_mode}/* res/firmwares/#{firmware}/*` |
|
- | 614 | ||
- | 615 | ||
- | 616 | log "compressing firmwares" |
|
- | 617 | log `cd res/firmwares/#{@firmware} && 7z a -x\!.svn* -w../../../tmp/ ../../../#{bindir}/#{@basename}.jar * && cd -` |
|
- | 618 | ||
- | 619 | log "compressing sounds" |
|
- | 620 | log `cd res/voice_samples_by_name/#{@voice_mode} ; 7z a -x\!.svn* -w../../../tmp/ ../../../#{bindir}/#{@basename}.jar * ; cd ../../..` |
|
- | 621 | ||
- | 622 | ||
- | 623 | # log "compressing images" |
|
- | 624 | # log `cd res/images_by_screensize/#{@screensize} ; 7z a -w../../../tmp/#{@basename} -x\!.svn* ../../../#{bindir}/#{@basename}.jar * ; cd ../../.. ` # res/images_by_screensize/#{screensize}/* res/voice_samples_by_name/#{voice_mode}/* res/firmwares/#{firmware}/*` |
|
- | 625 | ||
- | 626 | ||
- | 627 | # log "compressing firmwares" |
|
- | 628 | # log `cd res/firmwares/#{@firmware} ; 7z a -x\!.svn* -w../../../tmp/#{@basename} ../../../#{bindir}/#{@basename}.jar * ; cd ../../..` |
|
- | 629 | ||
- | 630 | # log "compressing sounds" |
|
- | 631 | # log `cd res/voice_samples_by_name/#{@voice_mode} ; 7z a -x\!.svn* -w../../../tmp/#{@basename}/ ../../../#{bindir}/#{@basename}.jar * ; cd ../../..` |
|
- | 632 | ||
- | 633 | ||
- | 634 | # end |
|
- | 635 | # new_screensize |
|
- | 636 | ### if new_screensize |
|
- | 637 | ### p `rm -rf tmp/bin/*.png ` |
|
- | 638 | ### p `rm -rf tmp/bin/*.jpg ` |
|
- | 639 | ### p `cp -v res/images_by_screensize/#{screensize}/* tmp/bin/` |
|
- | 640 | ### new_screensize=false |
|
- | 641 | ### end |
|
- | 642 | ### if new_voice |
|
- | 643 | ### p `rm tmp/bin/*.wav ` |
|
- | 644 | ### p `rm tmp/bin/*.mp3 ` |
|
- | 645 | ### p `cp -v res/voice_samples_by_name/#{voice_mode}/* tmp/bin/` |
|
- | 646 | ### new_voice=false |
|
- | 647 | ### end |
|
- | 648 | # p `advzip -4 -a #{bindir}/#{propertys["basename"]}.jar tmp/bin/` |
|
- | 649 | p "---------------" |
|
- | 650 | # normal zip is larger than advzip and not working on e.g. N80 ( took me som time to figure out) p `cd tmp/bin ; zip ../../#{bindir}/#{propertys["basename"]}.jar -r . ; cd ../..` |
|
- | 651 | ||
- | 652 | # p `cd tmp ; advzip -4 -a ../#{bindir}/#{propertys["basename"]}.jar bin/* ; cd ..` |
|
- | 653 | p "---------------" |
|
- | 654 | # `cp tmp/jad/*.jad #{bindir}/#{propertys["basename"]}.jad` |
|
- | 655 | ||
- | 656 | # puts "#{bindir} ----+ " + Dir.pwd |
|
- | 657 | jarsize=File.size("#{bindir}/#{@basename}.jar").to_s |
|
- | 658 | jad_file=File.new("#{bindir}/#{@basename}.jad","w+") |
|
- | 659 | ||
- | 660 | jad_file << "MIDlet-Jar-URL: #{@basename}.jar\n" |
|
- | 661 | jad_file << "MIDlet-Jar-Size: #{jarsize}\n" |
|
- | 662 | jad_file << "MIDlet-Name: DUBwise\n" |
|
- | 663 | jad_file << "MIDlet-Vendor: LiGi\n" |
|
- | 664 | jad_file << "MIDlet-Version: " + version_split[0..1].join(".") + "\n" |
|
- | 665 | jad_file << "MIDlet-1: DUBwise, i.png, DUBwise\n" |
|
- | 666 | jad_file << "MIDletX-No-Command: true\n" |
|
- | 667 | jad_file << "MIDlet-Icon: i.png\n" |
|
- | 668 | jad_file << "MIDlet-Install-Notify: http://ligi.selfip.org/ligi/mail?subject=DUBWiseInstallNotify&text=jarname_#{@basename}\n" |
|
- | 669 | jad_file << "MIDlet-Delete-Notify: http://ligi.selfip.org/ligi/mail?subject=DUBWiseDeleteNotify&text=jarname_#{@basename}\n" |
|
- | 670 | ||
- | 671 | jad_file.close |
|
- | 672 | ||
- | 673 | ||
- | 674 | puts "done build # " + build.to_s + "/" + build_count.to_s + " Time:" + (Time.now-last_time ).to_s + " overall: #{((Time.now-start_time)/60).to_i.to_s}:#{((Time.now-start_time)%60).to_i.to_s}" |
|
- | 675 | p "voice_mode" + voice_mode |
|
- | 676 | p "Screensize " + screensize |
|
- | 677 | p "size" + jarsize.to_s |
|
- | 678 | # } |
|
- | 679 | # `mkdir -p #{bindir}/#{propertys["bin_path"]}` |
|
- | 680 | ||
- | 681 | # `mv build/bin/#{propertys["basename"]}* #{bindir}/#{propertys["bin_path"]}` |
|
- | 682 | ||
- | 683 | ##`mkdir -p #{bindir}/#{propertys["bin_path"]}` |
|
- | 684 | ||
- | 685 | ##`mv build/bin/#{propertys["basename"]}* #{bindir}/#{propertys["bin_path"]}` |
|
- | 686 | ||
- | 687 | ||
184 | 688 | ###`mkdir -p #{bindir}/` |
|
185 | `ant build`.each_line { |l| puts l } |
689 | |
186 | 690 | ###`mv build/bin/#{propertys["basename"]}* #{bindir}/` |
|
187 | `mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
691 | |
188 | 692 | ||
- | 693 | # `mkdir -p #{bindir}/` |
|
- | 694 | ||
- | 695 | # `mv build/bin/#{propertys["basename"]}* #{bindir}/` |
|
- | 696 | ||
- | 697 | } |
|
- | 698 | ||
189 | # `mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
699 | build_new=true if voice_mode!="no_voice" |
- | 700 | ||
- | 701 | } |
|
190 | 702 | } |
|
- | 703 | } |
|
- | 704 | } |
|
- | 705 | } |
|
- | 706 | } |
|
- | 707 | } |
|
- | 708 | } |
|
- | 709 | ||
- | 710 | sleep 3 |
|
- | 711 | puts "Joining all open threads (" + allthreads.length.to_s + "open)" + `pwd` |
|
- | 712 | #sleep allthreads.length |
|
- | 713 | allthreads.each { |t| |
|
- | 714 | t.join |
|
- | 715 | } |
|
- | 716 | allthreads=[] |