cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwbro...@apache.org
Subject git commit: [CB-3228] Fix 'cordova build blackberry' to use cordova.js
Date Fri, 26 Apr 2013 23:20:33 GMT
Updated Branches:
  refs/heads/master d2b211451 -> 87dcfe6c3


[CB-3228] Fix 'cordova build blackberry' to use cordova.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/87dcfe6c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/87dcfe6c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/87dcfe6c

Branch: refs/heads/master
Commit: 87dcfe6c37c0f027bc394410b6648e1a6d972926
Parents: d2b2114
Author: Michael Brooks <michael@michaelbrooks.ca>
Authored: Fri Apr 26 16:19:16 2013 -0700
Committer: Michael Brooks <michael@michaelbrooks.ca>
Committed: Fri Apr 26 16:19:16 2013 -0700

----------------------------------------------------------------------
 lib/cordova-blackberry/bin/create |    2 +-
 src/metadata/blackberry_parser.js |   44 +++++++++++++-------------------
 2 files changed, 19 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/87dcfe6c/lib/cordova-blackberry/bin/create
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create b/lib/cordova-blackberry/bin/create
index 54903b8..ca84dc8 100755
--- a/lib/cordova-blackberry/bin/create
+++ b/lib/cordova-blackberry/bin/create
@@ -93,7 +93,7 @@ then
     fi
     
 	echo "Creating BlackBerry project..."
-	(cd "$BUILD_PATH" && "$ANT" create -Dproject.path="$PROJECT_PATH" &> /dev/null
)
+	("$ANT" create -Dproject.path="$PROJECT_PATH" -f "$BUILD_PATH/build.xml" &> /dev/null)
     # interpolate the activity and package into config.xml
     echo "Updating config.xml ..."
     replace "s/__NAME__/${NAME}/g" "$MANIFEST_PATH"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/87dcfe6c/src/metadata/blackberry_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/blackberry_parser.js b/src/metadata/blackberry_parser.js
index b2cad4b..3d8b578 100644
--- a/src/metadata/blackberry_parser.js
+++ b/src/metadata/blackberry_parser.js
@@ -94,33 +94,25 @@ module.exports.prototype = {
         var www = path.join(projectRoot, 'www');
         var platformWww = this.www_dir();
 
-        var finalWww = path.join(this.path, 'finalwww');
-        shell.mkdir('-p', finalWww);
-
-        // replace stock bb app contents with app contents. 
-        // to keep:
-        //        - config.xml
-        //        - cordova.js
-        //        - ext*
-        //        - plugins.xml
-        //        - res
-        shell.cp('-f', path.join(platformWww, 'config.xml'), finalWww);
-        shell.cp('-f', path.join(platformWww, 'cordova-*.js'), finalWww);
-        shell.cp('-f', path.join(platformWww, 'plugins.xml'), finalWww);
-        shell.cp('-rf', path.join(platformWww, 'ext*'), finalWww);
-        shell.cp('-rf', path.join(platformWww, 'res'), finalWww);
-
-        // Copy everything over from platform-agnostic www, except config.xml
-        var cfg_www = path.join(www, 'config.xml');
-        var temp_cfg = path.join(projectRoot, 'config.xml');
-        shell.mv(cfg_www, temp_cfg);
-        shell.cp('-rf', path.join(www, '*'), finalWww);
-        shell.mv(temp_cfg, cfg_www);
-
-        // Delete the old platform www, and move the final project over
-        shell.rm('-rf', platformWww);
-        shell.mv(finalWww, platformWww);
+        // remove the stock www folder
+        shell.rm('-rf', this.www_dir());
 
+        // copy over project www assets
+        shell.cp('-rf', www, this.path);
+
+        // add cordova.js
+        shell.cp('-f', path.join(util.libDirectory, 'cordova-blackberry', 'javascript', 'cordova.blackberry.js'),
path.join(this.www_dir(), 'cordova.js'));
+
+        // add webworks ext directories
+        shell.cp('-rf', path.join(util.libDirectory, 'cordova-blackberry', 'framework', 'ext*'),
this.www_dir());
+
+        // add config.xml
+        // @TODO should use project www/config.xml but it must use BBWP elements
+        shell.cp('-f', path.join(util.libDirectory, 'cordova-blackberry', 'bin', 'templates',
'project', 'www', 'config.xml'), this.www_dir());
+
+        // add res/
+        // @TODO remove this when config.xml is generalized
+        shell.cp('-rf', path.join(util.libDirectory, 'cordova-blackberry', 'bin', 'templates',
'project', 'www', 'res'), this.www_dir());
     },
 
     // update the overrides folder into the www folder


Mime
View raw message