Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

fix: search for the proper NDK executable on Windows #1073

Merged
merged 1 commit into from
Oct 21, 2019
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
3 changes: 2 additions & 1 deletion snapshot/android/snapshot-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const fs = require("fs");
const { dirname, relative, join, EOL } = require("path");
const child_process = require("child_process");
const { convertToUnixPath, warn } = require("../../lib/utils");
const { isWindows } = require("./utils");
const PropertiesReader = require('properties-reader');
const shelljs = require("shelljs");

Expand Down Expand Up @@ -209,7 +210,7 @@ SnapshotGenerator.prototype.buildSnapshotLibs = function (androidNdkPath, recomm
}

SnapshotGenerator.prototype.getAndroidNdkBuildPath = function (androidNdkPath, recommendedAndroidNdkRevision) {
const ndkBuildExecutableName = "ndk-build";
const ndkBuildExecutableName = isWindows() ? "ndk-build.cmd" : "ndk-build";
let hasNdk = false;
// fallback for Android Runtime < 6.2.0 with the 6.1.0 value
recommendedAndroidNdkRevision = recommendedAndroidNdkRevision || "20.0.5594570";
Expand Down
7 changes: 6 additions & 1 deletion snapshot/android/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function isMacOSCatalinaOrHigher() {
return isCatalinaOrHigher;
}

function isWindows() {
return getHostOS() === CONSTANTS.WIN_OS_NAME;
}

const downloadFile = (url, destinationFilePath, timeout) =>
new Promise((resolve, reject) => {
getRequestOptions(url, timeout)
Expand Down Expand Up @@ -119,5 +123,6 @@ module.exports = {
isMacOSCatalinaOrHigher,
downloadFile,
getJsonFile,
isSubPath
isSubPath,
isWindows
};