Skip to content

Commit 8aff65d

Browse files
committed
Throw exception if a solution reference a not exist csproj.
1 parent b065779 commit 8aff65d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/CreateFilterMappings.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,17 @@ function Add-ProjectDependencies
152152
[string]$SolutionPath
153153
)
154154

155+
$CommonProjectsToIgnore = @("ScenarioTest.ResourceManager", "TestFx", "Tests" )
155156
$CsprojList = @()
156157
$Content = Get-Content -Path $SolutionPath
157158
$SolutionFoloderPath = Split-Path -Parent $SolutionPath
158-
$Content | Select-String -Pattern "`"[a-zA-Z0-9`.`\\`/]*.csproj`"" | ForEach-Object { $_.Matches[0].Value.Trim('"') } | ForEach-Object { $CsprojList += $_ }
159+
$Content | Select-String -Pattern "`"[a-zA-Z0-9`.`\\`/]*.csproj`"" | ForEach-Object { $_.Matches[0].Value.Trim('"') } | Where-Object { $CommonProjectsToIgnore -notcontains $_ } | ForEach-Object { $CsprojList += $_ }
159160

160161
foreach ($Csproj in $CsprojList)
161162
{
162163
try
163164
{
164165
$CsprojAbslutionPath = Resolve-Path -Path ($SolutionFoloderPath + "\\" + $Csproj)
165-
Write-Host $CsprojAbslutionPath
166166
}
167167
catch
168168
{
@@ -300,13 +300,15 @@ function Add-CsprojMappings
300300
foreach ($Solution in $Script:ProjectToSolutionMappings[$ProjectName])
301301
{
302302
$ProjectNameFromSolution = Get-ModuleFromPath $Solution
303+
Write-Host $ProjectNameFromSolution $Project -ForegroundColor Green
303304
if ($ProjectNameFromSolution -eq $Project)
304305
{
305306
foreach ($ReferencedProject in $Script:SolutionToProjectMappings[$Solution])
306307
{
307308
$TempValue = $Script:ProjectToFullPathMappings[$ReferencedProject]
308309
if (-not [string]::IsNullOrEmpty($TempValue))
309310
{
311+
Write-Host $TempValue $ReferencedProject -ForegroundColor Yellow
310312
$Values.Add($TempValue) | Out-Null
311313
}
312314
}

0 commit comments

Comments
 (0)