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

Commit b93211d

Browse files
author
Dimitar Tachev
authored
Merge pull request #1073 from NativeScript/tachev/fix-ndk-windows
fix: search for the proper NDK executable on Windows
2 parents 200e4b6 + f93bb6c commit b93211d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: snapshot/android/snapshot-generator.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const fs = require("fs");
22
const { dirname, relative, join, EOL } = require("path");
33
const child_process = require("child_process");
44
const { convertToUnixPath, warn } = require("../../lib/utils");
5+
const { isWindows } = require("./utils");
56
const PropertiesReader = require('properties-reader');
67
const shelljs = require("shelljs");
78

@@ -209,7 +210,7 @@ SnapshotGenerator.prototype.buildSnapshotLibs = function (androidNdkPath, recomm
209210
}
210211

211212
SnapshotGenerator.prototype.getAndroidNdkBuildPath = function (androidNdkPath, recommendedAndroidNdkRevision) {
212-
const ndkBuildExecutableName = "ndk-build";
213+
const ndkBuildExecutableName = isWindows() ? "ndk-build.cmd" : "ndk-build";
213214
let hasNdk = false;
214215
// fallback for Android Runtime < 6.2.0 with the 6.1.0 value
215216
recommendedAndroidNdkRevision = recommendedAndroidNdkRevision || "20.0.5594570";

Diff for: snapshot/android/utils.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ function isMacOSCatalinaOrHigher() {
6060
return isCatalinaOrHigher;
6161
}
6262

63+
function isWindows() {
64+
return getHostOS() === CONSTANTS.WIN_OS_NAME;
65+
}
66+
6367
const downloadFile = (url, destinationFilePath, timeout) =>
6468
new Promise((resolve, reject) => {
6569
getRequestOptions(url, timeout)
@@ -119,5 +123,6 @@ module.exports = {
119123
isMacOSCatalinaOrHigher,
120124
downloadFile,
121125
getJsonFile,
122-
isSubPath
126+
isSubPath,
127+
isWindows
123128
};

0 commit comments

Comments
 (0)