diff --git a/build.ps1 b/build.ps1 index e686f95c5b..e7b6a47dba 100644 --- a/build.ps1 +++ b/build.ps1 @@ -144,10 +144,12 @@ Invoke-BuildStep 'Signing the binaries' { -skip:$SkipArtifacts ` -ev +BuildErrors +$packageVersions = "/p:CommonPackageVersion=$CommonPackageVersion;GalleryPackageVersion=$GalleryPackageVersion;JobsPackageVersion=$JobsPackageVersion" + Invoke-BuildStep 'Creating common artifacts' { $CommonPackages = $CommonProjects | Where-Object { $_.IsSrc } $CommonPackages | ForEach-Object { - New-ProjectPackage $_.Path -Configuration $Configuration -BuildNumber $BuildNumber -Version $CommonPackageVersion + New-ProjectPackage $_.Path -Configuration $Configuration -Symbols -Options $packageVersions } } ` -skip:($SkipCommon -or $SkipArtifacts) ` @@ -160,7 +162,7 @@ Invoke-BuildStep 'Creating gallery artifacts' { ` "src\NuGetGallery.Core\NuGetGallery.Core.csproj", "src\NuGetGallery.Services\NuGetGallery.Services.csproj" $GalleryProjects | ForEach-Object { - New-ProjectPackage (Join-Path $PSScriptRoot $_) -Configuration $Configuration -BuildNumber $BuildNumber -Version $GalleryPackageVersion -Branch $Branch -Symbols + New-ProjectPackage (Join-Path $PSScriptRoot $_) -Configuration $Configuration -Symbols -Options $packageVersions } $GalleryNuspecProjects = @@ -197,7 +199,7 @@ Invoke-BuildStep 'Creating jobs artifacts' { "src\Validation.ScanAndSign.Core\Validation.ScanAndSign.Core.csproj", "src\Validation.Symbols.Core\Validation.Symbols.Core.csproj" $JobsProjects | ForEach-Object { - New-ProjectPackage (Join-Path $PSScriptRoot $_) -Configuration $Configuration -BuildNumber $BuildNumber -Version $JobsPackageVersion -Branch $Branch -Symbols + New-ProjectPackage (Join-Path $PSScriptRoot $_) -Configuration $Configuration -Symbols -Options $packageVersions } $JobsNuspecProjects = diff --git a/build/common.ps1 b/build/common.ps1 index d51d26d064..c15ec959e7 100644 --- a/build/common.ps1 +++ b/build/common.ps1 @@ -762,7 +762,8 @@ Function New-ProjectPackage { [string]$Branch, [switch]$IncludeReferencedProjects, [switch]$Sign, - [switch]$BinLog + [switch]$BinLog, + [string[]]$Options ) Trace-Log "Creating package from @""$TargetFilePath""" @@ -789,6 +790,8 @@ Function New-ProjectPackage { } elseif ($ReleaseLabel) { $PackageVersion = Get-PackageVersion $ReleaseLabel $BuildNumber + } else { + $PackageVersion = $null } if ($PackageVersion) { @@ -811,6 +814,10 @@ Function New-ProjectPackage { $opts += "/bl" } + if ($Options) { + $opts += $Options + } + if (-not (Test-Path $Artifacts)) { New-Item $Artifacts -Type Directory } diff --git a/src/Catalog/NuGet.Services.Metadata.Catalog.csproj b/src/Catalog/NuGet.Services.Metadata.Catalog.csproj index 6d7f6b14bd..2bc7e8c25a 100644 --- a/src/Catalog/NuGet.Services.Metadata.Catalog.csproj +++ b/src/Catalog/NuGet.Services.Metadata.Catalog.csproj @@ -1,9 +1,10 @@ - + net472;netstandard2.1 + $(JobsPackageVersion) Create, edit, or read the package metadata catalog. nuget;services;search;catalog;metadata;collector diff --git a/src/Microsoft.PackageManagement.Search.Web/Microsoft.PackageManagement.Search.Web.csproj b/src/Microsoft.PackageManagement.Search.Web/Microsoft.PackageManagement.Search.Web.csproj index 3720750e03..886b0c5518 100644 --- a/src/Microsoft.PackageManagement.Search.Web/Microsoft.PackageManagement.Search.Web.csproj +++ b/src/Microsoft.PackageManagement.Search.Web/Microsoft.PackageManagement.Search.Web.csproj @@ -1,9 +1,10 @@ - + net6.0 + $(JobsPackageVersion) diff --git a/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj b/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj index c561f5375d..cb958d4270 100644 --- a/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj +++ b/src/NuGet.Jobs.Common/NuGet.Jobs.Common.csproj @@ -4,6 +4,7 @@ net472;netstandard2.1 + $(JobsPackageVersion) NuGet.Jobs Common infrastructure for running the NuGetGallery back-end jobs. diff --git a/src/NuGet.Protocol.Catalog/NuGet.Protocol.Catalog.csproj b/src/NuGet.Protocol.Catalog/NuGet.Protocol.Catalog.csproj index 2e62b6776c..eab24e87f7 100644 --- a/src/NuGet.Protocol.Catalog/NuGet.Protocol.Catalog.csproj +++ b/src/NuGet.Protocol.Catalog/NuGet.Protocol.Catalog.csproj @@ -1,9 +1,10 @@ - + net472;netstandard2.0 + $(JobsPackageVersion) A .NET library for consuming the NuGet API's catalog resource. diff --git a/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj b/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj index cfb9eea710..28b8fc13ee 100644 --- a/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj +++ b/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj @@ -1,9 +1,10 @@ - + net472;netstandard2.1 + $(JobsPackageVersion) Push NuGetGallery DB packages or catalog leaves to Azure Search. nuget azure search catalog leaf details incremental collector diff --git a/src/NuGet.Services.Build/NuGet.Services.Build.csproj b/src/NuGet.Services.Build/NuGet.Services.Build.csproj index 51860c5001..90b20abbdb 100644 --- a/src/NuGet.Services.Build/NuGet.Services.Build.csproj +++ b/src/NuGet.Services.Build/NuGet.Services.Build.csproj @@ -4,6 +4,7 @@ net472 + $(CommonPackageVersion) Shared component to assist NuGet build scripts.