我已经整理了一个 PSake (v2.0) 构建脚本,该脚本正在设置$psake.build_success
属性,true
即使对 MSBuild 的调用失败。谁能建议我如何更改脚本,以便在 MSBuild 调用失败时$psake.build_success
正确返回该属性?false
我的 PSake 构建脚本如下:
properties {
$solutionFile = 'SOLUTION_FILE'
$buildSuccessfulMessage = 'Solution Successfully Built!'
$buildFailureMessage = 'Solution Failed to Build!'
$cleanMessage = 'Executed Clean!'
}
task default -depends BuildSolution
task BuildSolution
{
msbuild $solutionFile /t:Clean,Build
if ($psake.build_success)
{
$buildSuccessfulMessage
}
else
{
$buildFailureMessage
}
}