@@ -63,6 +63,7 @@ param (
6363 [switch ]$sourceBuild ,
6464 [switch ]$skipBuild ,
6565 [switch ]$compressAllMetadata ,
66+ [switch ]$verifypackageshipstatus = $false ,
6667 [parameter (ValueFromRemainingArguments = $true )][string []]$properties )
6768
6869Set-StrictMode - version 2.0
@@ -117,6 +118,7 @@ function Print-Usage() {
117118 Write-Host " -sourceBuild Simulate building for source-build."
118119 Write-Host " -skipbuild Skip building product"
119120 Write-Host " -compressAllMetadata Build product with compressed metadata"
121+ Write-Host " -verifypackageshipstatus Verify whether the packages we are building have already shipped to nuget"
120122 Write-Host " "
121123 Write-Host " Command line arguments starting with '/p:' are passed through to MSBuild."
122124}
@@ -149,6 +151,7 @@ function Process-Arguments() {
149151 $script :testFSharpQA = $False
150152 $script :testVs = $False
151153 $script :testpack = $False
154+ $script :verifypackageshipstatus = $True
152155 }
153156
154157 if ($noRestore ) {
@@ -175,6 +178,10 @@ function Process-Arguments() {
175178 $script :compressAllMetadata = $True ;
176179 }
177180
181+ if ($verifypackageshipstatus ) {
182+ $script :verifypackageshipstatus = $True ;
183+ }
184+
178185 foreach ($property in $properties ) {
179186 if (! $property.StartsWith (" /p:" , " InvariantCultureIgnoreCase" )) {
180187 Write-Host " Invalid argument: $property "
@@ -605,6 +612,39 @@ try {
605612 throw " Error Verifying nupkgs have access to the source code"
606613 }
607614
615+ $verifypackageshipstatusFailed = $false
616+ if ($verifypackageshipstatus ) {
617+ $dotnetPath = InitializeDotNetCli
618+ $dotnetExe = Join-Path $dotnetPath " dotnet.exe"
619+
620+ Write-Host " ================================================================================================================================"
621+ Write-Host " The error messages below are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published "
622+ Write-Host " ================================================================================================================================"
623+ $exitCode = Exec- Process " $dotnetExe " " restore $RepoRoot \buildtools\checkpackages\FSharp.Compiler.Service_notshipped.fsproj"
624+ if ($exitCode -eq 0 ) {
625+ Write-Host - ForegroundColor Red " Command succeeded but was expected to fail: this means that the fsharp.compiler.service nuget package is already published"
626+ Write-Host - ForegroundColor Red " Modify the version number of FSharp.Compiler.Servoce to be published"
627+ $verifypackageshipstatusFailed = $True
628+ }
629+
630+ $exitCode = Exec- Process " $dotnetExe " " restore $RepoRoot \buildtools\checkpackages\FSharp.Core_notshipped.fsproj"
631+ if ($exitCode -eq 0 ) {
632+ Write-Host - ForegroundColor Red " Command succeeded but was expected to fail: this means that the fsharp.core nuget package is already published"
633+ Write-Host - ForegroundColor Red " Modify the version number of FSharp.Compiler.Servoce to be published"
634+ $verifypackageshipstatusFailed = $True
635+ }
636+ if (-not $verifypackageshipstatusFailed )
637+ {
638+ Write-Host " ================================================================================================================================"
639+ Write-Host " The error messages above are expected = They mean that FSharp.Core and FSharp.Compiler.Service are not yet published "
640+ Write-Host " ================================================================================================================================"
641+ }
642+ else
643+ {
644+ throw " Error Verifying shipping status of shipping nupkgs"
645+ }
646+ }
647+
608648 ExitWithExitCode 0
609649}
610650catch {
0 commit comments