added target to the droidgap script and updated the readme and getting started wiki page

This commit is contained in:
Dave Johnson 2010-06-28 16:02:10 -07:00
parent 310766180f
commit 8ec0de457f
2 changed files with 5 additions and 5 deletions

View File

@ -19,9 +19,10 @@ Getting Started with PhoneGap/Android
1. From the root of this repo run the following command to generate a new PhoneGap/Android app: 1. From the root of this repo run the following command to generate a new PhoneGap/Android app:
<pre> <pre>
./droidgap [android_sdk_path] [name] [package_name] [www] [path] ./droidgap [android_sdk_path] [target] [name] [package_name] [www] [path]
android_sdk_path ... The path to your Android SDK install. android_sdk_path ... The path to your Android SDK install.
target ......................The target version of the Android platform (3, 4, 6, 7, 8 correspond to 1.5, 1.6, 2.0.1, 2.1, 2.2).
name ............... The name of your application. name ............... The name of your application.
package_name ....... The name of your package (For example: com.nitobi.demo) package_name ....... The name of your package (For example: com.nitobi.demo)
www ................ The path to your www folder. (Wherein your HTML, CSS and JS app is.) www ................ The path to your www folder. (Wherein your HTML, CSS and JS app is.)

View File

@ -3,10 +3,10 @@ require 'fileutils'
# ./droidgap /Users/brianleroux/Code/android-sdk-mac MyApp com.westcoastlogic example /Users/brianleroux/Desktop/MyApp # ./droidgap /Users/brianleroux/Code/android-sdk-mac MyApp com.westcoastlogic example /Users/brianleroux/Desktop/MyApp
class Build class Build
attr_reader :android_sdk_path, :name, :pkg, :www, :path attr_reader :android_sdk_path, :name, :pkg, :www, :path, :target_id
def initialize(*a) def initialize(*a)
@android_sdk_path, @name, @pkg, @www, @path = a @android_sdk_path, @target, @name, @pkg, @www, @path = a
@android_dir = File.expand_path(File.dirname(__FILE__)) @android_dir = File.expand_path(File.dirname(__FILE__))
@framework_dir = File.join(@android_dir, "framework") @framework_dir = File.join(@android_dir, "framework")
end end
@ -44,9 +44,8 @@ class Build
# TODO fix 'android' shell call so that it works on Windows. Can't prepend android command with path to it. # TODO fix 'android' shell call so that it works on Windows. Can't prepend android command with path to it.
def create_android def create_android
android_exec = File.join(@android_sdk_path, "tools", "android"); android_exec = File.join(@android_sdk_path, "tools", "android");
target_id = 5
puts "Creating Android project for target level #{ target_id }" puts "Creating Android project for target level #{ target_id }"
`android create project -t #{ target_id } -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }` `android create project -t #{ @target_id } -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`
end end
def include_www def include_www