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/06/25 00:52:37 UTC

git commit: fix CB378 - adding support for non-semver 2 digit versions of xcodebuild, eg 5.0

Updated Branches:
  refs/heads/master2 11f551e94 -> 7765eb884


fix CB378 - adding support for non-semver 2 digit versions of xcodebuild, eg 5.0

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

Branch: refs/heads/master2
Commit: 7765eb884aefdad4614d0541332388bc7ae79c35
Parents: 11f551e
Author: Sam Breed <sa...@quickleft.com>
Authored: Sun Jun 23 16:36:18 2013 -0600
Committer: Sam Breed <sa...@quickleft.com>
Committed: Sun Jun 23 16:47:14 2013 -0600

----------------------------------------------------------------------
 spec/metadata/ios_parser.spec.js | 9 +++++++++
 src/metadata/ios_parser.js       | 3 +++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/7765eb88/spec/metadata/ios_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/ios_parser.spec.js b/spec/metadata/ios_parser.spec.js
index e3cdfe4..7dfb0aa 100644
--- a/spec/metadata/ios_parser.spec.js
+++ b/spec/metadata/ios_parser.spec.js
@@ -75,6 +75,15 @@ describe('ios project parser', function () {
                 done();
             });
         });
+        it('should not return an error if the xcodebuild version 2 digits and not proper semver (eg: 5.0), but still satisfies the MIN_XCODE_VERSION', function(done) {
+            exec.andCallFake(function(cmd, opts, cb) {
+                cb(0, 'version 5.0');
+            });
+            platforms.ios.parser.check_requirements(proj, function(err) {
+                expect(err).toBe(false);
+                done();
+            });
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/7765eb88/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index 343a72b..abbdc12 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -72,6 +72,9 @@ module.exports.check_requirements = function(project_root, callback) {
             callback('Xcode is (probably) not installed, specifically the command `xcodebuild` is unavailable or erroring out. Output of `'+command+'` is: ' + output);
         } else {
             var xc_version = output.split('\n')[0].split(' ')[1];
+            if(xc_version.split('.').length === 2){
+                xc_version += '.0';
+            }
             if (!semver.satisfies(xc_version, MIN_XCODE_VERSION)) {
                 callback('Xcode version installed is too old. Minimum: ' + MIN_XCODE_VERSION + ', yours: ' + xc_version);
             } else callback(false);