Skip to content

Commit 7d5d479

Browse files
authored
Merge pull request #199 from CommunityToolkit/fix/build-scripts/gallery/labs
Fixed Build-Toolkit-Gallery script not working in Labs
2 parents acc45f7 + d834485 commit 7d5d479

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Build-Toolkit-Gallery.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ if ($ExcludeComponents) {
9999
$Components = $Components | Where-Object { $_ -notin $ExcludeComponents }
100100
}
101101

102-
# Certain Components are required to build the gallery app.
103-
# Add them if not already included.
102+
# Certain ProjectReferences should always be generated (are required to build gallery) if csproj is available.
104103
if ($Components -notcontains 'SettingsControls') {
105104
$Components += 'SettingsControls'
106105
}

MultiTarget/GenerateAllProjectReferences.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ foreach ($componentName in $Components) {
3030
continue;
3131
}
3232

33+
# Don't generate project reference if component isn't available
34+
if (!(Test-Path "$PSScriptRoot/../../components/$componentName/")) {
35+
continue;
36+
}
37+
3338
# Find all components source csproj (when wildcard), or find specific component csproj by name.
3439
foreach ($componentPath in Get-Item "$PSScriptRoot/../../components/$componentName/") {
40+
$componentName = $componentPath.BaseName;
41+
Write-Output "Generating project references for component $componentName at $componentPath";
42+
3543
# Find source and sample csproj files
3644
$componentSourceCsproj = Get-ChildItem $componentPath/src/*.csproj -ErrorAction SilentlyContinue;
3745
$componentSampleCsproj = Get-ChildItem $componentPath/samples/*.csproj -ErrorAction SilentlyContinue;

0 commit comments

Comments
 (0)