cleanup continued

This commit is contained in:
Brian LeRoux 2010-01-26 16:24:35 -08:00
parent e3dc010b97
commit 923c29aa2b
4 changed files with 10 additions and 11 deletions

View File

@ -11,12 +11,11 @@ class Build
write_java write_java
end end
# creates framework/phonegap.jar using android_sdk_path # removes local.properties and recreates based on android_sdk_path
# # then generates framework/phonegap.jar
# TODO
# - write out local.properties with android sdk every time
def build_jar def build_jar
`touch #{ @android_sdk_path }` unless File.exists? @android_sdk_path `rm framework/local.properties`
`ECHO 'sdk-location=#{ @android_sdk_path }' > framework/local.properties`
`ant jar` `ant jar`
end end
@ -31,7 +30,7 @@ class Build
open('framework/AndroidManifest.xml', 'r') do |old| open('framework/AndroidManifest.xml', 'r') do |old|
manifest = old.read manifest = old.read
manifest.gsub! 'package="com.phonegap"', "package=\"#{ @pkg }\"" manifest.gsub! 'package="com.phonegap"', "package=\"#{ @pkg }\""
manifest.gsub! 'android:name=".StandAlone"', ".#{ @name }" manifest.gsub! 'android:name=".StandAlone"', "android:name=\".#{ @name }\""
end end
open("#{ @path }/AndroidManifest.xml", 'w') {|x| x.puts manifest } open("#{ @path }/AndroidManifest.xml", 'w') {|x| x.puts manifest }
end end
@ -80,10 +79,10 @@ if(ARGV.length == 5)
else else
puts <<-EOF puts <<-EOF
DroidGap: An Android PhoneGap Project Generator DroidGap: PhoneGap/Android Project Generator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creates a fresh Android/PhoneGap app for hybrid mobile web hacking. Creates a fresh app for hybrid mobile web hacking. Delicious robot!
Usage: Usage:
@ -94,8 +93,8 @@ else
android_sdk_path ... The path to your Android SDK install. android_sdk_path ... The path to your Android SDK install.
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 name of your Web App. www ................ The path to your www folder. (Wherein your HTML, CSS and JS app is.)
path ............... Location of where you want to work on your application. path ............... The path to generate the application.
EOF EOF
end end