diff --git a/bin/create b/bin/create index 8351ebd9..d8b4a7b1 100755 --- a/bin/create +++ b/bin/create @@ -43,4 +43,4 @@ ACTIVITY=$ACTIVITY TARGET=$TARGET eom -(cd $PROJECT_PATH && ./bin/create) \ No newline at end of file +(cd $PROJECT_PATH && ./phonegap/create) diff --git a/bin/templates/project/.phonegap/android/readme.md b/bin/templates/project/.phonegap/android/readme.md new file mode 100644 index 00000000..152f5a5f --- /dev/null +++ b/bin/templates/project/.phonegap/android/readme.md @@ -0,0 +1 @@ +ok... diff --git a/bin/templates/project/.phonegap/readme.md b/bin/templates/project/.phonegap/readme.md new file mode 100644 index 00000000..7028aab8 --- /dev/null +++ b/bin/templates/project/.phonegap/readme.md @@ -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! diff --git a/bin/templates/project/bin/create b/bin/templates/project/phonegap/create similarity index 84% rename from bin/templates/project/bin/create rename to bin/templates/project/phonegap/create index 7f398bfa..553a5b55 100755 --- a/bin/templates/project/bin/create +++ b/bin/templates/project/phonegap/create @@ -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" \ No newline at end of file +find "$MANIFEST_PATH" | xargs grep '__PACKAGE__' -sl | xargs -L1 sed -i "" "s/__PACKAGE__/${PACKAGE}/g" diff --git a/bin/templates/project/bin/debug b/bin/templates/project/phonegap/debug similarity index 100% rename from bin/templates/project/bin/debug rename to bin/templates/project/phonegap/debug diff --git a/bin/templates/project/bin/emulate b/bin/templates/project/phonegap/emulate similarity index 100% rename from bin/templates/project/bin/emulate rename to bin/templates/project/phonegap/emulate diff --git a/bin/templates/project/bin/log b/bin/templates/project/phonegap/log similarity index 100% rename from bin/templates/project/bin/log rename to bin/templates/project/phonegap/log diff --git a/bin/templates/project/bin/templates/Activity.java b/bin/templates/project/phonegap/templates/Activity.java similarity index 100% rename from bin/templates/project/bin/templates/Activity.java rename to bin/templates/project/phonegap/templates/Activity.java diff --git a/bin/templates/project/bin/templates/project/AndroidManifest.xml b/bin/templates/project/phonegap/templates/project/AndroidManifest.xml similarity index 100% rename from bin/templates/project/bin/templates/project/AndroidManifest.xml rename to bin/templates/project/phonegap/templates/project/AndroidManifest.xml diff --git a/bin/templates/project/bin/templates/project/assets/www/index.html b/bin/templates/project/phonegap/templates/project/assets/www/index.html similarity index 100% rename from bin/templates/project/bin/templates/project/assets/www/index.html rename to bin/templates/project/phonegap/templates/project/assets/www/index.html diff --git a/bin/templates/project/bin/templates/project/assets/www/main.js b/bin/templates/project/phonegap/templates/project/assets/www/main.js similarity index 100% rename from bin/templates/project/bin/templates/project/assets/www/main.js rename to bin/templates/project/phonegap/templates/project/assets/www/main.js diff --git a/bin/templates/project/bin/templates/project/assets/www/master.css b/bin/templates/project/phonegap/templates/project/assets/www/master.css similarity index 100% rename from bin/templates/project/bin/templates/project/assets/www/master.css rename to bin/templates/project/phonegap/templates/project/assets/www/master.css diff --git a/bin/templates/project/bin/templates/project/res/xml/plugins.xml b/bin/templates/project/phonegap/templates/project/res/xml/plugins.xml similarity index 100% rename from bin/templates/project/bin/templates/project/res/xml/plugins.xml rename to bin/templates/project/phonegap/templates/project/res/xml/plugins.xml diff --git a/bin/tests/create.coffee b/bin/tests/create.coffee index 9cb596e0..746e07b2 100644 --- a/bin/tests/create.coffee +++ b/bin/tests/create.coffee @@ -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()