Skip to content

Commit 8a38d3f

Browse files
committed
Improve build system, report error when build fail
1 parent 21bca2d commit 8a38d3f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

1k/1kiss.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ function find_prog($name, $path = $null, $mode = 'ONLY', $cmd = $null, $params =
658658
$verStr = $(. $cmd @params 2>$null) | Select-Object -First 1
659659
if ($LASTEXITCODE) {
660660
Write-Warning "1kiss: Get version of $cmd fail"
661-
$LASTEXITCODE = 0
661+
$Global:LASTEXITCODE = 0
662662
}
663663
if (!$verStr -or $verStr.Contains('--version')) {
664664
$verInfo = $cmd_info.Version

tools/cmdline/axmol.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ param(
55

66
# Set-StrictMode -Version Latest
77

8+
# clear last exit code
9+
$Global:LASTEXITCODE = 0
10+
811
# pwsh function alias
912
function println($message) { Write-Host "axmol: $message" }
1013

tools/cmdline/build.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,11 @@ if ($forceConfig) {
199199
. $1k_script @1k_args @forward_args @unhandled_args
200200

201201
if (!$configOnly) {
202-
$1k.pause('Build done')
202+
if ($?) {
203+
$1k.pause('Build success')
204+
} else {
205+
throw "Build fail, ret=$LASTEXITCODE"
206+
}
203207
}
204208
else {
205209
$1k.pause('Generate done')

0 commit comments

Comments
 (0)