Skip to content

Commit

Permalink
build: Fix Powershell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ubolonton committed Mar 15, 2024
1 parent ab3a457 commit c903f30
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
27 changes: 14 additions & 13 deletions bin/build.ps1
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
$here = $PSScriptRoot
$project_root = (Get-Item $here).Parent.FullName

$target = $args[0]
if ($target -eq "release") {
$extra = "--release"
} else {
$target = "debug"
$extra = ""
}

$module_dir = "$project_root\target\$target"

Push-Location $project_root

cargo build --all $extra

Pop-Location
try {
switch ($target) {
'release' {
$module_dir = "$project_root\target\release"
cargo build --all --release
}
default {
$module_dir = "$project_root\target\debug"
cargo build --all
}
}
} finally {
Pop-Location
}

Copy-Item $module_dir\emacs_rs_module.dll $module_dir\rs-module.dll
Copy-Item $module_dir\test_module.dll $module_dir\t.dll
7 changes: 5 additions & 2 deletions bin/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ $module_dir = "$project_root\target\$target"

if ($args[0] -eq "watch") {
Push-Location $project_root
cargo watch -s "powershell bin\build.ps1" -s "powershell bin\test.ps1"
Pop-Location
try {
cargo watch -s "powershell bin\build.ps1" -s "powershell bin\test.ps1"
} finally {
Pop-Location
}
} else {
# XXX: It seems that Emacs writes to stderr, so PowerShell thinks it's an error. Redirecting to
# stdout alone doesn't help, because it's the processed stderr, which contain error records, not
Expand Down

0 comments on commit c903f30

Please sign in to comment.