Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Build/NuGet/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MicroBuild.Core" version="0.2.0" targetFramework="native" developmentDependency="true" />
</packages>
<package id="SrcSrv" version="0.1.0" targetFramework="native" developmentDependency="true" />
</packages>
18 changes: 2 additions & 16 deletions Build/scripts/check_prefast_error.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ if (Test-Path -Path $logFile) {
Remove-Item $logFile -Force
}

# load rules
$rulefilter = @{};

if ($env:VS140COMNTOOLS -ne "") {
[xml]$ruleset = Get-Content "$env:VS140COMNTOOLS\..\..\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset"
foreach ($r in $ruleset.RuleSet.Rules.Rule) {
$rulefilter[$r.Id] = $r.Action;
}
} else {
WriteMessage "WARNING: No ruleset found. No filter applied."
}

# load all prefast results
$files = Get-ChildItem -recurse ("{0}\vc.nativecodeanalysis.all.xml" -f $directory)

Expand All @@ -40,10 +28,8 @@ foreach ($file in $files) {
$filecount++;
[xml]$x = Get-Content $file
foreach ($d in $x.DEFECTS.DEFECT) {
if ($rulefilter.Count -eq 0 -or $rulefilter[("C{0}" -f $d.DEFECTCODE)] -eq "Warning") {
WriteErrorMessage ("{0}{1}({2}): warning C{3}: {4}" -f $d.SFA.FILEPATH, $d.SFA.FILENAME, $d.SFA.LINE, $d.DEFECTCODE, $d.DESCRIPTION)
$count++;
}
WriteErrorMessage ("{0}{1}({2}): warning C{3}: {4}" -f $d.SFA.FILEPATH, $d.SFA.FILENAME, $d.SFA.LINE, $d.DEFECTCODE, $d.DESCRIPTION)
$count++;
}
}

Expand Down
35 changes: 21 additions & 14 deletions Build/scripts/finalize_build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ param (
[ValidateSet("default", "codecoverage", "pogo")]
[string]$subtype = "default",

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

[string]$destinationBase = $Env:DropPath
)

. $PSScriptRoot\pre_post_util.ps1
Expand All @@ -33,19 +35,14 @@ $coreSourcesDir = Join-Path $sourcesDir $corePathSegment

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

#
# Clean up the sentinel which previously marked this build flavor as incomplete.
#

Remove-Item -Path $Env:FlavorBuildIncompleteFile -Force

#
# Copy all logs to DropPath
#

$buildlogsDropPath = Join-Path $Env:DropPath "buildlogs"
$logsDropPath = Join-Path $Env:DropPath "logs"
$testlogsDropPath = Join-Path $Env:DropPath "testlogs"
$logBase = Join-Path $destinationBase "logs"
$buildlogsDropPath = Join-Path $logBase "buildlogs"
$logsDropPath = Join-Path $logBase "logs"
$testlogsDropPath = Join-Path $logBase "testlogs"

New-Item -Force -ItemType Directory -Path $buildlogsDropPath
New-Item -Force -ItemType Directory -Path $logsDropPath
Expand Down Expand Up @@ -91,7 +88,7 @@ if ((-not $BuildSucceeded) -or (-not $TestsPassed)) {
$Status = "failed"
}

$buildFlavorJsonFile = Join-Path $Env:DropPath "${Env:BuildName}.json"
$buildFlavorJsonFile = Join-Path $logBase "${Env:BuildName}.json"
$buildFlavorJson = New-Object System.Object

$buildFlavorJson | Add-Member -type NoteProperty -name buildName -value $Env:BuildName
Expand Down Expand Up @@ -122,13 +119,23 @@ Copy-Item -Verbose -Force $buildFlavorJsonFile $metadataDir
Get-ChildItem -Path (Join-Path $sourcesDir "Build") "*.nuspec" `
| ForEach-Object { Copy-Item -Verbose -Force $_.FullName $metadataDir }

#
# Copy binaries directory
#

$BinFolder = Join-Path $Env:BinariesDirectory "bin\${Env:BuildName}"
$BinDropPath = Join-Path $destinationBase "bin"
Write-Output "Copying `"$BinFolder`" to `"$BinDropPath`"..."
Copy-Item -Verbose $BinFolder $BinDropPath -Recurse -Force -Exclude "*_ttdlog*"

#
# Copy POGO directory if present for this build
#

$PogoFolder = Join-Path $Env:BinariesDirectory "bin\${Env:BuildType}_pogo"
if (Test-Path $PogoFolder) {
$BinDropPath = Join-Path $Env:DropPath "bin"
Write-Output "Copying `"$PogoFolder`" to `"$BinDropPath`"..."
Copy-Item -Verbose $PogoFolder $BinDropPath -Recurse -Force
$PogoBinDropPath = Join-Path $destinationBase "bin_pogo"
Write-Output "Copying `"$PogoFolder`" to `"$PogoBinDropPath`"..."
Write-Output "##vso[task.setvariable variable=VSO_POGOPresent;]true"
Copy-Item -Verbose $PogoFolder $PogoBinDropPath -Recurse -Force
}
3 changes: 1 addition & 2 deletions Build/scripts/pre_post_util.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function GetBuildInfo($oauth, $commitHash) {

# Get the pushId and push date time to use that for build number and build date time
$uri = ("{0}/commits/{1}?api-version=1.0" -f $remote, $commitHash)
$oauthToken = Get-Content $oauth
$header = @{ Authorization=("Basic {0}" -f $oauthToken) }
$header = @{ Authorization=("Bearer {0}" -f $oauth) }
$info = Invoke-RestMethod -Headers $header -Uri $uri -Method GET

return $info
Expand Down