cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [2/4] git commit: shifted the update_overrides method out of build and into the parsers
Date Mon, 18 Feb 2013 20:05:40 GMT
shifted the update_overrides method out of build and into the parsers

- per Filip's feedback shfted the update_overrides() into
update_project and out of build.js
- added util.deleteSvnFolders to update_overrides()


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

Branch: refs/heads/merges
Commit: b59f5704b25700deccf044ed122b2de9731ccd50
Parents: 908eb66
Author: michael.wolf <michael.wolf@MWolf-MBP.local>
Authored: Tue Feb 12 22:24:25 2013 -0500
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Mon Feb 18 10:56:36 2013 -0800

----------------------------------------------------------------------
 src/build.js                      |    7 ++++---
 src/metadata/android_parser.js    |    4 ++++
 src/metadata/blackberry_parser.js |    7 +++++--
 src/metadata/ios_parser.js        |    4 ++++
 src/platform.js                   |    9 ++++++---
 5 files changed, 23 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b59f5704/src/build.js
----------------------------------------------------------------------
diff --git a/src/build.js b/src/build.js
index 722047a..d080be3 100644
--- a/src/build.js
+++ b/src/build.js
@@ -92,9 +92,10 @@ module.exports = function build(platforms, callback) {
                 platformPath = path.join(projectRoot, 'platforms', 'android');
                 parser = new android_parser(platformPath);
 
+
                 // Update the related platform project from the config
+                // also merges in any platform changes
                 parser.update_project(cfg);
-                parser.update_overrides();
                 shell_out_to_debug(projectRoot, 'android', end);
                 break;
             case 'blackberry':
@@ -102,8 +103,8 @@ module.exports = function build(platforms, callback) {
                 parser = new blackberry_parser(platformPath);
                 
                 // Update the related platform project from the config
+                // also merges in any platform changes
                 parser.update_project(cfg, function() {
-                    parser.update_overrides();
                     // Shell it
                     shell_out_to_debug(projectRoot, 'blackberry', end);
                 });
@@ -113,8 +114,8 @@ module.exports = function build(platforms, callback) {
                 parser = new ios_parser(platformPath);
 
                 // Update the related platform project from the config
+                // also merges in any platform changes
                 parser.update_project(cfg, function() {
-                    parser.update_overrides();
                     shell_out_to_debug(projectRoot, 'ios', end);
                 });
                 break;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b59f5704/src/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/android_parser.js b/src/metadata/android_parser.js
index be29de1..ccde723 100644
--- a/src/metadata/android_parser.js
+++ b/src/metadata/android_parser.js
@@ -150,11 +150,15 @@ module.exports.prototype = {
         var project_www = path.join(this.path, 'assets','www');
         var overrides = path.join(projectRoot, 'merges','android');
         shell.cp('-rf', overrides+'/*',project_www);
+
+        // delete any .svn folders copied over
+        util.deleteSvnFolders(project_www);
     },
 
     update_project:function(cfg, callback) {
         this.update_from_config(cfg);
         this.update_www();
+        this.update_overrides();
         if (callback) callback();
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b59f5704/src/metadata/blackberry_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/blackberry_parser.js b/src/metadata/blackberry_parser.js
index 91d0f60..cacc260 100644
--- a/src/metadata/blackberry_parser.js
+++ b/src/metadata/blackberry_parser.js
@@ -59,10 +59,12 @@ module.exports.prototype = {
         this.xml.update();
     },
     update_project:function(cfg, callback) {
-        this.update_from_config(cfg);
-        this.update_www();
         var self = this;
 
+        self.update_from_config(cfg);
+        self.update_www();
+        self.update_overrides();
+
         // Do we have BB config?
         var projectRoot = util.isCordova(this.path);
         var dotFile = path.join(projectRoot, '.cordova', 'config.json');
@@ -127,6 +129,7 @@ module.exports.prototype = {
         var platformWww = path.join(this.path, 'www');
         var overrides = path.join(projectRoot, 'merges','blackberry');
         shell.cp('-rf', overrides+'/*',platformWww);
+        util.deleteSvnFolders(platformWww);
     },
 
     write_project_properties:function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b59f5704/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index 03455ed..9cf4450 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -160,12 +160,16 @@ module.exports.prototype = {
         var project_www = path.join(this.path, 'www');
         var overrides = path.join(projectRoot, 'merges','ios');
         shell.cp('-rf', overrides+'/*',project_www);
+
+        util.deleteSvnFolders(project_www);
+
     },
 
     update_project:function(cfg, callback) {
         var self = this;
         this.update_from_config(cfg, function() {
             self.update_www();
+            self.update_overrides();
             if (callback) callback();
         });
     }

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/b59f5704/src/platform.js
----------------------------------------------------------------------
diff --git a/src/platform.js b/src/platform.js
index 4705130..604561d 100644
--- a/src/platform.js
+++ b/src/platform.js
@@ -94,23 +94,26 @@ module.exports = function platform(command, targets, callback) {
                             switch(target) {
                                 case 'android':
                                     var android = new android_parser(output);
-                                    android.update_project(cfg);
                                     createOverrides(target);
+
+                                    android.update_project(cfg);
                                     hooks.fire('after_platform_add');
                                     end();
                                     break;
                                 case 'ios':
                                     var ios = new ios_parser(output);
+                                    createOverrides(target);
+
                                     ios.update_project(cfg, function() {
-                                        createOverrides(target);
                                         hooks.fire('after_platform_add');
                                         end();
                                     });
                                     break;
                                 case 'blackberry':
                                     var bb = new blackberry_parser(output);
+                                    createOverrides(target);
+
                                     bb.update_project(cfg, function() {
-                                        createOverrides(target);
                                         hooks.fire('after_platform_add');
                                         end();
                                     });


Mime
View raw message