Skip to content

Commit ee4c47f

Browse files
committed
Remove "AllGeneratedProjectReferences.props" in favor of a wildcard import
1 parent 8f2696d commit ee4c47f

File tree

3 files changed

+3
-37
lines changed

3 files changed

+3
-37
lines changed

Labs.Head.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<IsAllExperimentHead Condition="$(MSBuildProjectName.StartsWith('CommunityToolkit.Labs.')) == 'true'">true</IsAllExperimentHead>
3030
<IsProjectTemplateHead Condition="$(MSBuildProjectName.StartsWith('ProjectTemplate')) == 'true'">true</IsProjectTemplateHead>
3131
<IsSingleExperimentHead Condition="'$(IsAllExperimentHead)' != 'true' AND '$(IsProjectTemplateHead)' != 'true'">true</IsSingleExperimentHead>
32+
33+
<DefineConstants Condition="$(IsAllExperimentHead) == 'true'">$(DefineConstants);LABS_ALL_SAMPLES</DefineConstants>
3234
</PropertyGroup>
3335

3436
<!-- See https://github.com/CommunityToolkit/Labs-Windows/issues/142 -->

MultiTarget/AllGeneratedProjectReferences.props.template

Lines changed: 0 additions & 13 deletions
This file was deleted.

MultiTarget/GenerateAllProjectReferences.ps1

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,10 @@ Param (
55
[Parameter(HelpMessage = "Filters projects that have paths which match the provided string.")]
66
[string]$Exclude = "*template*",
77

8-
[Parameter(HelpMessage = "The path to a props file that will be populated with project imports for all discovered projects.")]
9-
[string]$outputPath = "$projectPropsOutputDir/AllGeneratedProjectReferences.props",
10-
118
[Parameter(HelpMessage = "The directories to scan for projects. Supports wildcards.")]
12-
[string[]]$projectDirectories = @("$PSScriptRoot/../../*/*/samples/*.Samples/*.Samples.csproj", "$PSScriptRoot/../../*/*/src/*.csproj"),
13-
14-
[Parameter(HelpMessage = "The path to the template used to generate the props file.")]
15-
[string]$templatePath = "$PSScriptRoot/AllGeneratedProjectReferences.props.template",
16-
17-
[Parameter(HelpMessage = "The placeholder text to replace when inserting the project file name into the template.")]
18-
[string]$projectReferencesDefinitionMarker = "[ProjectReferenceImports]"
9+
[string[]]$projectDirectories = @("$PSScriptRoot/../../*/*/samples/*.Samples/*.Samples.csproj", "$PSScriptRoot/../../*/*/src/*.csproj")
1910
)
2011

21-
# Load template
22-
$templateContents = Get-Content -Path $templatePath;
23-
Write-Output "Loaded template from $(Resolve-Path $templatePath)";
24-
2512
# Create output folder if not exists
2613
New-Item -ItemType Directory -Force -Path $projectPropsOutputDir -ErrorAction SilentlyContinue | Out-Null;
2714

@@ -33,16 +20,6 @@ foreach ($path in $projectDirectories) {
3320
$projectName = [System.IO.Path]::GetFileNameWithoutExtension($relativePath);
3421

3522
& $PSScriptRoot\GenerateMultiTargetAwareProjectReferenceProps.ps1 $projectPath "$projectPropsOutputDir/$projectName.props";
36-
$projectReferenceDefinition = "<Import Project=`"`$(RepositoryDirectory)/common/MultiTarget/Generated/$projectName.props`" />";
37-
38-
$templateContents = $templateContents -replace [regex]::escape($projectReferencesDefinitionMarker), ($projectReferencesDefinitionMarker + "
39-
" + $projectReferenceDefinition);
4023
}
4124
}
4225

43-
# Remove placeholder from template
44-
$templateContents = $templateContents -replace [regex]::escape($projectReferencesDefinitionMarker), "";
45-
46-
# Save
47-
Set-Content -Path $outputPath -Value $templateContents;
48-
Write-Output "Project references generated at $(Resolve-Path $outputPath)";

0 commit comments

Comments
 (0)