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

Commit

Permalink
fix: search for the proper NDK executable on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarTachev committed Oct 18, 2019
1 parent 200e4b6 commit f93bb6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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
};

0 comments on commit f93bb6c

Please sign in to comment.