You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/10/17 16:26:35 UTC

[1/4] git commit: Rename parse method and add a write method to result + parseIOSProjectFiles --> parseProjectFile + write method save both pbx and xcode + allow a more common experience

Updated Branches:
  refs/heads/master ccc529d24 -> ab8571835


Rename parse method and add a write method to result
+ parseIOSProjectFiles --> parseProjectFile
+ write method save both pbx and xcode
+ allow a more common experience


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

Branch: refs/heads/master
Commit: 718de942a03bf0c57d9b421d2c663bbc67a80b3f
Parents: ccc529d
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 08:02:08 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 08:02:08 2013 +0200

----------------------------------------------------------------------
 src/platforms/ios.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/718de942/src/platforms/ios.js
----------------------------------------------------------------------
diff --git a/src/platforms/ios.js b/src/platforms/ios.js
index bb5c597..065c4a7 100644
--- a/src/platforms/ios.js
+++ b/src/platforms/ios.js
@@ -115,7 +115,7 @@ module.exports = {
             shell.rm('-rf', destFile);
         }
     },
-    parseIOSProjectFiles:function(project_dir) {
+    parseProjectFile:function(project_dir) {
         // grab and parse pbxproj
         // we don't want CordovaLib's xcode project
         var project_files = glob.sync(path.join(project_dir, '*.xcodeproj', 'project.pbxproj'));
@@ -152,7 +152,10 @@ module.exports = {
             resources_dir:resourcesDir,
             xcode:xcodeproj,
             xcode_path:xcode_dir,
-            pbx:pbxPath
+            pbx: pbxPath,
+            write: function () {
+                fs.writeFileSync(pbxPath, xcodeproj.writeSync());
+            }
         };
     }
 };


[4/4] git commit: Update action-stack to avoid static platform detection + test if parseProjectFile is present instead of switch case + test if project_files is not null instead of [].indexOf + More dynamic, more long term evolution

Posted by br...@apache.org.
Update action-stack to avoid static platform detection
+ test if parseProjectFile is present instead of switch case
+ test if project_files is not null instead of [].indexOf
+ More dynamic, more long term evolution


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

Branch: refs/heads/master
Commit: ab8571835903b0170b9f5506d9b9b19bc213f4ed
Parents: af458da
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 08:10:36 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 08:10:36 2013 +0200

----------------------------------------------------------------------
 src/util/action-stack.js | 40 ++++++++++------------------------------
 1 file changed, 10 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ab857183/src/util/action-stack.js
----------------------------------------------------------------------
diff --git a/src/util/action-stack.js b/src/util/action-stack.js
index 122e19b..def71fc 100644
--- a/src/util/action-stack.js
+++ b/src/util/action-stack.js
@@ -1,7 +1,4 @@
-var ios = require('../platforms/ios'),
-    wp7 = require('../platforms/wp7'),
-    wp8 = require('../platforms/wp8'),
-    windows8 = require('../platforms/windows8'),
+var platforms = require("../platforms"),
     Q = require('q'),
     fs = require('fs');
 
