From aa1634708fed14b8d44758461db6c661ccf9ac95 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 15 Oct 2021 10:35:33 -0700 Subject: [PATCH 1/3] Ensure psoptions.json and manifest.spdx.json files always exist in packages --- .vscode/settings.json | 6 +++++- tools/packaging/packaging.psm1 | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index bc8c2b8e617..9ae2443a3e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,7 +13,11 @@ "MD033": false, "MD034": false, "MD038": false, - "MD042": false + "MD042": false, + "MD028": false, + "MD025": { + "front_matter_title": "" + } }, "[powershell]": { diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 5965dad1eb8..22ec338fbb4 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -210,6 +210,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 SBOM 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 SBOM 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 if ($IncludeSymbols.IsPresent) { From 9eb289d9595cda064b1a8f61dde9f26891763db4 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 15 Oct 2021 10:51:21 -0700 Subject: [PATCH 2/3] Remove unnecessary changes --- .vscode/settings.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9ae2443a3e6..bc8c2b8e617 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,11 +13,7 @@ "MD033": false, "MD034": false, "MD038": false, - "MD042": false, - "MD028": false, - "MD025": { - "front_matter_title": "" - } + "MD042": false }, "[powershell]": { From e77137d70a254977e356c27a4d474905958435bb Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 15 Oct 2021 10:55:03 -0700 Subject: [PATCH 3/3] Address code review comments --- tools/packaging/packaging.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 22ec338fbb4..8228632d99b 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -210,14 +210,14 @@ 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 SBOM is generated + # 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 SBOM is generated + # 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