Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove java 1.8 version check #1241

Merged
merged 2 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 0 additions & 11 deletions bin/templates/cordova/lib/check_reqs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ var PROJECT_ROOT = path.join(__dirname, '..', '..');
const { CordovaError, ConfigParser, events } = require('cordova-common');
var android_sdk = require('./android_sdk');
const { createEditor } = require('properties-parser');
const semver = require('semver');

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.
Expand Down Expand Up @@ -140,14 +137,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;
};

Expand Down
10 changes: 0 additions & 10 deletions spec/unit/check_reqs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

// This should match /bin/templates/project/build.gradle
const DEFAULT_TARGET_API = 30;
Expand All @@ -48,15 +47,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' }) }
Expand Down