-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathgulpfile.js
More file actions
34 lines (28 loc) 路 1.11 KB
/
Copy pathgulpfile.js
File metadata and controls
34 lines (28 loc) 路 1.11 KB
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
const gulp = require("gulp");
const extract = require("extract-zip");
const fs = require("fs");
const path = require("path");
const { exec } = require("child_process");
gulp.task("build-debug-bridge", async (done) => {
const bridgeProjectDir = path.resolve("src", "debugger", "bridge", "dotnet", "nanoFramework.Tools.DebugBridge");
const baseOutputDir = path.resolve("bin", "nanoDebugBridge");
const promiseExec = require("util").promisify(exec);
fs.rmSync(baseOutputDir, { recursive: true, force: true });
try {
const { stdout } = await promiseExec(
`dotnet publish -c Release --self-contained false -o "${baseOutputDir}"`,
{ cwd: bridgeProjectDir }
);
if (stdout) console.log(stdout);
} catch (err) {
console.error("Error building debug bridge:", err.message);
done(err);
return;
}
console.log("Portable debug bridge built successfully");
done();
});
gulp.task("build", gulp.series("build-debug-bridge", async (done) => {
console.log("Build task completed. Debug bridge and serial port support ready.");
done();
}));