From 594e77690c3ea072feb173168127c8c4fe83aeec Mon Sep 17 00:00:00 2001 From: Immad Naseer Date: Wed, 17 Feb 2010 15:31:40 -0800 Subject: [PATCH] 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 --- droidgap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/droidgap b/droidgap index f599c575..03367e16 100755 --- a/droidgap +++ b/droidgap @@ -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")