-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild-examples.mts
More file actions
36 lines (32 loc) · 992 Bytes
/
build-examples.mts
File metadata and controls
36 lines (32 loc) · 992 Bytes
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
import { execSync } from "node:child_process";
import { platform } from "node:os";
import { findCMakeProjects } from "./cmake-projects.mjs";
const projectDirectories = findCMakeProjects();
// Platform-specific build command
let buildCommand: string;
switch (platform()) {
case "darwin":
// macOS: build for both Android and Apple
buildCommand = "react-native-node-api-cmake --android --apple";
break;
case "win32":
case "linux":
// Windows and Linux: only Android
buildCommand = "react-native-node-api-cmake --android";
break;
default:
console.error(`Unsupported platform: ${platform()}`);
process.exit(1);
}
for (const projectDirectory of projectDirectories) {
console.log(`Running "${buildCommand}" in ${projectDirectory}`);
execSync(
buildCommand,
// "react-native-node-api-cmake --triplet aarch64-linux-android --triplet arm64-apple-ios-sim",
{
cwd: projectDirectory,
stdio: "inherit",
}
);
console.log();
}