From 061a6440195ae60a1f5ab5aea1a500cf49d224aa Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 15 Oct 2021 16:42:23 -0700 Subject: [PATCH] Add condition to generate release files in local dev build only (#16259) --- tools/packaging/packaging.psm1 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e20fb0d014..6ca0ef2fa3 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -225,18 +225,20 @@ function Start-PSPackage { # Copy the default.help.txt so it's part of the package Copy-Item "$RepoRoot/assets/default.help.txt" -Destination "$Source/en-US" -Force - # Make sure psoptions.json file exists so appropriate files.wsx is generated - $psOptionsPath = (Join-Path -Path $Source "psoptions.json") - if (-not (Test-Path -Path $psOptionsPath)) { - $createdOptionsFile = New-Item -Path $psOptionsPath -Force - Write-Verbose -Verbose "Created psoptions file: $createdOptionsFile" - } + if (-not $SkipGenerateReleaseFiles -and -not $env:TF_BUILD) { + # Make sure psoptions.json file exists so appropriate files.wsx is generated + $psOptionsPath = (Join-Path -Path $Source "psoptions.json") + if (-not (Test-Path -Path $psOptionsPath)) { + $createdOptionsFile = New-Item -Path $psOptionsPath -Force + Write-Verbose -Verbose "Created psoptions file: $createdOptionsFile" + } - # Make sure _manifest\spdx_2.2\manifest.spdx.json file exists so appropriate files.wxs is generated - $manifestSpdxPath = (Join-Path -Path $Source "_manifest\spdx_2.2\manifest.spdx.json") - if (-not (Test-Path -Path $manifestSpdxPath)) { - $createdSpdxPath = New-Item -Path $manifestSpdxPath -Force - Write-Verbose -Verbose "Created manifest.spdx.json file: $createdSpdxPath" + # Make sure _manifest\spdx_2.2\manifest.spdx.json file exists so appropriate files.wxs is generated + $manifestSpdxPath = (Join-Path -Path $Source "_manifest\spdx_2.2\manifest.spdx.json") + if (-not (Test-Path -Path $manifestSpdxPath)) { + $createdSpdxPath = New-Item -Path $manifestSpdxPath -Force + Write-Verbose -Verbose "Created manifest.spdx.json file: $createdSpdxPath" + } } # If building a symbols package, we add a zip of the parent to publish