diff --git a/Build-Toolkit-Gallery.ps1 b/Build-Toolkit-Gallery.ps1 index b08abe47..a6f96cb6 100644 --- a/Build-Toolkit-Gallery.ps1 +++ b/Build-Toolkit-Gallery.ps1 @@ -99,8 +99,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 1cca529e..8ccf4732 100644 --- a/MultiTarget/GenerateAllProjectReferences.ps1 +++ b/MultiTarget/GenerateAllProjectReferences.ps1 @@ -30,8 +30,16 @@ 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 $componentSourceCsproj = Get-ChildItem $componentPath/src/*.csproj -ErrorAction SilentlyContinue; $componentSampleCsproj = Get-ChildItem $componentPath/samples/*.csproj -ErrorAction SilentlyContinue;