Skip to content

Commit 33c3e37

Browse files
authored
For Ticket #6 (#7)
When -ShowOutput is set, & msbuild.exe @arguments on line 163 sends MSBuild's output into the PowerShell pipeline. That output flows back through Invoke-MsbuildProject and gets mixed in with the returned [pscustomobject], so $buildResult becomes an array of strings + the object. $buildResult.ExitCode then fails under Set-StrictMode.
1 parent f0c2e4e commit 33c3e37

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,27 @@ Then each `KEY=VALUE` line from `set` is applied to the current PowerShell
328328
process environment via `[Environment]::SetEnvironmentVariable`. This
329329
makes `msbuild.exe` available on `PATH` for the remainder of the session.
330330

331+
332+
# Comparison with delphi-dccbuild.ps1
333+
334+
| Aspect | delphi-dccbuild.ps1 | delphi-msbuild.ps1 |
335+
|----------------------|------------------------------|---------------------------------|
336+
| Project file type | `.dpr` | `.dproj` |
337+
| Build system | `dcc*.exe` | `msbuild.exe` |
338+
| Environment setup | Sources `rsvars.bat` | Sources `rsvars.bat` |
339+
| Config parameter | Added as define (`-DDEBUG`) | Passed as `/p:Config=Debug` |
340+
| Target: Rebuild | `-B` flag | `/t:Rebuild` |
341+
| Target: Clean | Not available | `/t:Clean` |
342+
| Verbosity options | `quiet`, `normal` | `quiet` through `diagnostic` |
343+
| Result `rsvarsPath` | Present | Present |
344+
| Result `compilerPath`| Present | Not present |
345+
| Inspect -BuildSystem | `DCC` | `MSBuild` |
346+
347+
Both scripts use the same `-RootDir` parameter and accept the same
348+
pipeline object shape (`.rootDir` property), so the same
349+
`delphi-inspect.ps1 -DetectLatest` result object works with either.
350+
351+
331352
## Maturity
332353

333354
This repository is currently `incubator`. Both implementations are under active development.

source/delphi-msbuild.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function Invoke-MsbuildExe {
160160
)
161161

162162
if ($ShowOutput) {
163-
& msbuild.exe @Arguments
163+
& msbuild.exe @Arguments | Out-Host
164164
return [pscustomobject]@{ ExitCode = $LASTEXITCODE; Output = $null }
165165
}
166166

0 commit comments

Comments
 (0)