Skip to content

Commit 3138b98

Browse files
committed
add cmd/run.ts
1 parent e7e1e91 commit 3138b98

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

cmd/run.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { join } from "node:path";
2+
import { detectVisualStudio2026, runLogged } from "./util";
3+
import { clearDirPreserveSettings } from "./clean";
4+
5+
let clean = false;
6+
7+
let t = `/t:SumatraPDF`;
8+
t = `/t:SumatraPDF-dll`;
9+
10+
async function main() {
11+
const timeStart = performance.now();
12+
13+
console.log("debug build");
14+
if (clean) {
15+
const dirs = [join("out", "dbg64")];
16+
for (const dir of dirs) {
17+
clearDirPreserveSettings(dir);
18+
}
19+
}
20+
21+
const { msbuildPath } = detectVisualStudio2026();
22+
const sln = String.raw`vs2022\SumatraPDF.sln`;
23+
// const t = `/t:SumatraPDF;test_util`;
24+
const p = `/p:Configuration=Debug;Platform=x64`;
25+
await runLogged(msbuildPath, [sln, t, p, `/m`]);
26+
const elapsed = ((performance.now() - timeStart) / 1000).toFixed(1);
27+
console.log(`build took ${elapsed}s`);
28+
29+
const path = join("out", "dbg64", "SumatraPDF-dll.exe");
30+
Bun.spawn([path], {
31+
cwd: ".",
32+
});
33+
}
34+
35+
await main();

0 commit comments

Comments
 (0)