cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [4/4] git commit: fix CB378 - adding support for non-semver 2 digit versions of xcodebuild, eg 5.0
Date Wed, 26 Jun 2013 22:27:47 GMT
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/2c4e668d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/2c4e668d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/2c4e668d

Branch: refs/heads/2.9.x
Commit: 2c4e668d7095adbaf900fabf8dd5f6c0b72898bc
Parents: debf54d
Author: Sam Breed <sam@quickleft.com>
Authored: Sun Jun 23 16:36:18 2013 -0600
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Wed Jun 26 15:26:59 2013 -0700

----------------------------------------------------------------------
 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/2c4e668d/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/2c4e668d/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);


Mime
View raw message