Add missing entry to Version.Details.xml (#7643)

Changes:
* add entry for Mono.WebAssembly.Interop to Version.Details.xml
* Update code check to ensure all veriables in the 'automated' section are accounted for in Version.Details.xml
This commit is contained in:
Nate McMaster 2019-02-15 17:00:06 -08:00 committed by GitHub
parent 191fb03de7
commit 394ef0ab93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 10 deletions

View File

@ -277,6 +277,10 @@
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>61070026dca7117d439de0443cfbbb0fb7172c65</Sha>
</Dependency>
<Dependency Name="Mono.WebAssembly.Interop" Version="3.0.0-preview.19105.4">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>0000</Sha>
</Dependency>
<Dependency Name="Microsoft.Bcl.Json.Sources" Version="4.6.0-preview.19106.2">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>c38c10d28e223aeea2f363a6ef0bf4a63d00a776</Sha>

View File

@ -15,7 +15,19 @@ $repoRoot = Resolve-Path "$PSScriptRoot/../.."
[string[]] $errors = @()
function LogError([string]$message) {
function LogError {
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$message,
[string]$FilePath
)
if ($env:TF_BUILD) {
$prefix = "##vso[task.logissue type=error"
if ($FilePath) {
$prefix = "${prefix};sourcepath=$FilePath"
}
Write-Host "${prefix}]${message}"
}
Write-Host -f Red "error: $message"
$script:errors += $message
}
@ -26,13 +38,19 @@ try {
#
if ($ci) {
& $repoRoot/build.ps1 -ci /t:InstallDotNet
& $repoRoot/build.ps1 -ci -norestore /t:InstallDotNet
}
Write-Host "Checking that Versions.props and Version.Details.xml match"
[xml] $versionProps = Get-Content "$repoRoot/eng/Versions.props"
[xml] $versionDetails = Get-Content "$repoRoot/eng/Version.Details.xml"
foreach ($dep in $versionDetails.SelectNodes('//ProductDependencies/Dependency')) {
$versionVars = New-Object 'System.Collections.Generic.HashSet[string]'
foreach ($vars in $versionProps.SelectNodes("//PropertyGroup[`@Label=`"Automated`"]/*")) {
$versionVars.Add($vars.Name) | Out-Null
}
foreach ($dep in $versionDetails.SelectNodes('//Dependency')) {
Write-Verbose "Found $dep"
$varName = $dep.Name -replace '\.',''
$varName = $varName -replace '\-',''
@ -43,14 +61,24 @@ try {
continue
}
$versionVars.Remove($varName) | Out-Null
$expectedVersion = $dep.Version
$actualVersion = $versionVar.InnerText
if ($expectedVersion -ne $actualVersion) {
LogError "Version variable '$varName' does not match the value in Version.Details.xml. Expected '$expectedVersion', actual '$actualVersion'"
LogError `
"Version variable '$varName' does not match the value in Version.Details.xml. Expected '$expectedVersion', actual '$actualVersion'" `
-filepath "$repoRoot\eng\Versions.props"
}
}
foreach ($unexpectedVar in $versionVars) {
LogError `
"Version variable '$unexpectedVar' does not have a matching entry in Version.Details.xml. See https://github.com/aspnet/AspNetCore/blob/master/docs/ReferenceResolution.md for instructions on how to add a new dependency." `
-filepath "$repoRoot\eng\Versions.props"
}
Write-Host "Checking that solutions are up to date"
Get-ChildItem "$repoRoot/*.sln" -Recurse `
@ -92,12 +120,14 @@ try {
& $dotnet run -p "$repoRoot/eng/tools/BaselineGenerator/"
}
Write-Host "git diff"
& git diff --ignore-space-at-eol --exit-code
if ($LastExitCode -ne 0) {
$status = git status -s | Out-String
$status = $status -replace "`n","`n "
LogError "Generated code is not up to date."
Write-Host "Run git diff to check for pending changes"
$changedFiles = git --no-pager diff --ignore-space-at-eol --name-only
if ($changedFiles) {
foreach ($file in $changedFiles) {
$filePath = Resolve-Path "${repoRoot}/${file}"
LogError "Generated code is not up to date in $file." -filepath $filePath
& git --no-pager diff --ignore-space-at-eol $filePath
}
}
}
finally {