You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/11/28 21:01:42 UTC

[1/2] git commit: updating cordova-cli to work with 2.3.00rc1

Updated Branches:
  refs/heads/master d864b0423 -> fa3256766
Updated Tags:  refs/tags/0.1.1 [created] e9ac57dfc
  refs/tags/0.1.13 [created] fa3256766
  refs/tags/hello-cordova-1.9.0 [created] 091e3723c
  refs/tags/hello-cordova-2.0.0 [created] 61adf0516


updating cordova-cli to work with 2.3.00rc1


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

Branch: refs/heads/master
Commit: fa3256766402762c355ed7bbcca1959a5ba3453c
Parents: b63b671
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Nov 28 12:01:22 2012 -0800
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Nov 28 12:01:22 2012 -0800

----------------------------------------------------------------------
 package.json               |    6 +++---
 src/build.js               |    2 +-
 src/emulate.js             |    2 ++
 src/metadata/ios_parser.js |   14 +++++---------
 src/util.js                |   12 ++++++++----
 5 files changed, 19 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/fa325676/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 035cb3e..57b299a 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
 {
   "name": "cordova",
-  "version": "0.1.12",
+  "version": "0.1.13",
   "preferGlobal": "true",
-  "description": "Cordova client tool",
+  "description": "Cordova command line interface tool",
   "main": "cordova",
   "bin": {
     "cordova": "./bin/cordova"
@@ -27,7 +27,7 @@
     "plist":"git://github.com/filmaj/node-plist.git",
     "xcode":"0.5.1",
     "express":"3.0",
-    "shelljs":"0.0.7",
+    "shelljs":"0.0.8",
     "ncallbacks":"1.0.0",
     "adm-zip":"0.1.8",
     "request":"2.11.4",

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/fa325676/src/build.js
----------------------------------------------------------------------
diff --git a/src/build.js b/src/build.js
index b1ee684..deb60f8 100644
--- a/src/build.js
+++ b/src/build.js
@@ -21,7 +21,7 @@ function shell_out_to_debug(projectRoot, platform) {
     if (platform.indexOf('blackberry') > -1) {
         cmd = 'ant -f "' + path.join(cmd, 'build.xml') + '" qnx load-device';
     } else {
-        cmd = '"' + cmd + '/cordova/debug"';
+        cmd = '"' + cmd + '/cordova/build"';
     }
     var response = shell.exec(cmd, {silent:true});
     if (response.code > 0) throw 'An error occurred while building the ' + platform + ' project. ' + response.output;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/fa325676/src/emulate.js
----------------------------------------------------------------------
diff --git a/src/emulate.js b/src/emulate.js
index 23bab32..40340e2 100644
--- a/src/emulate.js
+++ b/src/emulate.js
@@ -17,6 +17,8 @@ function shell_out_to_emulate(root, platform) {
     // TODO: bad bad bad
     if (platform.indexOf('blackberry') > -1) {
         cmd = 'ant -f ' + path.join(root, 'platforms', platform, 'build.xml') + ' qnx load-simulator';
+    } else if (platform.indexOf('android') > -1) {
+        cmd = path.join(root, 'platforms', platform, 'cordova', 'run');
     }
     var em = shell.exec(cmd, {silent:true});
     if (em.code > 0) throw 'An error occurred while emulating/deploying the ' + platform + ' project.' + em.output;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/fa325676/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index 05564c6..6359839 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -4,6 +4,7 @@ var fs   = require('fs'),
     util = require('../util'),
     shell = require('shelljs'),
     plist = require('plist'),
+    et = require('elementtree'),
     config_parser = require('../config_parser');
 
 module.exports = function ios_parser(project) {
@@ -34,13 +35,6 @@ module.exports.prototype = {
         info_contents = info_contents.replace(/<string>\s*<\/string>/,'<string></string>');
         fs.writeFileSync(plistFile, info_contents, 'utf-8');
         
-        // Update whitelist
-        var cordovaPlist = path.join(this.cordovaproj, 'Cordova.plist');
-        var contents = plist.parseFileSync(cordovaPlist);
-        var whitelist = config.access.get();
-        contents['ExternalHosts'] = whitelist;
-        fs.writeFileSync(cordovaPlist, plist.build(contents), 'utf-8');
-        
         // Update product name
         var proj = new xcode.project(this.pbxproj);
         var parser = this;
@@ -63,8 +57,10 @@ module.exports.prototype = {
         var projectRoot = util.isCordova(process.cwd());
         var www = path.join(projectRoot, 'www');
         shell.cp('-rf', www, this.path);
-        var jsPath = path.join(__dirname, '..', '..', 'lib', 'ios', 'bin', 'templates', 'project', 'www', 'cordova-2.2.0.js');
-        fs.writeFileSync(path.join(this.path, 'www', 'cordova.js'), fs.readFileSync(jsPath, 'utf-8'), 'utf-8');
+        //shell.cp('-f', path.join(www, 'config.xml'), path.join(this.cordovaproj, 'config.xml'));
+        var project_www = path.join(this.path, 'www');
+        var js = fs.readdirSync(project_www).filter(function(e) { return e.match(/\.js$/i); })[0];
+        shell.mv('-f', path.join(project_www, js), path.join(project_www, 'cordova.js'));
     },
     update_project:function(cfg, callback) {
         var self = this;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/fa325676/src/util.js
----------------------------------------------------------------------
diff --git a/src/util.js b/src/util.js
index 9127067..6f7b2b6 100644
--- a/src/util.js
+++ b/src/util.js
@@ -81,16 +81,20 @@ module.exports = {
             var create = path.join(outPath, 'bin', 'create');
             chmod(create);
 
-            // chmod debug+emulate
+            // chmod executable scripts 
             if (target == 'ios') {
                 chmod(path.join(outPath, 'bin', 'replaces'));
                 chmod(path.join(outPath, 'bin', 'update_cordova_subproject'));
-                chmod(path.join(outPath, 'bin', 'templates', 'project', 'cordova', 'debug'));
+                chmod(path.join(outPath, 'bin', 'templates', 'project', 'cordova', 'build'));
+                chmod(path.join(outPath, 'bin', 'templates', 'project', 'cordova', 'run'));
+                chmod(path.join(outPath, 'bin', 'templates', 'project', 'cordova', 'release'));
                 chmod(path.join(outPath, 'bin', 'templates', 'project', 'cordova', 'emulate'));
             } else if (target == 'android') {
                 chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'cordova'));
-                chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'debug'));
-                chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'emulate'));
+                chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'build'));
+                chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'run'));
+                chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'clean'));
+                chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'release'));
             } else if (target == 'blackberry') {
                 chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'debug'));
                 chmod(path.join(outPath, 'bin', 'templates', 'cordova', 'emulate'));