You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by lo...@apache.org on 2013/10/23 23:55:51 UTC

[1/2] webworks commit: CB-4780 update script with windows support

Updated Branches:
  refs/heads/master 6b2ae1dec -> 2a4fd5074


CB-4780 update script with windows support


Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/5a96c23c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/5a96c23c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/5a96c23c

Branch: refs/heads/master
Commit: 5a96c23c036a339f838ccd9c36254acaf641e806
Parents: 6b2ae1d
Author: lorinbeer <lo...@adobe.com>
Authored: Wed Oct 23 14:35:16 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed Oct 23 14:35:16 2013 -0700

----------------------------------------------------------------------
 blackberry10/bin/lib/update.js |  94 +++++++++++++++++++++++++++
 blackberry10/bin/update        | 122 +++++++++---------------------------
 blackberry10/bin/update.bat    |  21 +++++++
 3 files changed, 143 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/5a96c23c/blackberry10/bin/lib/update.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/lib/update.js b/blackberry10/bin/lib/update.js
new file mode 100755
index 0000000..d941a6f
--- /dev/null
+++ b/blackberry10/bin/lib/update.js
@@ -0,0 +1,94 @@
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+var shell = require('shelljs'),
+    path  = require('path'),
+    fs    = require('fs'),
+    ROOT    = path.join(__dirname, '..', '..');
+
+function setShellFatal(value, func) {
+    var oldVal = shell.config.fatal;
+    shell.config.fatal = value;
+    func();
+    shell.config.fatal = oldVal;
+}
+
+
+function updateNativeDir(projectpath) {
+    shell.cp('-rf', path.join(ROOT,'bin','templates','project','native'), path.join(projectpath,'native'));
+}
+
+function updateProjectJson(projectpath) {
+    var projectJson = require(path.resolve(path.join(projectpath, "project.json")));
+    projectJson.globalFetchDir = path.join(ROOT,'plugins');
+    fs.writeFileSync(path.join(projectpath, "project.json"), JSON.stringify(projectJson, null, 4) + "\n", "utf-8");
+}
+
+function updateCordovaJS(projectpath,version) {
+    var jspath = path.join(projectpath,'lib','cordova'+version,'javascript');
+    shell.rm('-rf', path.join(projectpath, 'lib')); //remove old lib tree
+    shell.mkdir('-p', jspath); // remake lib dir tree with updated version
+    shell.cp('-f', path.join(ROOT,'javascript','cordova.blackberry10.js'), path.join(jspath,'cordova.js')); // copy new js
+    shell.cp('-f', path.join(ROOT,'javascript','cordova.blackberry10.js'), path.join('www','cordova.js'));
+}
+
+function updateCordovaTools(projectpath) {
+    // update cordova scripts from template
+    shell.cp('-rf', path.join(ROOT,'bin','templates','project','cordova'), path.join(projectpath,'cordova'));
+    // update repo level scripts
+    updateTargetTool(projectpath);
+    updateInitTool(projectpath); 
+}
+
+function updateTargetTool(projectpath) {
+    shell.cp('-f', path.join(ROOT,'bin','target'), path.join(projectpath,'cordova'));
+    shell.cp('-f', path.join(ROOT,'bin','target.bat'), path.join(projectpath,'cordova'));
+    shell.cp('-f', path.join(ROOT,'bin','lib','target.js'), path.join(projectpath,'cordova','lib'));
+    shell.cp('-f', path.join(ROOT,'bin','lib','utils.js'), path.join(projectpath,'cordova','lib'));
+}
+
+function updateInitTool(projectpath) {
+    shell.cp('-f', path.join(ROOT,'bin','init.bat'), path.join(projectpath, 'cordova'));
+    shell.cp('-f', path.join(ROOT,'bin','init'), path.join(projectpath, 'cordova'));
+}
+
+exports.updateProject = function(projectpath) {
+    var version = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
+    setShellFatal(true, function() {
+        updateCordovaJS(projectpath,version);
+        updateCordovaTools(projectpath);
+        updateNativeDir(projectpath);
+        updateProjectJson(projectpath); 
+        //console.log('BlackBerry10 project is now at version ' + version);
+    });
+};
+
+if (require.main === module) {
+    (function() {
+        var args = process.argv;
+        if (args.length < 3 || (args[2] == '--help' || args[2] == '-h')) {
+            console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' <path_to_project>');
+            process.exit(1);
+        } else {
+            exports.updateProject(args[2]);
+        }
+    })();
+}

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/5a96c23c/blackberry10/bin/update
----------------------------------------------------------------------
diff --git a/blackberry10/bin/update b/blackberry10/bin/update
index 586873a..4fd94da 100755
--- a/blackberry10/bin/update
+++ b/blackberry10/bin/update
@@ -1,94 +1,28 @@
-#!/usr/bin/env node
-
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-
-var shell = require('shelljs'),
-    path  = require('path'),
-    fs    = require('fs'),
-    ROOT    = path.join(__dirname, '..');
-
-function setShellFatal(value, func) {
-    var oldVal = shell.config.fatal;
-    shell.config.fatal = value;
-    func();
-    shell.config.fatal = oldVal;
-}
-
-
-function updateNativeDir(projectpath) {
-    shell.cp('-rf', path.join(ROOT,'bin','templates','project','native'), path.join(projectpath,'native'));
-}
-
-function updateProjectJson(projectpath) {
-    var projectJson = require(path.resolve(path.join(projectpath, "project.json")));
-    projectJson.globalFetchDir = path.join(ROOT,'plugins');
-    fs.writeFileSync(path.join(projectpath, "project.json"), JSON.stringify(projectJson, null, 4) + "\n", "utf-8");
-}
-
-function updateCordovaJS(projectpath,version) {
-    var jspath = path.join(projectpath,'lib','cordova'+version,'javascript');
-    shell.rm('-rf', path.join(projectpath, 'lib')); //remove old lib tree
-    shell.mkdir('-p', jspath); // remake lib dir tree with updated version
-    shell.cp('-f', path.join(ROOT,'javascript','cordova.blackberry10.js'), path.join(jspath,'cordova.js')); // copy new js
-    shell.cp('-f', path.join(ROOT,'javascript','cordova.blackberry10.js'), path.join('www','cordova.js'));
-}
-
-function updateCordovaTools(projectpath) {
-    // update cordova scripts from template
-    shell.cp('-rf', path.join(ROOT,'bin','templates','project','cordova'), path.join(projectpath,'cordova'));
-    // update repo level scripts
-    updateTargetTool(projectpath);
-    updateInitTool(projectpath); 
-}
-
-function updateTargetTool(projectpath) {
-    shell.cp('-f', path.join(ROOT,'bin','target'), path.join(projectpath,'cordova'));
-    shell.cp('-f', path.join(ROOT,'bin','target.bat'), path.join(projectpath,'cordova'));
-    shell.cp('-f', path.join(ROOT,'bin','lib','target.js'), path.join(projectpath,'cordova','lib'));
-    shell.cp('-f', path.join(ROOT,'bin','lib','utils.js'), path.join(projectpath,'cordova','lib'));
-}
-
-function updateInitTool(projectpath) {
-    shell.cp('-f', path.join(ROOT,'bin','init.bat'), path.join(projectpath, 'cordova'));
-    shell.cp('-f', path.join(ROOT,'bin','init'), path.join(projectpath, 'cordova'));
-}
-
-exports.updateProject = function(projectpath) {
-    var version = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
-    setShellFatal(true, function() {
-        updateCordovaJS(projectpath,version);
-        updateCordovaTools(projectpath);
-        updateNativeDir(projectpath);
-        updateProjectJson(projectpath); 
-        //console.log('BlackBerry10 project is now at version ' + version);
-    });
-};
-
-if (require.main === module) {
-    (function() {
-        var args = process.argv;
-        if (args.length < 3 || (args[2] == '--help' || args[2] == '-h')) {
-            console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' <path_to_project>');
-            process.exit(1);
-        } else {
-            exports.updateProject(args[2]);
-        }
-    })();
-}
+#! /bin/sh
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+#
+# create a cordova/blackberry project
+#
+# USAGE
+#   ./update [projectpath]
+#
+#!/bin/sh
+
+BIN_DIR=$(dirname "$0")
+source "$BIN_DIR/init"
+"$CORDOVA_NODE/node" "$BIN_DIR/lib/update.js" "$@"

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/5a96c23c/blackberry10/bin/update.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/update.bat b/blackberry10/bin/update.bat
new file mode 100755
index 0000000..02bd6c7
--- /dev/null
+++ b/blackberry10/bin/update.bat
@@ -0,0 +1,21 @@
+@ECHO OFF
+goto comment
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+:comment
+call "%~dps0init"
+"%CORDOVA_NODE%\node.exe" "%~dps0\lib\update.js" %*


