-
Notifications
You must be signed in to change notification settings - Fork 237
/
upgrade-rhodes-app
executable file
·48 lines (40 loc) · 1.52 KB
/
upgrade-rhodes-app
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env ruby
require 'rubygems'
require 'fileutils'
include FileUtils
puts File.dirname(__FILE__)
appname = pwd.gsub(/\\/, "/").split("/")[-1]
$app_config = YAML::load_file("build.yml")
unless $app_config["env"].nil? #if env is here then it is an old app
new_config = Hash.new
new_config["sdk"] = File.expand_path(File.dirname(__FILE__) + "/../")
new_config["name"] = appname
new_config["version"] = $app_config["env"]["version"]
new_config["vendor"] = $app_config["env"]["vendor"]
new_config["bbver"] = $app_config["env"]["bbver"]
new_config["applog"] = $app_config["env"]["applog"]
new_config["iphone"] = Hash.new
new_config["iphone"]["configuration"] = "Debug"
new_config["iphone"]["sdk"] = "iphonesimulator3.0"
new_config["iphone"]["codesignidentity"] = ""
new_config["iphone"]["entitlements"] = ""
$app_config = new_config
File.open( 'build.yml', 'w' ) do |out|
YAML.dump( $app_config, out )
end
end
unless File.exists? "icon/icon.png"
mkdir_p "icon" unless File.exists? "icon"
cp File.dirname(__FILE__) + '/../res/generators/templates/application/icon/icon.ico', 'icon/'
cp File.dirname(__FILE__) + '/../res/generators/templates/application/icon/icon.png', 'icon/'
end
cp File.dirname(__FILE__) + '/../res/generators/templates/application/Rakefile', 'Rakefile'
oldrhoconfig = IO.read("rhoconfig.txt")
newrhoconfig = File.open("rhoconfig.txt","w") do |f|
oldrhoconfig.each_line do |line|
unless line =~ /^require/
line.gsub!(/Rho::RhoConfig\./,"")
f.write line
end
end
end