You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2021/07/07 11:19:20 UTC
[cordova-android] branch master updated: feat: remove java 1.8
version check (#1241)
This is an automated email from the ASF dual-hosted git repository.
jcesarmobile pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push:
new 8a9cb8f feat: remove java 1.8 version check (#1241)
8a9cb8f is described below
commit 8a9cb8f6b70d3a2d59045f77983b162d6ac2e14d
Author: jcesarmobile <jc...@gmail.com>
AuthorDate: Wed Jul 7 13:19:09 2021 +0200
feat: remove java 1.8 version check (#1241)
---
bin/templates/cordova/lib/check_reqs.js | 11 -----------
spec/unit/check_reqs.spec.js | 10 ----------
2 files changed, 21 deletions(-)
diff --git a/bin/templates/cordova/lib/check_reqs.js b/bin/templates/cordova/lib/check_reqs.js
index 86f9890..b986375 100644
--- a/bin/templates/cordova/lib/check_reqs.js
+++ b/bin/templates/cordova/lib/check_reqs.js
@@ -25,11 +25,8 @@ const java = require('./env/java');
var REPO_ROOT = path.join(__dirname, '..', '..', '..', '..');
const { CordovaError, ConfigParser, events } = require('cordova-common');
var android_sdk = require('./android_sdk');
-const semver = require('semver');
const { SDK_VERSION } = require('./gradle-config-defaults');
-const EXPECTED_JAVA_VERSION = '1.8.x';
-
// Re-exporting these for backwards compatibility and for unit testing.
// TODO: Remove uses and use the ./utils module directly.
Object.assign(module.exports, { isWindows, isDarwin });
@@ -123,14 +120,6 @@ module.exports.check_gradle = function () {
*/
module.exports.check_java = async function () {
const javaVersion = await java.getVersion();
-
- if (!semver.satisfies(javaVersion.version, EXPECTED_JAVA_VERSION)) {
- throw new CordovaError(
- `Requirements check failed for JDK ${EXPECTED_JAVA_VERSION}! Detected version: ${javaVersion.version}\n` +
- 'Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.'
- );
- }
-
return javaVersion;
};
diff --git a/spec/unit/check_reqs.spec.js b/spec/unit/check_reqs.spec.js
index b2bf8ac..ac3ba5b 100644
--- a/spec/unit/check_reqs.spec.js
+++ b/spec/unit/check_reqs.spec.js
@@ -23,7 +23,6 @@ var fs = require('fs-extra');
var path = require('path');
var events = require('cordova-common').events;
var which = require('which');
-const { CordovaError } = require('cordova-common');
const {
SDK_VERSION: DEFAULT_TARGET_API
@@ -49,15 +48,6 @@ describe('check_reqs', function () {
});
describe('check_java', () => {
- it('detects if unexpected JDK version is installed', async () => {
- check_reqs.__set__({
- EXPECTED_JAVA_VERSION: '9999.9999.9999',
- java: { getVersion: async () => ({ version: '1.8.0' }) }
- });
-
- await expectAsync(check_reqs.check_java()).toBeRejectedWithError(CordovaError, /Requirements check failed for JDK 9999.9999.9999! Detected version: 1.8.0/);
- });
-
it('should return the version', async () => {
check_reqs.__set__({
java: { getVersion: async () => ({ version: '1.8.0' }) }
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org