[2/2] webworks commit: CB-4531 changed error codes in line with spec for helper scripts

Posted by lo...@apache.org.
CB-4531 changed error codes in line with spec for helper scripts


Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/2a4fd507
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/2a4fd507
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/2a4fd507

Branch: refs/heads/master
Commit: 2a4fd50748e9e88600c8babee587eb7b01b0ec27
Parents: 5a96c23
Author: lorinbeer <lo...@adobe.com>
Authored: Wed Oct 23 14:55:47 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed Oct 23 14:55:47 2013 -0700

----------------------------------------------------------------------
 blackberry10/bin/check_reqs | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/2a4fd507/blackberry10/bin/check_reqs
----------------------------------------------------------------------
diff --git a/blackberry10/bin/check_reqs b/blackberry10/bin/check_reqs
index f221d63..41ad770 100755
--- a/blackberry10/bin/check_reqs
+++ b/blackberry10/bin/check_reqs
@@ -31,25 +31,25 @@ DEBUGTOKENREQUEST="$CORDOVA_BBTOOLS/blackberry-debugtokenrequest"
 
 if [ ! -x "$NODE" ]; then
     echo node cannot be found on the path. Aborting.
-    EXIT_CODE=1
+    EXIT_CODE=2
 elif [ ! -x "$NPM" ]; then
     echo npm cannot be found on the path. Aborting.
-    EXIT_CODE=1
+    EXIT_CODE=2
 elif [ ! -x "$JAVA" ]; then
     echo java cannot be found on the path. Aborting.
-    EXIT_CODE=1
+    EXIT_CODE=2
 elif [ ! -x "$PACKAGER" ]; then
     echo blackberry-nativepackager cannot be found on the path. Aborting.
-    EXIT_CODE=1
+    EXIT_CODE=2
 elif [ ! -x "$DEPLOYER" ]; then
     echo blackberry-deploy cannot be found on the path. Aborting.
-    EXIT_CODE=1
+    EXIT_CODE=2
 elif [ ! -x "$SIGNER" ]; then
     echo blackberry-signer cannot be found on the path. Aborting.
-    EXIT_CODE=1
+    EXIT_CODE=2
 elif [ ! -x "$DEBUGTOKENREQUEST" ]; then
     echo blackberry-debugtokenrequest cannot be found on the path. Aborting.
-    EXIT_CODE=1
+    EXIT_CODE=2
 else
     "$NODE" "$BIN_DIR/check_reqs.js" "$@"
     EXIT_CODE=0