Subversion Repositories Projects

Rev

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