mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 12:03:28 +08:00
cleanup for merge
This commit is contained in:
parent
9185848cbc
commit
8163416e27
@ -30,11 +30,10 @@ class Create
|
|||||||
raise 'No index.html found!' unless File.exists? File.join(path, 'index.html')
|
raise 'No index.html found!' unless File.exists? File.join(path, 'index.html')
|
||||||
|
|
||||||
# setup default vars
|
# setup default vars
|
||||||
@name = path.split("/").last.gsub('-','')
|
@name = path.split("/").last.gsub('-','').gsub(' ','') # no dashses nor spaces
|
||||||
@path = File.join(path, '..', "#{ name }-android")
|
@path = File.join(path, '..', "#{ @name }_android")
|
||||||
@www = path
|
@www = path
|
||||||
@name = path.split('/').last
|
@pkg = "com.phonegap.#{ @name }"
|
||||||
@pkg = "com.phonegap.#{ name }"
|
|
||||||
|
|
||||||
# android sdk discovery ... could be better
|
# android sdk discovery ... could be better
|
||||||
@android_sdk_path = Dir.getwd[0,1] != "/" ? `android-sdk-path.bat android.bat`.gsub('\\tools','').gsub('\\', '\\\\\\\\') : `which android`.gsub('/tools/android','')
|
@android_sdk_path = Dir.getwd[0,1] != "/" ? `android-sdk-path.bat android.bat`.gsub('\\tools','').gsub('\\', '\\\\\\\\') : `which android`.gsub('/tools/android','')
|
||||||
@ -111,7 +110,8 @@ class Create
|
|||||||
# TODO need to allow more flexible SDK targetting via config.xml
|
# TODO need to allow more flexible SDK targetting via config.xml
|
||||||
def create_android
|
def create_android
|
||||||
target_id = `android list targets | grep id:`.split("\n").last.match(/\d/).to_a.first
|
target_id = `android list targets | grep id:`.split("\n").last.match(/\d/).to_a.first
|
||||||
`android create project -t #{ target_id } -k #{ @pkg } -a #{ @name } -n #{ @name.gsub(' ','') } -p #{ @path }`
|
puts "NAME #{@name}"
|
||||||
|
`android create project -t #{ target_id } -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`
|
||||||
end
|
end
|
||||||
|
|
||||||
# copies the project/www folder into tmp/android/www
|
# copies the project/www folder into tmp/android/www
|
||||||
|
Loading…
Reference in New Issue
Block a user