Skip to content

Commit

Permalink
Add warning messages when package precheck fails (#16867)
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHigin committed Feb 10, 2022
1 parent a9a235d commit add08d3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tools/packaging/packaging.psm1
Expand Up @@ -159,6 +159,23 @@ function Start-PSPackage {
# also ensure `Start-PSPackage` does what the user asks/expects, because once packages
# are generated, it'll be hard to verify if they were built from the correct content.

Write-Warning -Message "Start-PSPackage: The build PreCheck has failed."
if (-not $Script:Options) {
Write-Warning -Message "Start-PSPackage: builid options variable is null indicating Start-PSBuild hasn't been run yet."
}
if (-not $PSModuleRestoreCorrect) {
Write-Warning -Message "Start-PSPackage: PSModuleRestoreCorrect variable is null indicating build -PSModuleRestore was not performed."
}
if ($Script:Options.Configuration -ne $Configuration) {
Write-Warning -Message "Start-PSPackage: Build configuration is incorrect: Expected: $Configuration Actual: $($Script:Options.Configuration)"
}
if ($Script:Options.Framework -ne $script:netCoreRuntime) {
Write-Warning -Message "Start-PSPackage: Build .NET version is incorrect: Expected: $($script:netCoreRuntime) Actual: $($Script:Options.Framework)"
}
if (($Type -notlike 'fxdependent*' -and $Type -ne 'tar-alpine') -and ($Script:Options.Runtime -ne $Runtime)) {
Write-Warning -Message "Start-PSPackage: Build RID does not match expected RID: Expected: $Runtime Actual: $($Script:Options.Runtime)"
}

$params = @('-Clean')

if (!$IncludeSymbols.IsPresent) {
Expand Down

0 comments on commit add08d3

Please sign in to comment.