Fix vmr build number (#19217)

This commit is contained in:
Djuradj Kurepa 2024-03-27 19:15:52 +01:00 committed by GitHub
parent ba50c92ce5
commit 6b0cb559d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 9 deletions

View file

@ -321,6 +321,8 @@ jobs:
# Allows Arcade to have access to the commit for the build, pass it through to the container
customEnvVars="$customEnvVars BUILD_SOURCEVERSION=$BUILD_SOURCEVERSION"
customEnvVars="$customEnvVars BUILD_BUILDNUMBER=$(Build.BuildNumber)"
customDockerRunArgs=""
for envVar in $customEnvVars; do
customDockerRunArgs="$customDockerRunArgs -e $envVar"

View file

@ -214,12 +214,6 @@
<PoisonedReportFile>$(PackageReportDir)poisoned.txt</PoisonedReportFile>
</PropertyGroup>
<!-- The predefined environmental variable `BUILD_BUILDNUMBER` is getting overwritten in repo-projects,
so save it in a different varialbe-->
<PropertyGroup>
<VmrBuildNumber>$(BUILD_BUILDNUMBER)"</VmrBuildNumber>
</PropertyGroup>
<Import Project="$(GitInfoAllRepoPropsFile)" />
</Project>

View file

@ -36,10 +36,11 @@
<RepoAssetManifest Include="$(AssetManifestsIntermediateDir)\**\*.xml" />
</ItemGroup>
<!-- It's OK for the VmrBuildNumber to be empty -->
<Microsoft.DotNet.UnifiedBuild.Tasks.MergeAssetManifests
AssetManifest="@(RepoAssetManifest)"
MergedAssetManifestOutputPath="$(MergedAssetManifestOutputPath)"
VmrBuildNumber="$(VmrBuildNumber)" />
VmrBuildNumber="$(BUILD_BUILDNUMBER)" />
</Target>
<Import Project="$(RepositoryEngineeringDir)build.sourcebuild.targets" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />

View file

@ -31,8 +31,7 @@ namespace Microsoft.DotNet.UnifiedBuild.Tasks
/// <summary>
/// Azure DevOps build number
/// </summary>
[Required]
public required string VmrBuildNumber { get; init; }
public string VmrBuildNumber { get; set; } = string.Empty;
private static readonly string _buildIdAttribute = "BuildId";
private static readonly string _azureDevOpsBuildNumberAttribute = "AzureDevOpsBuildNumber";