Skip to content

Commit

Permalink
[MERGE #1095] MicroBuild v2: Update finalize_build.ps1 to take parame…
Browse files Browse the repository at this point in the history
…ters and look in the correct file for test summaries.

Merge pull request #1095 from dilijev:mbv2
  • Loading branch information
dilijev committed Jun 8, 2016
2 parents 1686c29 + 3f9ad4c commit 2475f39
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
20 changes: 18 additions & 2 deletions Build/scripts/finalize_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,28 @@
# to clean up and produce metadata about the build.

param (
[Parameter(Mandatory=$True)]
[ValidateSet("x86", "x64", "arm")]
[string]$arch,

[Parameter(Mandatory=$True)]
[ValidateSet("debug", "release", "test", "codecoverage")]
[string]$flavor,

[ValidateSet("default", "codecoverage", "pogo")]
[string]$subtype = "default",

$corePathSegment = "" # e.g. "core"
)

$sourcesDir = $Env:BUILD_SOURCESDIRECTORY
$coreSourcesDir = Join-Path $sourcesDir $corePathSegment

$OuterScriptRoot = $PSScriptRoot
. "$PSScriptRoot\pre_post_util.ps1"

$buildName = ConstructBuildName -arch $arch -flavor $flavor -subtype $subtype

#
# Clean up the sentinel which previously marked this build flavor as incomplete.
#
Expand Down Expand Up @@ -51,8 +67,8 @@ if (Test-Path $testlogsSourcePath) {
# Create build status JSON file for this flavor.
#

$buildErrFile = Join-Path $buildLogsDropPath "build.${Env:BuildName}.err"
$testSummaryFile = Join-Path $testLogsDropPath "summary.${Env:BuildName}.log"
$buildErrFile = Join-Path $buildLogsDropPath "build.${buildName}.err"
$testSummaryFile = Join-Path $testLogsDropPath "summary.${arch}${flavor}.log"

# if build.*.err contains any text then there were build errors
$BuildSucceeded = $true
Expand Down
5 changes: 3 additions & 2 deletions Build/scripts/post_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ if ($arch -eq "*") {
$OuterScriptRoot = $PSScriptRoot
. "$PSScriptRoot\pre_post_util.ps1"

$buildName = ConstructBuildName -arch $arch -flavor $flavor -subtype $subtype

if (($logFile -eq "") -and (Test-Path Env:\TF_BUILD_BINARIESDIRECTORY)) {
$logFile = "${Env:TF_BUILD_BINARIESDIRECTORY}\logs\post_build.${Env:BuildName}.log"
$logFile = "${Env:TF_BUILD_BINARIESDIRECTORY}\logs\post_build.${buildName}.log"
if (Test-Path -Path $logFile) {
Remove-Item $logFile -Force
}
Expand All @@ -78,7 +80,6 @@ if ($arch -eq "*") {
WriteMessage "BVT Command : $bvtcmdpath"
WriteMessage ""

$buildName = ConstructBuildName -arch $arch -flavor $flavor -subtype $subtype
$srcsrvcmd = ("{0} {1} {2} {3}\bin\{4}\*.pdb" -f $srcsrvcmdpath, $repo, $srcpath, $binpath, $buildName)
$prefastlog = ("{0}\logs\PrefastCheck.{1}.log" -f $binpath, $buildName)
$prefastcmd = "$PSScriptRoot\check_prefast_error.ps1 -directory $objpath -logFile $prefastlog"
Expand Down
2 changes: 2 additions & 0 deletions Build/scripts/run_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ if ($subtype -eq "codecoverage") {

$buildCommand = "& `"$msbuildExe`" $targets $defaultParams $loggingParams $subtypeParams"
ExecuteCommand "$buildCommand"

exit $global:lastexitcode

0 comments on commit 2475f39

Please sign in to comment.