Skip to content

Commit

Permalink
Add missing log to Java version check (apache#624)
Browse files Browse the repository at this point in the history
* Add missing log to Java version check
* Simplify version check output

Resolves apache#623
  • Loading branch information
fabiante authored and Chris Brody committed Jan 27, 2019
1 parent 715ce2f commit 54df4a1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/templates/cordova/lib/check_reqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,18 @@ module.exports.check_android_target = function (originalError) {
// Returns a promise.
module.exports.run = function () {
return Q.all([this.check_java(), this.check_android()]).then(function (values) {
console.log('Checking Java JDK and Android SDK versions');
console.log('ANDROID_HOME=' + process.env['ANDROID_HOME']);
console.log('JAVA_HOME=' + process.env['JAVA_HOME']);

if (!String(values[0]).startsWith('1.8.')) {
throw new CordovaError(`Requirements check failed for JDK 8 ('1.8.*')`);
throw new CordovaError(
'Requirements check failed for JDK 8 (\'1.8.*\')! Detected version: ' + values[0] + '\n' +
'Check your JAVA_HOME / ANDROID_HOME / PATH environment variables.'
);
}

if (!values[1]) {
throw new CordovaError('Requirements check failed for Android SDK');
throw new CordovaError('Requirements check failed for Android SDK! Android SDK was not detected.');
}
});
};
Expand Down

0 comments on commit 54df4a1

Please sign in to comment.