Skip to content

Commit f21f1df

Browse files
committed
fix bugs in ci scripts
1 parent 05aa747 commit f21f1df

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

scripts/ci/Build.ps1

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ param(
1111
)
1212

1313
if (-not (Test-Path $VcpkgRootDir)) {
14-
Write-Error "Vcpkg root directory does not exist: $VcpkgRootDir"
15-
exit 1
14+
throw "Vcpkg root directory does not exist: $VcpkgRootDir"
1615
}
1716

1817
Write-Host "Build type: $BuildType"
@@ -25,8 +24,7 @@ $cmakeContent = Get-Content $cmakeListsPath -Raw
2524
$projectMatch = [regex]::Match($cmakeContent, 'project\s*\(\s*(\w+)\s+VERSION\s+([\d.]+)')
2625

2726
if (-not $projectMatch.Success) {
28-
Write-Error "Could not find project declaration with VERSION in CMakeLists.txt"
29-
exit 1
27+
throw "Could not find project declaration with VERSION in CMakeLists.txt"
3028
}
3129

3230
$projectName = $projectMatch.Groups[1].Value
@@ -76,10 +74,10 @@ cmake -B build -G Ninja `
7674
"-DAPPLICATION_NAME=$applicationName" `
7775
"-DAPPLICATION_DISPLAY_NAME=$applicationDisplayName" `
7876
"-DAPPLICATION_SEMVER=$semver" `
79-
-DCMAKE_INSTALL_PREFIX=installed
77+
-DCMAKE_INSTALL_PREFIX=installed | Write-Host
8078

81-
cmake --build build --target all
82-
cmake --build build --target install
79+
cmake --build build --target all | Write-Host
80+
cmake --build build --target install | Write-Host
8381

8482
$buildResult = @{
8583
ProjectName = $projectName

scripts/ci/Collect-Symbol-Files.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ if ($IsWindows) {
1818
Push-Location $InstalledDir
1919
$dllFiles = Get-ChildItem -Path . -Recurse | Where-Object { $_.Extension -eq '.exe' -or $_.Extension -eq '.dll' }
2020
foreach ($dllFile in $dllFiles) {
21-
dumpbin /PDBPATH:VERBOSE $dllFile.FullName
21+
dumpbin /PDBPATH:VERBOSE $dllFile.FullName | Write-Host
2222
$dumpbinOutput = dumpbin /PDBPATH $dllFile.FullName
2323
$matches = [regex]::Matches($dumpbinOutput, $PATTERN)
2424
if ($matches.Count -gt 0) {
2525
$pdbPath = $matches.Groups[1].Value
26-
Write-Output "$dllFile -> $pdbPath"
26+
Write-Host "$dllFile -> $pdbPath"
2727
$pdbTargetDirectory = "$symbolFilesDirectory/$(Split-Path $(Resolve-Path $dllFile.FullName -Relative))"
2828
if (!(Test-Path $pdbTargetDirectory)) {
2929
New-Item $pdbTargetDirectory -ItemType directory
3030
}
3131
Copy-Item $pdbPath $pdbTargetDirectory
3232
} else {
33-
Write-Output "No PDB file: $dllFile"
33+
Write-Host "No PDB file: $dllFile"
3434
}
3535
}
3636
Pop-Location
@@ -40,15 +40,15 @@ if ($IsWindows) {
4040
foreach ($dllFile in $dllFiles) {
4141
$dsymutilOutput = dsymutil -s $dllFile.FullName
4242
if ($dsymutilOutput -match "N_OSO") {
43-
Write-Output "Copy and strip debug_info: $dllFile"
43+
Write-Host "Copy and strip debug_info: $dllFile"
4444
$pdbTargetDirectory = "$symbolFilesDirectory/$(Split-Path $(Resolve-Path $dllFile.FullName -Relative))"
4545
if (!(Test-Path $pdbTargetDirectory)) {
4646
New-Item $pdbTargetDirectory -ItemType directory
4747
}
4848
dsymutil $dllFile.FullName -o "$pdbTargetDirectory/$($dllFile.Name).dSYM"
4949
strip -S $dllFile.FullName
5050
} else {
51-
Write-Output "Skip: $dllFile"
51+
Write-Host "Skip: $dllFile"
5252
}
5353
}
5454
Pop-Location
@@ -59,15 +59,15 @@ if ($IsWindows) {
5959
file $dllFile.FullName
6060
$fileOutput = file $dllFile.FullName
6161
if ($fileOutput -match "with debug_info") {
62-
Write-Output "Copy and strip debug_info: $dllFile"
62+
Write-Host "Copy and strip debug_info: $dllFile"
6363
$pdbTargetDirectory = "$symbolFilesDirectory/$(Split-Path $(Resolve-Path $dllFile.FullName -Relative))"
6464
if (!(Test-Path $pdbTargetDirectory)) {
6565
New-Item $pdbTargetDirectory -ItemType directory
6666
}
6767
objcopy --only-keep-debug $dllFile.FullName "$pdbTargetDirectory/$($dllFile.Name).debug"
6868
strip --strip-debug $dllFile.FullName
6969
} else {
70-
Write-Output "Skip: $dllFile"
70+
Write-Host "Skip: $dllFile"
7171
}
7272
}
7373
Pop-Location

scripts/ci/Pack.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ if ($IsWindows) {
1717
New-Item -ItemType Directory -Force -Path $env:INNOSETUP_MESSAGE_FILES_DIR
1818
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/$InnoSetupCommit/Files/Languages/Unofficial/ChineseSimplified.isl" -OutFile "$env:INNOSETUP_MESSAGE_FILES_DIR\ChineseSimplified.isl"
1919
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/$InnoSetupCommit/Files/Languages/Unofficial/ChineseTraditional.isl" -OutFile "$env:INNOSETUP_MESSAGE_FILES_DIR\ChineseTraditional.isl"
20-
ISCC $BuildDir/dist/installer/windows/setup.iss
20+
ISCC $BuildDir/dist/installer/windows/setup.iss | Write-Host
2121
if (! (Test-Path "${InstallerFileBase}.exe")) {
22-
Write-Error "Installer file was not created: ${InstallerFileBase}.exe"
23-
exit 1
22+
throw "Installer file was not created: ${InstallerFileBase}.exe"
2423
}
2524
Write-Output $(Resolve-Path "${InstallerFileBase}.exe")
2625
}

0 commit comments

Comments
 (0)