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

build(deps)!: JDK11 and SDK 31+ are required #1552

Merged
merged 4 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 8
cache: gradle
distribution: 'zulu'
java-version: 11
cache: 'gradle'

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ describe('androidSDK', () => {
// 2. Install all required components
const requiredComponents = [
'platform-tools',
'build-tools;29.0.3',
'platforms;android-29',
'build-tools;31.0.0',
'platforms;android-31',
'build-tools;28.0.3',
'platforms;android-28',
'emulator',
'system-images;android-28;google_apis;x86_64',
'system-images;android-31;google_apis;x86_64',
'--licenses',
];
// Make sure we are installing the right number
Expand Down
10 changes: 5 additions & 5 deletions packages/cli-doctor/src/tools/healthchecks/__tests__/jdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@ describe('jdk', () => {
it('returns false if JDK version is in range (JDK 9+ version number format)', async () => {
// @ts-ignore
environmentInfo.Languages.Java = {
version: '9.0.4',
version: '14.0.4',
};

const diagnostics = await jdk.getDiagnostics(environmentInfo);
expect(diagnostics.needsToBeFixed).toBe(false);
});

it('returns false if JDK version is in range (JDK 8 version number format)', async () => {
it('returns true if JDK version is not in range (JDK <= 8 version number format)', async () => {
// @ts-ignore
environmentInfo.Languages.Java = {
version: '1.8.0_282',
};

const diagnostics = await jdk.getDiagnostics(environmentInfo);
expect(diagnostics.needsToBeFixed).toBe(false);
expect(diagnostics.needsToBeFixed).toBe(true);
});

it('returns true if JDK version is not in range', async () => {
it('returns true if JDK version is not in range (JDK 9+ verison number format)', async () => {
// @ts-ignore
environmentInfo.Languages.Java = {
version: '7',
version: '10.0.15+10',
};

const diagnostics = await jdk.getDiagnostics(environmentInfo);
Expand Down
10 changes: 5 additions & 5 deletions packages/cli-doctor/src/tools/healthchecks/androidSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ export default {
win32AutomaticFix: async ({loader}) => {
// Need a GitHub action to update automatically. See #1180
const cliToolsUrl =
'https://dl.google.com/android/repository/commandlinetools-win-6200805_latest.zip';
'https://dl.google.com/android/repository/commandlinetools-win-8512546_latest.zip';

const systemImage = 'system-images;android-28;google_apis;x86_64';
const systemImage = 'system-images;android-31;google_apis;x86_64';
// Installing 29 as well so Android Studio does not complain on first boot
const componentsToInstall = [
'platform-tools',
'build-tools;29.0.3',
'platforms;android-29',
'build-tools;31.0.0',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified this matches template in react-native repo right now

'platforms;android-31',
// Is 28 still needed?
'build-tools;28.0.3',
'platforms;android-28',
Expand Down Expand Up @@ -182,7 +182,7 @@ export default {

return logManualInstallation({
healthcheck: 'Android SDK',
url: 'https://reactnative.dev/docs/getting-started',
url: 'https://reactnative.dev/docs/environment-setup',
});
},
} as HealthCheckInterface;
2 changes: 1 addition & 1 deletion packages/cli-doctor/src/tools/healthchecks/jdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
loader.fail();
logManualInstallation({
healthcheck: 'JDK',
url: 'https://openjdk.java.net/',
url: 'https://reactnative.dev/docs/environment-setup',
});
},
} as HealthCheckInterface;
4 changes: 2 additions & 2 deletions packages/cli-doctor/src/tools/versionRanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export default {
YARN: '>= 1.10.x',
NPM: '>= 4.x',
WATCHMAN: '>= 4.x',
JAVA: '1.8.x || >= 9',
JAVA: '>= 11',
// Android
ANDROID_SDK: '>= 26.x',
ANDROID_SDK: '>= 31.x',
ANDROID_NDK: '>= 19.x',
// iOS
XCODE: '>= 12.x',
Expand Down