-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
52 lines (44 loc) · 1.02 KB
/
Copy pathbuild.ps1
File metadata and controls
52 lines (44 loc) · 1.02 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# TraceLoom build script for Windows
# Requires: Node.js, npm, Rust, cargo, Tauri CLI
# Usage:
# .\build.ps1 # Release build
# .\build.ps1 -Debug # Debug build
# .\build.ps1 -Dev # Run in dev mode
# .\build.ps1 -Clean # Remove build artifacts
# .\build.ps1 -Test # Run Rust unit tests
param(
[switch]$Debug,
[switch]$Dev,
[switch]$Clean,
[switch]$Test
)
$ErrorActionPreference = "Stop"
function Remove-BuildArtifacts {
$paths = @("dist", "src-tauri/target")
foreach ($p in $paths) {
if (Test-Path $p) {
Remove-Item -Recurse -Force $p
Write-Host "Removed $p"
}
}
Write-Host "Cleaned build artifacts."
}
if ($Clean) {
Remove-BuildArtifacts
exit 0
}
if ($Test) {
cargo test --manifest-path src-tauri/Cargo.toml
exit $LASTEXITCODE
}
if ($Dev) {
npx tauri dev
exit $LASTEXITCODE
}
if ($Debug) {
npx tauri build --debug
exit $LASTEXITCODE
}
# Default: release build
npx tauri build
exit $LASTEXITCODE