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