-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable POGO builds in MBv2 daily config, automatic NuGet generation and publication. Add build composition script. #863
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#------------------------------------------------------------------------------------------------------- | ||
# Copyright (C) Microsoft. All rights reserved. | ||
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
#------------------------------------------------------------------------------------------------------- | ||
|
||
# Compose Build script | ||
# | ||
# Aggregate metadata about a build and produce a file with useful information about the build | ||
# for tools to consume and get a quick overview of the status of a completed build. | ||
|
||
param ( | ||
[Parameter(Mandatory=$True)] | ||
[string]$rootPath | ||
) | ||
|
||
# | ||
# Clean up the sentinel which previously marked this build as incomplete. | ||
# | ||
|
||
$buildIncompleteFile = Join-Path $rootPath "build.incomplete" | ||
if (Test-Path $buildIncompleteFile) { | ||
Remove-Item -Path $buildIncompleteFile -Force | ||
} | ||
|
||
# | ||
# Aggregate build metadata and produce build.json | ||
# | ||
|
||
$outputJsonFile = Join-Path -Path $rootPath -ChildPath "build.json" | ||
$buildInfo = New-Object System.Object | ||
|
||
$changeJson = (Get-ChildItem -Path $rootPath "change.json" -Recurse)[0] | % { $_.FullName } | ||
$changeInfo = (Get-Content $changeJson) -join "`n" | ConvertFrom-Json | ||
|
||
# Determine the overall build status. Mark the build as "passed" until "failed" is encountered. | ||
$overallBuildStatus = "passed" | ||
|
||
$files = Get-ChildItem -Path $rootPath "*.json" -Recurse ` | ||
| ? { ($_.Name -ne "change.json") -and ($_.Name -ne "build.json") } ` | ||
| % { $_.FullName } | ||
$builds = New-Object System.Collections.ArrayList | ||
foreach ($file in $files) { | ||
$json = (Get-Content $file) -join "`n" | ConvertFrom-Json | ||
$_ = $builds.Add($json) | ||
|
||
if ($json.status -eq "failed") { | ||
$overallBuildStatus = "failed" | ||
} | ||
} | ||
|
||
$buildInfo | Add-Member -type NoteProperty -name status -value $overallBuildStatus | ||
$buildInfo | Add-Member -type NoteProperty -name change -value $changeInfo | ||
$buildInfo | Add-Member -type NoteProperty -name builds -value $builds | ||
|
||
$buildInfo | ConvertTo-Json | Write-Output | ||
$buildInfo | ConvertTo-Json | Out-File $outputJsonFile -Encoding ascii |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,6 @@ | |
param ( | ||
[string[]]$scenarios = @(), | ||
|
||
[string]$vcinstallroot = ${env:ProgramFiles(x86)}, | ||
[string]$vcbinpath = "Microsoft Visual Studio 14.0\VC\bin", | ||
[string]$dllname = "pgort140.dll", | ||
|
||
[Parameter(Mandatory=$True)] | ||
[string]$binary, | ||
|
||
|
@@ -27,9 +23,18 @@ param ( | |
|
||
# force callers to specify this in case of future use | ||
[Parameter(Mandatory=$True)] | ||
[string]$flavor = "" | ||
[string]$flavor, | ||
|
||
[string]$vcinstallroot = ${env:ProgramFiles(x86)}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to remove these in favor of a prebuild step. We can talk about it in person if you want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, we can follow up on desired changes for future iterations. We can talk in person today or Monday about this. |
||
[string]$vcbinpath = "Microsoft Visual Studio 14.0\VC\bin", | ||
[string]$dllname = "pgort140.dll" | ||
) | ||
|
||
if (${Env:PogoConfig} -eq "False") { | ||
Write-Host "---- Not a Pogo Config. Skipping step." | ||
return 0 | ||
} | ||
|
||
$binpath = Split-Path -Path $binary -Parent | ||
$pgoOutDll = Join-Path $binpath $dllname; | ||
if (-not (Test-Path ($pgoOutDll))) { | ||
|
@@ -49,8 +54,7 @@ for ($i = 0; $i -lt $scenarios.Length; $i = $i + 1) { | |
if (Test-Path $path -PathType Container) { | ||
# *.js files in directories | ||
$items = Get-ChildItem -Path $path -Filter "*.js" | % {join-path $path $_ } | ||
} | ||
else { | ||
} else { | ||
$items = @($path) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should pass as argument which flavor we want to pogo.
This is okay for the time being, but we should consider changing it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, we can follow up on desired changes for future iterations.