You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by lo...@apache.org on 2013/12/11 19:40:49 UTC

git commit: CB-5573 relies on stderr content and error codes to detect a problem with xcode installation.

Updated Branches:
  refs/heads/master aa656e4a3 -> cfa564510


CB-5573 relies on stderr content and error codes to detect a problem with xcode installation.

relevant if this section is ever reactivated, platform environments detected by platform scripts.


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

Branch: refs/heads/master
Commit: cfa564510d4713fae9997469fd283d7efb79f1c4
Parents: aa656e4
Author: lorinbeer <lo...@adobe.com>
Authored: Wed Dec 11 10:40:36 2013 -0800
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed Dec 11 10:40:36 2013 -0800

----------------------------------------------------------------------
 src/metadata/ios_parser.js | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/cfa56451/src/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/ios_parser.js b/src/metadata/ios_parser.js
index d819bf3..fcfa243 100644
--- a/src/metadata/ios_parser.js
+++ b/src/metadata/ios_parser.js
@@ -66,6 +66,28 @@ module.exports = function ios_parser(project) {
 module.exports.check_requirements = function(project_root) {
     // Rely on platform's bin/create script to check requirements.
     return Q(true);
+    
+    events.emit('log', 'Checking iOS requirements...');
+    // Check xcode + version.
+    var command = 'xcodebuild -version';
+    events.emit('verbose', 'Running "' + command + '" (output to follow)');
+    var d = Q.defer();
+    
+    child_process.exec(command, function(err, output, stderr) {
+        events.emit('verbose', output+stderr);
+        if (err || stderr) {
+            d.reject(new Error('Xcode is (probably) not installed, specifically the command `xcodebuild` is unavailable or erroring out. Output of `'+command+'` is: ' + output + stderr));
+        } 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)) {
+                d.reject(new Error('Xcode version installed is too old. Minimum: ' + MIN_XCODE_VERSION + ', yours: ' + xc_version));
+            } else d.resolve();
+        }
+    });
+    return d.promise;
 };
 
 module.exports.prototype = {