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/` |
||
136 | p `cp -v res/firmwares/#{firmware}/* tmp/res/` |
||
137 | |||
138 | propertys["screensize"]=screensize |
||
139 | |||
140 | p "voice_mode" + voice_mode |
||
141 | p "Screensize " + screensize |
||
142 | |||
143 | propertys["voice_mode"]=voice_mode |
||
144 | propertys["bluetooth"]=bluetooth |
||
145 | propertys["fileapi"]=fileapi |
||
146 | propertys["devicecontrol"]=devicecontrol |
||
147 | propertys["cldc11"]=cldc11 |
||
148 | |||
149 | |||
150 | propertys["basename"]="DUBwise-#{screensize}-#{cldc11=="on"?"cldc11":"cldc10"}-#{voice_mode}-#{firmware}-bluetooth_#{bluetooth}-fileapi_#{fileapi}-devicecontrol_#{devicecontrol}" |
||
151 | p `cp -v res/voice_samples_by_name/#{voice_mode}/* tmp/res/` |
||
152 | |||
153 | |||
154 | prefs_file= File.new("build.props","w") |
||
155 | propertys.each_pair {|name,value| |
||
156 | p "writing props " + name+"="+value+"\n" |
||
157 | prefs_file << name+"="+value+"\n" |
||
158 | } |
||
159 | prefs_file.close |
||
160 | |||
161 | `ant build`.each_line { |l| puts l } |
||
162 | |||
219 | ligi | 163 | `mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 164 | |
219 | ligi | 165 | # `mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 166 | |
167 | |||
168 | |||
219 | ligi | 169 | `mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 170 | |
219 | ligi | 171 | `mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}` |
206 | ligi | 172 | |
173 | } |
||
174 | |||
175 | |||
176 | } |
||
177 | } |
||
178 | } |
||
179 | } |
||
180 | } |
||
181 | } |
||
182 | puts `mv -v build.props.bak build.props` |
||
183 |