-
Notifications
You must be signed in to change notification settings - Fork 911
/
Copy pathandroidNDK.ts
43 lines (38 loc) · 1.35 KB
/
androidNDK.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pico from 'picocolors';
import versionRanges from '../versionRanges';
import {doesSoftwareNeedToBeFixed} from '../checkInstallation';
import {EnvironmentInfo, HealthCheckInterface} from '../../types';
export default {
label: 'Android NDK',
description: 'Required for building React Native from the source',
getDiagnostics: async ({SDKs}: EnvironmentInfo) => {
const androidSdk = SDKs['Android SDK'];
const version =
androidSdk === 'Not Found' ? androidSdk : androidSdk['Android NDK'];
return {
needsToBeFixed: doesSoftwareNeedToBeFixed({
version,
versionRange: versionRanges.ANDROID_NDK,
}),
version,
versionRange: versionRanges.ANDROID_NDK,
};
},
runAutomaticFix: async ({loader, logManualInstallation, environmentInfo}) => {
const androidSdk = environmentInfo.SDKs['Android SDK'];
const isNDKInstalled =
androidSdk !== 'Not Found' && androidSdk['Android NDK'] !== 'Not Found';
loader.fail();
if (isNDKInstalled) {
return logManualInstallation({
message: `Read more about how to update Android NDK at ${pico.dim(
'https://developer.android.com/ndk/downloads',
)}`,
});
}
return logManualInstallation({
healthcheck: 'Android NDK',
url: 'https://developer.android.com/ndk/downloads',
});
},
} as HealthCheckInterface;