cli moving to a phonegap folder, local to the proj and tests

This commit is contained in:
brianleroux 2011-09-01 14:34:11 -07:00
parent e7f206b598
commit d34dcf8ee5
14 changed files with 22 additions and 7 deletions

View File

@ -43,4 +43,4 @@ ACTIVITY=$ACTIVITY
TARGET=$TARGET
eom
(cd $PROJECT_PATH && ./bin/create)
(cd $PROJECT_PATH && ./phonegap/create)

View File

@ -0,0 +1 @@
ok...

View File

@ -0,0 +1,3 @@
this is local config for phonegap stuff to be eventually moved to
config.xml ...we think. feedback to @davejohnson/@brianleroux
appreciated here!

View File

@ -16,8 +16,8 @@ MANIFEST_PATH=./AndroidManifest.xml
# create the project
android create project --target $TARGET --path . --package $PACKAGE --activity $ACTIVITY
# copy all the bin scripts etc in there
cp -R ./bin/templates/project/ .
# copy all the phonegap scripts etc in there
cp -R ./phonegap/templates/project/ .
# copy in phonegap.js
cp ./.phonegap/android/phonegap-$VERSION.js ./assets/www
@ -26,11 +26,11 @@ cp ./.phonegap/android/phonegap-$VERSION.js ./assets/www
cp ./.phonegap/android/phonegap-$VERSION.jar ./libs
# copy in default activity
cat ./bin/templates/Activity.java > $ACTIVITY_PATH
cat ./phonegap/templates/Activity.java > $ACTIVITY_PATH
# interpolate the acivity name and package
find "$ACTIVITY_PATH" | xargs grep '__ACTIVITY__' -sl | xargs -L1 sed -i "" "s/__ACTIVITY__/${ACTIVITY}/g"
find "$ACTIVITY_PATH" | xargs grep '__ID__' -sl | xargs -L1 sed -i "" "s/__ID__/${PACKAGE}/g"
find "$MANIFEST_PATH" | xargs grep '__ACTIVITY__' -sl | xargs -L1 sed -i "" "s/__ACTIVITY__/${ACTIVITY}/g"
find "$MANIFEST_PATH" | xargs grep '__PACKAGE__' -sl | xargs -L1 sed -i "" "s/__PACKAGE__/${PACKAGE}/g"
find "$MANIFEST_PATH" | xargs grep '__PACKAGE__' -sl | xargs -L1 sed -i "" "s/__PACKAGE__/${PACKAGE}/g"

View File

@ -1,6 +1,6 @@
util = require('util')
util = require 'util'
exec = require('child_process').exec
path = require 'path'
exports['default example project is generated'] = (test) ->
test.expect 1
@ -8,3 +8,14 @@ exports['default example project is generated'] = (test) ->
test.ok true, "this assertion should pass" unless error?
test.done()
exports['default example project has a ./.phonegap folder'] = (test) ->
test.expect 1
path.exists './example/.phonegap', (exists) ->
test.ok exists, 'the phonegap folder exists'
test.done()
exports['default example project has a /phonegap folder'] = (test) ->
test.expect 1
path.exists './example/phonegap', (exists) ->
test.ok exists, 'the other phonegap folder exists'
test.done()