incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [9/14] git commit: add platform config logic made simpler
Date Fri, 21 Sep 2012 21:44:36 GMT
add platform config logic made simpler


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

Branch: refs/heads/cordova-client
Commit: c1704278b4f5550791ad20eb3228792eea1e1a31
Parents: c3017bc
Author: Fil Maj <maj.fil@gmail.com>
Authored: Thu Sep 20 14:53:34 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Thu Sep 20 14:53:34 2012 -0700

----------------------------------------------------------------------
 spec/metadata/.android_parser.spec.js.swp |  Bin 12288 -> 0 bytes
 src/platform.js                           |   13 ++++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c1704278/spec/metadata/.android_parser.spec.js.swp
----------------------------------------------------------------------
diff --git a/spec/metadata/.android_parser.spec.js.swp b/spec/metadata/.android_parser.spec.js.swp
deleted file mode 100644
index 11f10db..0000000
Binary files a/spec/metadata/.android_parser.spec.js.swp and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c1704278/src/platform.js
----------------------------------------------------------------------
diff --git a/src/platform.js b/src/platform.js
index 3d26727..a140036 100644
--- a/src/platform.js
+++ b/src/platform.js
@@ -33,8 +33,6 @@ module.exports = function platform(command, target, callback) {
             break;
         case 'add':
             asyncblock(function(flow) {
-                // Add the platform to the config.xml
-                cfg.add_platform(target);
                 var output = path.join(projectRoot, 'platforms', target);
 
                 // Do we have the cordova library for this platform?
@@ -51,7 +49,6 @@ module.exports = function platform(command, target, callback) {
                     }));
                     var buffers = flow.get('cloning');
                     if (buffers.err) {
-                        cfg.remove_platform(target);
                         throw ('An error occured during git-clone of ' + repos[target] +
'. ' + buffers.err);
                     }
 
@@ -66,7 +63,6 @@ module.exports = function platform(command, target, callback) {
                     }));
                     buffers = flow.get('tagcheckout');
                     if (buffers.err) {
-                        cfg.remove_platform(target);
                         throw ('An error occured during git-checkout of ' + outPath + ' to
tag 2.1.0rc1. ' + buffers.err);
                     }
                 }
@@ -90,9 +86,16 @@ module.exports = function platform(command, target, callback) {
                     }));
                     var bfrs = flow.get('create');
                     if (bfrs.err) {
-                        cfg.remove_platform(target);
                         throw ('An error occured during creation of ' + target + ' sub-project.
' + bfrs.err);
                     } else {
+                        switch(target) {
+                            case 'android':
+                                break;
+                            case 'ios':
+                                break;
+                        }
+                        // Add the platform to config.xml
+                        cfg.add_platform(target);
                         if (callback) callback();
                     }
                 }


Mime
View raw message