Permalink
Please sign in to comment.
Browse files
Use versions repo tooling from BuildTools.
Sets up dependencies.props config. Removes UpdateDependencies powershell script, to be replaced by a call into VersionTools in Maestro automation. Changes UpdatePublishedVersions to pass through to VersionTools for backward compatibility.
- Loading branch information...
Showing
with
112 additions
and 338 deletions.
- +0 −157 UpdateDependencies.ps1
- +10 −128 UpdatePublishedVersions.ps1
- +94 −0 dependencies.props
- +3 −3 dir.props
- +3 −16 tests/build.proj
- +2 −34 tests/dir.props
| @@ -1,157 +0,0 @@ | ||
| -# | ||
| -# Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
| -# Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
| -# | ||
| - | ||
| -# This script updates dir.props with the current version of CoreCLR | ||
| -# dependencies, and then creates a Pull Request for the change. | ||
| - | ||
| -param( | ||
| - [Parameter(Mandatory=$true)][string]$GitHubUser, | ||
| - [Parameter(Mandatory=$true)][string]$GitHubEmail, | ||
| - [Parameter(Mandatory=$true)][string]$GitHubPassword, | ||
| - [Parameter(Mandatory=$true)][string]$VersionFileUrl, | ||
| - [string[]]$DirPropsVersionElements = 'CoreClrExpectedPrerelease', | ||
| - [string]$GitHubUpstreamOwner='dotnet', | ||
| - [string]$GitHubOriginOwner=$GitHubUser, | ||
| - [string]$GitHubProject='coreclr', | ||
| - [string]$GitHubUpstreamBranch='master', | ||
| - # a semi-colon delimited list of GitHub users to notify on the PR | ||
| - [string]$GitHubPullRequestNotifications='') | ||
| - | ||
| -$LatestVersion = Invoke-WebRequest $VersionFileUrl -UseBasicParsing | ||
| -$LatestVersion = $LatestVersion.ToString().Trim() | ||
| - | ||
| -if ($DirPropsVersionElements -contains 'CoreClrExpectedPrerelease') | ||
| -{ | ||
| - # Also get list of all package versions, relative to the given prerelease version url. | ||
| - $LatestPackagesListUrl = $VersionFileUrl -Replace 'Latest.txt', 'Latest_Packages.txt' | ||
| - $LatestPackagesList = Invoke-WebRequest $LatestPackagesListUrl -UseBasicParsing | ||
| - $LatestCoreCLRPackage = $LatestPackagesList -split "`n" | ?{ $_.StartsWith('Microsoft.NETCore.Runtime.CoreCLR') } | ||
| - $LatestCoreCLRVersion = ($LatestCoreCLRPackage -split ' ')[1].Trim() | ||
| -} | ||
| - | ||
| - | ||
| -# Make a nicely formatted string of the dir props version elements. Short names, joined by commas. | ||
| -$DirPropsVersionNames = ($DirPropsVersionElements | %{ $_ -replace 'ExpectedPrerelease', '' }) -join ', ' | ||
| - | ||
| -# Updates the dir.props file with the latest build number | ||
| -function UpdateValidDependencyVersionsFile | ||
| -{ | ||
| - if (!$LatestVersion) | ||
| - { | ||
| - Write-Error "Unable to find latest dependency version at $VersionFileUrl ($DirPropsVersionNames)" | ||
| - return $false | ||
| - } | ||
| - | ||
| - $DirPropsPaths = @("$PSScriptRoot\dir.props", "$PSScriptRoot\tests\dir.props") | ||
| - | ||
| - $DirPropsPaths | %{ | ||
| - $DirPropsContent = Get-Content $_ | %{ | ||
| - $line = $_ | ||
| - | ||
| - $DirPropsVersionElements | %{ | ||
| - $line = $line -replace ` | ||
| - "<$_>.*</$_>", ` | ||
| - "<$_>$LatestVersion</$_>" | ||
| - } | ||
| - | ||
| - if ($LatestCoreCLRVersion) | ||
| - { | ||
| - $line = $line -replace ` | ||
| - "<CoreClrPackageVersion>.*<", ` | ||
| - "<CoreClrPackageVersion>$LatestCoreCLRVersion<" | ||
| - } | ||
| - | ||
| - $line | ||
| - } | ||
| - Set-Content $_ $DirPropsContent | ||
| - } | ||
| - | ||
| - return $true | ||
| -} | ||
| - | ||
| -# Updates all the project.json files with out of date version numbers | ||
| -function RunUpdatePackageDependencyVersions | ||
| -{ | ||
| - cmd /c $PSScriptRoot\build-test.cmd updateinvalidpackages | Out-Host | ||
| - | ||
| - return $LASTEXITCODE -eq 0 | ||
| -} | ||
| - | ||
| -# Creates a Pull Request for the updated version numbers | ||
| -function CreatePullRequest | ||
| -{ | ||
| - $GitStatus = git status --porcelain | ||
| - if ([string]::IsNullOrWhiteSpace($GitStatus)) | ||
| - { | ||
| - Write-Warning "Dependencies are currently up to date" | ||
| - return $true | ||
| - } | ||
| - | ||
| - $CommitMessage = "Updating $DirPropsVersionNames dependencies to $LatestVersion" | ||
| - | ||
| - $env:GIT_COMMITTER_NAME = $GitHubUser | ||
| - $env:GIT_COMMITTER_EMAIL = $GitHubEmail | ||
| - git commit -a -m "$CommitMessage" --author "$GitHubUser <$GitHubEmail>" | Out-Host | ||
| - | ||
| - $RemoteUrl = "github.com/$GitHubOriginOwner/$GitHubProject.git" | ||
| - $RemoteBranchName = "UpdateDependencies$([DateTime]::UtcNow.ToString('yyyyMMddhhmmss'))" | ||
| - $RefSpec = "HEAD:refs/heads/$RemoteBranchName" | ||
| - | ||
| - Write-Host "git push https://$RemoteUrl $RefSpec" | ||
| - # pipe this to null so the password secret isn't in the logs | ||
| - git push "https://$($GitHubUser):$GitHubPassword@$RemoteUrl" $RefSpec 2>&1 | Out-Null | ||
| - | ||
| - if ($GitHubPullRequestNotifications) | ||
| - { | ||
| - $PRNotifications = $GitHubPullRequestNotifications.Split(';', [StringSplitOptions]::RemoveEmptyEntries) -join ' @' | ||
| - $PRBody = "/cc @$PRNotifications" | ||
| - } | ||
| - else | ||
| - { | ||
| - $PRBody = '' | ||
| - } | ||
| - | ||
| - $CreatePRBody = @" | ||
| - { | ||
| - "title": "$CommitMessage", | ||
| - "body": "$PRBody", | ||
| - "head": "$($GitHubOriginOwner):$RemoteBranchName", | ||
| - "base": "$GitHubUpstreamBranch" | ||
| - } | ||
| -"@ | ||
| - | ||
| - $CreatePRHeaders = @{'Accept'='application/vnd.github.v3+json'; 'Authorization'="token $GitHubPassword"} | ||
| - | ||
| - try | ||
| - { | ||
| - Invoke-WebRequest https://api.github.com/repos/$GitHubUpstreamOwner/$GitHubProject/pulls -UseBasicParsing -Method Post -Body $CreatePRBody -Headers $CreatePRHeaders | ||
| - } | ||
| - catch | ||
| - { | ||
| - Write-Error $_.ToString() | ||
| - return $false | ||
| - } | ||
| - | ||
| - return $true | ||
| -} | ||
| - | ||
| -if (!(UpdateValidDependencyVersionsFile)) | ||
| -{ | ||
| - Exit -1 | ||
| -} | ||
| - | ||
| -if (!(RunUpdatePackageDependencyVersions)) | ||
| -{ | ||
| - Exit -1 | ||
| -} | ||
| - | ||
| -if (!(CreatePullRequest)) | ||
| -{ | ||
| - Exit -1 | ||
| -} | ||
| - | ||
| -Write-Host -ForegroundColor Green "Successfully updated dependencies from the latest build numbers" | ||
| - | ||
| -exit $LastExitCode |
| @@ -0,0 +1,94 @@ | ||
| +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| + <!-- Source of truth for dependency tooling: the commit hash of the dotnet/versions master branch as of the last auto-upgrade. --> | ||
| + <PropertyGroup> | ||
| + <CoreFxCurrentRef>afe7fab6bb2a2cd82d381eab880d290b23ed5214</CoreFxCurrentRef> | ||
| + <CoreClrCurrentRef>5adc811e2d62ae1543bc3e88748476d088532d2a</CoreClrCurrentRef> | ||
| + <ExternalCurrentRef>039e8532657c2599e2f8baf2c3dcd95265f28645</ExternalCurrentRef> | ||
| + </PropertyGroup> | ||
| + | ||
| + <!-- Auto-upgraded properties for each build info dependency. --> | ||
| + <PropertyGroup> | ||
| + <CoreFxExpectedPrerelease>beta-24328-05</CoreFxExpectedPrerelease> | ||
| + <ExternalExpectedPrerelease>beta-24417-00</ExternalExpectedPrerelease> | ||
| + </PropertyGroup> | ||
| + | ||
| + <!-- Full package version strings that are used in other parts of the build. --> | ||
| + <PropertyGroup> | ||
| + <CoreClrPackageVersion>1.0.4-beta-24325-02</CoreClrPackageVersion> | ||
| + <XunitPackageVersion>2.1.0</XunitPackageVersion> | ||
| + </PropertyGroup> | ||
| + | ||
| + <!-- Package dependency verification/auto-upgrade configuration. --> | ||
| + <PropertyGroup> | ||
| + <BaseDotNetBuildInfo>build-info/dotnet/</BaseDotNetBuildInfo> | ||
| + <DependencyBranch>master</DependencyBranch> | ||
| + <CurrentRefXmlPath>$(MSBuildThisFileFullPath)</CurrentRefXmlPath> | ||
| + </PropertyGroup> | ||
| + | ||
| + <ItemGroup> | ||
| + <RemoteDependencyBuildInfo Include="CoreFx"> | ||
| + <BuildInfoPath>$(BaseDotNetBuildInfo)corefx/$(DependencyBranch)</BuildInfoPath> | ||
| + <CurrentRef>$(CoreFxCurrentRef)</CurrentRef> | ||
| + </RemoteDependencyBuildInfo> | ||
| + <RemoteDependencyBuildInfo Include="CoreClr"> | ||
| + <BuildInfoPath>$(BaseDotNetBuildInfo)coreclr/$(DependencyBranch)</BuildInfoPath> | ||
| + <CurrentRef>$(CoreClrCurrentRef)</CurrentRef> | ||
| + </RemoteDependencyBuildInfo> | ||
| + <RemoteDependencyBuildInfo Include="External"> | ||
| + <BuildInfoPath>$(BaseDotNetBuildInfo)projectk-tfs/$(DependencyBranch)</BuildInfoPath> | ||
| + <CurrentRef>$(ExternalCurrentRef)</CurrentRef> | ||
| + </RemoteDependencyBuildInfo> | ||
| + | ||
| + <DependencyBuildInfo Include="@(RemoteDependencyBuildInfo)"> | ||
| + <RawVersionsBaseUrl>https://raw.githubusercontent.com/dotnet/versions</RawVersionsBaseUrl> | ||
| + </DependencyBuildInfo> | ||
| + | ||
| + <XmlUpdateStep Include="CoreFx"> | ||
| + <Path>$(MSBuildThisFileFullPath)</Path> | ||
| + <ElementName>CoreFxExpectedPrerelease</ElementName> | ||
| + <BuildInfoName>CoreFx</BuildInfoName> | ||
| + </XmlUpdateStep> | ||
| + <XmlUpdateStep Include="CoreClr"> | ||
| + <Path>$(MSBuildThisFileFullPath)</Path> | ||
| + <ElementName>CoreClrPackageVersion</ElementName> | ||
| + <PackageId>Microsoft.NETCore.Runtime.CoreCLR</PackageId> | ||
| + </XmlUpdateStep> | ||
| + <XmlUpdateStep Include="External"> | ||
| + <Path>$(MSBuildThisFileFullPath)</Path> | ||
| + <ElementName>ExternalExpectedPrerelease</ElementName> | ||
| + <BuildInfoName>External</BuildInfoName> | ||
| + </XmlUpdateStep> | ||
| + </ItemGroup> | ||
| + | ||
| + <!-- Set up dependencies on packages that aren't found in a BuildInfo. --> | ||
| + <ItemGroup> | ||
| + <XUnitDependency Include="xunit"/> | ||
| + <XUnitDependency Include="xunit.assert"/> | ||
| + <XUnitDependency Include="xunit.core"/> | ||
| + <XUnitDependency Include="xunit.runner.console"/> | ||
| + <XUnitDependency Include="xunit.runner.msbuild"/> | ||
| + <XUnitDependency Include="xunit.runner.utility"/> | ||
| + <StaticDependency Include="@(XUnitDependency)"> | ||
| + <Version>$(XunitPackageVersion)</Version> | ||
| + </StaticDependency> | ||
| + | ||
| + <XunitPerformanceDependency Include="Microsoft.DotNet.xunit.performance.analysis" /> | ||
| + <XunitPerformanceDependency Include="Microsoft.DotNet.xunit.performance.analysis.cli" /> | ||
| + <XunitPerformanceDependency Include="Microsoft.DotNet.xunit.performance.metrics" /> | ||
| + <XunitPerformanceDependency Include="Microsoft.DotNet.xunit.performance.run.core" /> | ||
| + <XunitPerformanceDependency Include="Microsoft.DotNet.xunit.performance.runner.cli" /> | ||
| + <XunitPerformanceDependency Include="Microsoft.DotNet.xunit.performance.runner.Windows" /> | ||
| + <StaticDependency Include="@(XunitPerformanceDependency)"> | ||
| + <Version>1.0.0-alpha-build0035</Version> | ||
| + </StaticDependency> | ||
| + | ||
| + <StaticDependency Include="xunit.console.netcore"> | ||
| + <Version>1.0.2-prerelease-00101</Version> | ||
| + </StaticDependency> | ||
| + | ||
| + <DependencyBuildInfo Include="@(StaticDependency)"> | ||
| + <PackageId>%(Identity)</PackageId> | ||
| + <UpdateStableVersions>true</UpdateStableVersions> | ||
| + </DependencyBuildInfo> | ||
| + </ItemGroup> | ||
| +</Project> |
Oops, something went wrong.
0 comments on commit
5a63fd8