Fixed droidgap update command

This commit is contained in:
Nitobi 2011-06-03 10:59:48 -07:00 committed by Joe Bowser
parent 088c342198
commit 3c90a9a23c

View File

@ -33,12 +33,19 @@ class Update
# TODO need to allow for www import inc icon # TODO need to allow for www import inc icon
def copy_libs def copy_libs
puts "Copying over libraries and assets..." puts "Copying over libraries and assets..."
version = IO.read(File.join(@framework_dir, '../VERSION'))
FileUtils.mkdir_p File.join(@path, "libs") FileUtils.cp File.join(@framework_dir, "phonegap.#{ version }.jar"), File.join(@path, "libs")
FileUtils.cp File.join(@framework_dir, "phonegap.jar"), File.join(@path, "libs")
FileUtils.mkdir_p File.join(@path, "assets", "www") # concat JS and put into www folder. this can be overridden in the config.xml via @app_js_dir
FileUtils.cp File.join(@framework_dir, "assets", "www", "phonegap.js"), File.join(@path, "assets", "www") js_dir = File.join(@framework_dir, "assets", "js")
phonegapjs = IO.read(File.join(js_dir, 'phonegap.js.base'))
Dir.new(js_dir).entries.each do |script|
next if script[0].chr == "." or script == "phonegap.js.base"
phonegapjs << IO.read(File.join(js_dir, script))
phonegapjs << "\n\n"
end
File.open(File.join(@path, "assets", "www", "phonegap.#{ version }.js"), 'w') {|f| f.write(phonegapjs) }
end end
# #
end end