From 088712d4af263dd3dbbf90172a9d8c460d94b939 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 17 Jul 2024 12:28:51 -0500 Subject: [PATCH 1/2] Fixed an issue where Build-Toolkit-Gallery script wasn't working in Labs --- Build-Toolkit-Gallery.ps1 | 3 +-- MultiTarget/GenerateAllProjectReferences.ps1 | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Build-Toolkit-Gallery.ps1 b/Build-Toolkit-Gallery.ps1 index 72070fa0..381dfa63 100644 --- a/Build-Toolkit-Gallery.ps1 +++ b/Build-Toolkit-Gallery.ps1 @@ -94,8 +94,7 @@ if ($ExcludeComponents) { $Components = $Components | Where-Object { $_ -notin $ExcludeComponents } } -# Certain Components are required to build the gallery app. -# Add them if not already included. +# Certain ProjectReferences should always be generated (are required to build gallery) if csproj is available. if ($Components -notcontains 'SettingsControls') { $Components += 'SettingsControls' } diff --git a/MultiTarget/GenerateAllProjectReferences.ps1 b/MultiTarget/GenerateAllProjectReferences.ps1 index 821c8f1c..91da2215 100644 --- a/MultiTarget/GenerateAllProjectReferences.ps1 +++ b/MultiTarget/GenerateAllProjectReferences.ps1 @@ -28,8 +28,14 @@ foreach ($componentName in $Components) { continue; } + # Don't generate project reference if component isn't available + if (!(Test-Path "$PSScriptRoot/../../components/$componentName/")) { + continue; + } + # Find all components source csproj (when wildcard), or find specific component csproj by name. foreach ($componentPath in Get-Item "$PSScriptRoot/../../components/$componentName/") { + $componentName = $componentPath.BaseName; Write-Output "Generating project references for component $componentName at $componentPath"; # Find source and sample csproj files From 028fe9c50bd98d926bbed5d612668d753aa09b24 Mon Sep 17 00:00:00 2001 From: "Michael Hawker MSFT (XAML Llama)" <24302614+michael-hawker@users.noreply.github.com> Date: Wed, 21 Aug 2024 09:43:09 -0700 Subject: [PATCH 2/2] Build-Toolkit-Components.ps1 to not require PreviewVersion parameter (#207) * Build-Toolkit-Components.ps1 to not require PreviewVersion parameter This is blocking release where we don't have a PreviewVersion postfix to our build number. * Build-Toolkit-Components.ps1 ensure we don't add Postfix flag when not provided to msbuild * Revert "Build-Toolkit-Components.ps1 ensure we don't add Postfix flag when not provided to msbuild" This reverts commit ba0e00a668ccf2fb966df8912664b29ea1cd6027. --- Build-Toolkit-Components.ps1 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Build-Toolkit-Components.ps1 b/Build-Toolkit-Components.ps1 index d797d5df..5b3bd3cc 100644 --- a/Build-Toolkit-Components.ps1 +++ b/Build-Toolkit-Components.ps1 @@ -15,7 +15,7 @@ Specifies the date for versioning in 'YYMMDD' format. The default value is the current date. .PARAMETER PreviewVersion - Specifies the preview version to use if packaging is enabled. Appended with a dash after the version number (formatted Version-PreviewVersion). This parameter is required when NupkgOutput is supplied. + Specifies the preview version to use if packaging is enabled. Appended with a dash after the version number (formatted Version-PreviewVersion). This parameter is optional. .PARAMETER NupkgOutput Specifies the output directory for .nupkg files. This parameter is optional. When supplied, the components will also be packed and nupkg files will be output to the specified directory. @@ -114,11 +114,6 @@ if ($ExcludeComponents) { $Components = $Components | Where-Object { $_ -notin $ExcludeComponents } } -# Check if NupkgOutput is supplied without PreviewVersion -if ($NupkgOutput -and -not $PreviewVersion) { - throw "PreviewVersion is required when NupkgOutput is supplied." -} - # Use the specified MultiTarget TFM and WinUI version & $PSScriptRoot\MultiTarget\UseTargetFrameworks.ps1 $MultiTargets & $PSScriptRoot\MultiTarget\UseUnoWinUI.ps1 $WinUIMajorVersion