From 5fa4728ebe4a54e03d85821d712a6388f9196130 Mon Sep 17 00:00:00 2001 From: Vladimir Kotikov Date: Wed, 22 Jul 2015 13:20:39 +0300 Subject: [PATCH] CB-9389 Fixes build/check_reqs hang This removes gradle version check since it requires downloading and installing of gradle distributive if it is not installed yet. Partial revert of 4bf705a (cherry picked from commit f9ce1c607befb7e5ce6e9ea98a1dd93b752ef297) --- bin/lib/check_reqs.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js index d11a0d2a..0b31a2a3 100644 --- a/bin/lib/check_reqs.js +++ b/bin/lib/check_reqs.js @@ -82,15 +82,12 @@ module.exports.check_ant = function() { // Returns a promise. Called only by build and clean commands. module.exports.check_gradle = function() { var sdkDir = process.env['ANDROID_HOME']; - var message = 'Could not find gradle wrapper within Android SDK. '; - if (!sdkDir) return Q.reject(message + 'Might need to install Android SDK or set up \'ADROID_HOME\' env variable.'); - var wrapper = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper', 'gradlew'); - return tryCommand('"' + wrapper + '" -v', message + 'Might need to update your Android SDK.\n' + - 'Looked here: ' + path.dirname(wrapper)) - .then(function (output) { - // Parse Gradle version from command output - return/^gradle ((?:\d+\.)+(?:\d+))/gim.exec(output)[1]; - }); + var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper'); + if (!fs.existsSync(wrapperDir)) { + return Q.reject(new Error('Could not find gradle wrapper within android sdk. Might need to update your Android SDK.\n' + + 'Looked here: ' + wrapperDir)); + } + return Q.when(); }; // Returns a promise.