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