Check if the supported version (10e) of Android NDK is installed

This commit is contained in:
Ashwin Phatak 2017-08-18 13:49:32 +05:30
parent 85fb49b354
commit a3795fdfb0
1 changed files with 24 additions and 1 deletions

View File

@ -54,6 +54,29 @@ exec('npm --version', (err, stdout) => {
validateEnvPath('REALM_CORE_PREFIX'); validateEnvPath('REALM_CORE_PREFIX');
validateEnvPath('REALM_SYNC_PREFIX'); validateEnvPath('REALM_SYNC_PREFIX');
// TODO: Check ANDROID_NDK and SDK for Android, and XCode for iOS. // Check ANDROID_NDK version
exec('which ndk-build', (err, stdout) => {
if(err) {
console.error("Android NDK (ndk-build) not found");
console.error(err.message);
process.exit(-1);
}
const ndkBuildPath = stdout.trim();
const ndkDirPath = path.dirname(ndkBuildPath);
const releaseTxtPath = path.join(ndkDirPath, "RELEASE.TXT");
exec(`grep ^r10e ${releaseTxtPath}`, (err, stdout) => {
if(err) {
// RELEASE.TXT doesn't exist or version mismatch
console.error("Incompatible Android NDK version found. NDK 10e is required.")
process.exit(-1);
}
successLog('Android NDK 10e found');
});
});
// TODO: Check SDK for Android, and XCode for iOS.
}); });