@@ -30,32 +27,18 @@ ActionStack.prototype = {
     process:function(platform, project_dir) {
         require('../../plugman').emit('verbose', 'Beginning processing of action stack for ' + platform + ' project...');
         var project_files;
+
         // parse platform-specific project files once
-        require('../../plugman').emit('verbose', 'Parsing ' + platform + ' project files...');
-        switch(platform) {
-            case "ios": 
-                require('../../plugman').emit('verbose', 'Parsing iOS project files...');
-                project_files = ios.parseIOSProjectFiles(project_dir);
-                break;
-            case "wp7": 
-                require('../../plugman').emit('verbose', 'Parsing WP7 project files...');
-                project_files = wp7.parseProjectFile(project_dir);
-                break;
-            case "wp8": 
-                require('../../plugman').emit('verbose', 'Parsing WP8 project files...');
-                project_files = wp8.parseProjectFile(project_dir);
-                break;
-            case "windows8": 
-                require('../../plugman').emit('verbose', 'Parsing Windows8 project files...');
-                project_files = windows8.parseProjectFile(project_dir);
-                break;
+        if (platforms[platform].parseProjectFile) {
+            require('../../plugman').emit('verbose', 'Parsing ' + platform + ' project files...');
+            project_files = platforms[platform].parseProjectFile(project_dir);
         }
 
         while(this.stack.length) {
             var action = this.stack.shift();
             var handler = action.handler.run;
             var action_params = action.handler.params;
-            if(['ios','wp7','wp8','windows8'].indexOf(platform) > -1) {
+            if (project_files) {
                 action_params.push(project_files);
             }
 
@@ -71,7 +54,7 @@ ActionStack.prototype = {
                     var revert = undo.reverter.run;
                     var revert_params = undo.reverter.params;
 
-                    if(['ios','wp7','wp8','windows8'].indexOf(platform) > -1) {
+                    if (project_files) {
                         revert_params.push(project_files);
                     }
 
@@ -88,15 +71,12 @@ ActionStack.prototype = {
             this.completed.push(action);
         }
         require('../../plugman').emit('verbose', 'Action stack processing complete.');
-        if (platform == 'ios') {
-            // write out xcodeproj file
-            require('../../plugman').emit('verbose', 'Writing out iOS pbxproj file...');
-            fs.writeFileSync(project_files.pbx, project_files.xcode.writeSync());
-        }
-        if (platform == 'wp7' || platform == 'wp8' || platform == "windows8") {
+
+        if (project_files) {
             require('../../plugman').emit('verbose', 'Writing out ' + platform + ' project files...');
             project_files.write();
         }
+
         return Q();
     }
 };


[2/4] git commit: Update references to old ios parse method

Posted by br...@apache.org.
Update references to old ios parse method


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

Branch: refs/heads/master
Commit: a32b7cf2b4b00cee89609e2df4316f8c44c0d45c
Parents: 718de94
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 08:06:01 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 08:06:01 2013 +0200

----------------------------------------------------------------------
 src/util/config-changes.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/a32b7cf2/src/util/config-changes.js
----------------------------------------------------------------------
diff --git a/src/util/config-changes.js b/src/util/config-changes.js
index 82a1aed..0239b61 100644
--- a/src/util/config-changes.js
+++ b/src/util/config-changes.js
@@ -193,7 +193,7 @@ module.exports = {
                 }
             }
             if (global_munge['framework'] && config_munge['framework']) {
-                pbxproj = ios_parser.parseIOSProjectFiles(project_dir);
+                pbxproj = ios_parser.parseProjectFile(project_dir);
             }
         }
 
@@ -310,7 +310,7 @@ module.exports = {
                 }
             }
             if (config_munge['framework']) {
-                pbxproj = ios_parser.parseIOSProjectFiles(project_dir);
+                pbxproj = ios_parser.parseProjectFile(project_dir);
             }
         }
 


[3/4] git commit: Update spec to match new ios parse method name

Posted by br...@apache.org.
Update spec to match new ios parse method name


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

Branch: refs/heads/master
Commit: af458da54192acd5c83a81a69cdeffe74d67c19e
Parents: a32b7cf
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 08:06:26 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 08:06:26 2013 +0200

----------------------------------------------------------------------
 spec/platforms/ios.spec.js       | 8 ++++----
 spec/util/config-changes.spec.js | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/af458da5/spec/platforms/ios.spec.js
----------------------------------------------------------------------
diff --git a/spec/platforms/ios.spec.js b/spec/platforms/ios.spec.js
index a19af13..cb7460d 100644
--- a/spec/platforms/ios.spec.js
+++ b/spec/platforms/ios.spec.js
@@ -64,7 +64,7 @@ var plist_only_els = platformTag.findall('./plugins-plist');
 
 shell.mkdir('-p', temp);
 shell.cp('-rf', ios_config_xml_project, temp);
-var proj_files = ios.parseIOSProjectFiles(temp);
+var proj_files = ios.parseProjectFile(temp);
 shell.rm('-rf', temp);
 
 function copyArray(arr) {
@@ -92,10 +92,10 @@ describe('ios project handler', function() {
         });
     });
 
-    describe('parseIOSProjectFiles method', function() {
+    describe('parseProjectFile method', function () {
         it('should throw if project is not an xcode project', function() {
             expect(function() {
-                ios.parseIOSProjectFiles(temp);
+                ios.parseProjectFile(temp);
             }).toThrow('does not appear to be an xcode project (no xcode project file)');
         });
         it('should throw if project does not contain an appropriate PhoneGap/Cordova.plist file or config.xml file', function() {
@@ -103,7 +103,7 @@ describe('ios project handler', function() {
             shell.rm(path.join(temp, 'SampleApp', 'config.xml'));
 
             expect(function() {
-                ios.parseIOSProjectFiles(temp);
+                ios.parseProjectFile(temp);
             }).toThrow('could not find PhoneGap/Cordova plist file, or config.xml file.');
         });
     });

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/af458da5/spec/util/config-changes.spec.js
----------------------------------------------------------------------
diff --git a/spec/util/config-changes.spec.js b/spec/util/config-changes.spec.js
index 1a088c0..5e46b69 100644
--- a/spec/util/config-changes.spec.js
+++ b/spec/util/config-changes.spec.js
@@ -298,7 +298,7 @@ describe('config-changes module', function() {
                     shell.cp('-rf', cbplugin, plugins_dir);
                     xcode_add = jasmine.createSpy();
                     xcode_rm = jasmine.createSpy();
-                    spyOn(ios_parser, 'parseIOSProjectFiles').andReturn({
+                    spyOn(ios_parser, 'parseProjectFile').andReturn({
                         xcode:{
                             addFramework:xcode_add,
                             removeFramework:xcode_rm,