Add missing log to Java version check (#624)

* Add missing log to Java version check
* Simplify version check output

Resolves #623
This commit is contained in:
Fabian Te 2019-01-27 16:52:22 +01:00 committed by Chris Brody
parent 715ce2f9ac
commit 54df4a116c

View File

@ -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.');
}
});
};