@@ -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
2613New-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