droidgap parses the output of android list targets to find the id for 'android-5' or defaults to 5 if it can't find the id in the output

This commit is contained in:
Immad Naseer 2010-02-17 15:31:40 -08:00
parent 37c3c2528d
commit 594e77690c

View File

@ -45,7 +45,9 @@ class Build
def create_android
puts "Creating Android project..."
`android create project -t 5 -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`
target_id = `android list targets` =~ /id:\s*(\d+).*android-5/ ? $1 : 5
`android create project -t #{target_id} -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`
FileUtils.mkdir_p File.join(@path, "assets", "www")
FileUtils.cp_r File.join(@www, "."), File.join(@path, "assets", "www")