Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 28 additions & 20 deletions GenerateAllSolution.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,14 @@ $projects = [System.Collections.ArrayList]::new()
# Common/Dependencies for shared infrastructure
[void]$projects.Add(".\tooling\CommunityToolkit*\*.*proj")

# Deployable sample gallery heads
# TODO: this handles separate project heads, but won't directly handle the unified Skia head from Uno.
# Once we have that, just do a transform on the csproj filename inside this loop to decide the same csproj for those separate MultiTargets.
foreach ($multitarget in $MultiTargets) {
# capitalize first letter, avoid case sensitivity issues on linux
$csprojFileNamePartForMultiTarget = $multitarget.substring(0,1).ToUpper() + $multitarget.Substring(1).ToLower()

$path = ".\tooling\ProjectHeads\AllComponents\**\*.$csprojFileNamePartForMultiTarget.csproj";

if (Test-Path $path) {
[void]$projects.Add($path)
}
else {
Write-Warning "No project head could be found at $path for MultiTarget $multitarget. Skipping."
}
}

# Individual projects
if ($Components -eq @('all')) {
$Components = @('**')
}


$allUsedMultiTargetPrefs = @()

foreach ($componentName in $Components) {
if ($ExcludeComponents -contains $componentName) {
continue;
Expand All @@ -141,11 +127,13 @@ foreach ($componentName in $Components) {
foreach ($componentPath in Get-Item "$PSScriptRoot/../components/$componentName/") {
$multiTargetPrefs = & $PSScriptRoot\MultiTarget\Get-MultiTargets.ps1 -component $($componentPath.BaseName)

$shouldReferenceInSolution = $multiTargetPrefs.Where({ $MultiTargets.Contains($_) }).Count -gt 0

$usedMultiTargetPrefs = $multiTargetPrefs.Where({ $MultiTargets.Contains($_) });
$shouldReferenceInSolution = $usedMultiTargetPrefs.Count -gt 0

if ($shouldReferenceInSolution) {
Write-Output "Add component $componentPath to solution";

$allUsedMultiTargetPrefs += $usedMultiTargetPrefs

[void]$projects.Add(".\components\$($componentPath.BaseName)\src\*.csproj")
[void]$projects.Add(".\components\$($componentPath.BaseName)\samples\*.Samples.csproj")
[void]$projects.Add(".\components\$($componentPath.BaseName)\tests\*.shproj")
Expand All @@ -155,6 +143,26 @@ foreach ($componentName in $Components) {
}
}

# Deployable sample gallery heads
# Only include heads for requested MultiTargets if components were included that use them.
# ===
# TODO: this handles separate project heads, but won't directly handle the unified Skia head from Uno.
# Once we have that, just do a transform on the csproj filename inside this loop to decide the same csproj for those separate MultiTargets.
# ===
foreach ($multitarget in $allUsedMultiTargetPrefs) {
# capitalize first letter, avoid case sensitivity issues on linux
$csprojFileNamePartForMultiTarget = $multitarget.substring(0,1).ToUpper() + $multitarget.Substring(1).ToLower()

$path = ".\tooling\ProjectHeads\AllComponents\**\*.$csprojFileNamePartForMultiTarget.csproj";

if (Test-Path $path) {
[void]$projects.Add($path)
}
else {
Write-Warning "No project head could be found at $path for MultiTarget $multitarget. Skipping."
}
}

if ($UseDiagnostics.IsPresent)
{
$sdkoptions = "-d"
Expand Down
Loading