Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
206 | ligi | 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 |
||
7 | |||
8 | |||
9 | resdir="res/" |
||
10 | |||
11 | |||
219 | ligi | 12 | if ARGV.length==2 |
13 | bindir=ARGV[1] |
||
242 | ligi | 14 | puts `rm -rf #{bindir}` |
219 | ligi | 15 | else |
16 | bindir="bin" |
||
17 | end |
||
18 | |||
19 | |||
206 | ligi | 20 | ARGV<<"" if ARGV==[] |
21 | case ARGV[0] |
||
22 | when "p910" |
||
23 | screensizes=["200x300"] |
||
24 | voice_modes=["en_speedy"] |
||
25 | bluetooth_modes=["off"] |
||
26 | devicecontrol_modes=["off"] |
||
27 | fileapi_modes=["off"] |
||
28 | cldc11_modes=["off"] |
||
29 | |||
30 | when "test" |
||
31 | screensizes=["240x320"] |
||
32 | voice_modes=["en_speedy"] |
||
33 | bluetooth_modes=["on"] |
||
34 | devicecontrol_modes=["on"] |
||
35 | fileapi_modes=["on"] |
||
36 | cldc11_modes=["on"] |
||
37 | #firmware_modes=["fc_mk3mag_firmwares"] |
||
219 | ligi | 38 | #firmware_modes=["all_firmwares"] |
39 | firmware_modes=["no_firmwares"] |
||
206 | ligi | 40 | |
245 | ligi | 41 | when "wtk" |
42 | screensizes=["240x320"] |
||
43 | voice_modes=["en_wav"] |
||
44 | bluetooth_modes=["on"] |
||
45 | devicecontrol_modes=["on"] |
||
46 | fileapi_modes=["on"] |
||
47 | cldc11_modes=["on"] |
||
48 | #firmware_modes=["fc_mk3mag_firmwares"] |
||
49 | #firmware_modes=["all_firmwares"] |
||
50 | firmware_modes=["all_firmwares"] |
||
51 | |||
219 | ligi | 52 | when "bltest" |
53 | screensizes=["240x320"] |
||
54 | voice_modes=["en_speedy"] |
||
55 | bluetooth_modes=["on"] |
||
56 | devicecontrol_modes=["on"] |
||
57 | fileapi_modes=["on"] |
||
58 | cldc11_modes=["on"] |
||
59 | firmware_modes=["all_firmwares"] |
||
60 | |||
206 | ligi | 61 | when "test2" |
62 | screensizes=["176x220"] |
||
63 | voice_modes=["en_speedy"] |
||
64 | bluetooth_modes=["on"] |
||
65 | devicecontrol_modes=["on"] |
||
66 | fileapi_modes=["on"] |
||
67 | cldc11_modes=["on"] |
||
68 | firmware_modes=["all_firmwares"] |
||
69 | |||
70 | when "off" |
||
71 | screensizes=["240x320"] |
||
72 | voice_modes=["en_speedy"] |
||
73 | bluetooth_modes=["off"] |
||
74 | devicecontrol_modes=["off"] |
||
75 | fileapi_modes=["off"] |
||
76 | cldc11_modes=["off"] |
||
77 | |||
78 | when "alloff" |
||
79 | screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
||
245 | ligi | 80 | voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
206 | ligi | 81 | bluetooth_modes=["off"] |
82 | devicecontrol_modes=["off"] |
||
83 | fileapi_modes=["off"] |
||
84 | cldc11_modes=["off"] |
||
85 | |||
86 | when "n80" |
||
87 | bluetooth_modes=["on"] |
||
88 | screensizes=["340x400"] |
||
89 | voice_modes=["en_speedy"] |
||
90 | fileapi_modes=["on"] |
||
91 | devicecontrol_modes=["on"] |
||
92 | cldc11_modes=["on"] |
||
93 | firmware_modes=["all_firmwares"] |
||
94 | when "common" |
||
95 | screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
||
245 | ligi | 96 | voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
206 | ligi | 97 | bluetooth_modes=["on"] |
98 | fileapi_modes=["on"] |
||
99 | devicecontrol_modes=["on"] |
||
100 | cldc11_modes=["on"] |
||
101 | firmware_modes=["all_firmwares"] |
||
102 | |||
103 | else |
||
242 | ligi | 104 | # screensizes=["128x128","176x220","200x300","240x320","340x400","480x640"] |
245 | ligi | 105 | # voice_modes=["no_voice","de_tts","de_64kbit_tts","en_speedy","en_wav","de_wav"] |
242 | ligi | 106 | # bluetooth_modes=["on","off"] |
107 | # fileapi_modes=["on","off"] |
||
108 | # devicecontrol_modes=["on","off"] |
||
109 | # cldc11_modes=["on","off"] |
||
110 | # firmware_modes=["no_firmwares","fc_mk3mag_firmware","all_firmwares"] |
||
111 | puts "no valid profile given" |
||
112 | exit |
||
206 | ligi | 113 | end |
114 | |||
115 | |||
219 | ligi | 116 | puts `mv build.props build.props.bak` |
117 | puts `ant clean` |
||
118 | puts `mkdir #{bindir}` |
||
206 | ligi | 119 | |
120 | |||
121 | propertys={} |
||
122 | |||
123 | firmware_modes.each {|firmware| |
||
124 | cldc11_modes.each { |cldc11| |
||
125 | devicecontrol_modes.each { |devicecontrol| |
||
126 | fileapi_modes.each { |fileapi| |
||
127 | bluetooth_modes.each { |bluetooth| |
||
128 | screensizes.each { |screensize| |
||
129 | voice_modes.each { |voice_mode| |
||
130 | |||
131 | p "cleaning ressources" |
||
132 | p `rm -rf tmp/res` |
||
133 | p `mkdir tmp/res` |
||
134 | |||
135 | p `cp -v res/images_by_screensize/#{screensize}/* tmp/res/` |
||
255 | ligi | 136 | p `cp -v res/langpacks/* tmp/res/` |
206 | ligi | 137 | p `cp -v res/firmwares/#{firmware}/* tmp/res/` |
138 | |||
139 | propertys["screensize"]=screensize |
||
140 | |||
141 | p "voice_mode" + voice_mode |
||
142 | p "Screensize " + screensize |
||
143 | |||
144 | propertys["voice_mode"]=voice_mode |
||
145 | propertys["bluetooth"]=bluetooth |
||
146 | propertys["fileapi"]=fileapi |
||
147 | propertys["devicecontrol"]=devicecontrol |
||
148 | propertys["cldc11"]=cldc11 |
||
149 | |||
150 | |||
151 | propertys["basename"]="DUBwise-#{screensize}-#{cldc11=="on"?"cldc11":"cldc10"}-#{voice_mode}-#{firmware}-bluetooth_#{bluetooth}-fileapi_#{fileapi}-devicecontrol_#{devicecontrol}" |
||
152 | p `cp -v res/voice_samples_by_name/#{voice_mode}/* tmp/res/` |
||
153 | |||
154 | |||
155 | prefs_file= File.new("build.props","w") |
||
156 | propertys.each_pair {|name,value| |
||
157 | p "writing props " + name+"="+value+"\n" |
||
158 | prefs_file << name+"="+value+"\n" |
||
159 | } |
||
160 | prefs_file.close |
||
161 | |||
162 | `ant build`.each_line { |l| puts l } |
||
163 | |||
219 | ligi | 164 | `mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 165 | |
219 | ligi | 166 | # `mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 167 | |
168 | |||
169 | |||
219 | ligi | 170 | `mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 171 | |
219 | ligi | 172 | `mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 173 | |
174 | } |
||
175 | |||
176 | |||
177 | } |
||
178 | } |
||
179 | } |
||
180 | } |
||
181 | } |
||
182 | } |
||
183 | puts `mv -v build.props.bak build.props` |
||
184 |