@@ -96,6 +96,10 @@ function Create-ProjectToFullPathMappings
96
96
$CsprojFiles = Get-ChildItem - Path $ServiceFolder - Filter " *.csproj" - Recurse
97
97
foreach ($CsprojFile in $CsprojFiles )
98
98
{
99
+ if ($Mappings.Contains ($CsprojFile.BaseName ))
100
+ {
101
+ throw ($CsprojFile.FullName + " is conflicts with " + $Mappings [$CsprojFile.BaseName ])
102
+ }
99
103
$Mappings [$CsprojFile.BaseName ] = $CsprojFile.FullName
100
104
}
101
105
}
@@ -149,10 +153,24 @@ function Add-ProjectDependencies
149
153
)
150
154
151
155
$CommonProjectsToIgnore = @ (" ScenarioTest.ResourceManager" , " TestFx" , " Tests" )
152
- $ProjectDependencies = @ ()
156
+ $CsprojList = @ ()
153
157
$Content = Get-Content - Path $SolutionPath
154
- $Content | Select-String - Pattern " [`\`/]*[a-zA-Z0-9.]*.csproj" | ForEach-Object { $_.Matches [0 ].Value.Replace(" .csproj" , " " ) } | Where-Object { $CommonProjectsToIgnore -notcontains $_ } | ForEach-Object { $ProjectDependencies += $_ }
155
- $Mappings [$SolutionPath ] = $ProjectDependencies
158
+ $SolutionFoloderPath = Split-Path - Parent $SolutionPath
159
+ $Content | Select-String - Pattern " `" [a-zA-Z0-9`.`\\`/]*.csproj`" " | ForEach-Object { $_.Matches [0 ].Value.Trim(' "' ) } | Where-Object { $CommonProjectsToIgnore -notcontains $_ } | ForEach-Object { $CsprojList += $_ }
160
+
161
+ foreach ($Csproj in $CsprojList )
162
+ {
163
+ try
164
+ {
165
+ $CsprojAbslutionPath = Resolve-Path - Path ($SolutionFoloderPath + " \" + $Csproj )
166
+ Write-Host $CsprojAbslutionPath
167
+ }
168
+ catch
169
+ {
170
+ throw " ${SolutionPath} : $Csproj is not found!"
171
+ }
172
+ }
173
+ $Mappings [$SolutionPath ] = $CsprojList | ForEach-Object { (Split-Path - Path $_ - Leaf).Trim(' .csproj' ) }
156
174
return $Mappings
157
175
}
158
176
@@ -292,10 +310,6 @@ function Add-CsprojMappings
292
310
{
293
311
$Values.Add ($TempValue ) | Out-Null
294
312
}
295
- else
296
- {
297
- Throw " ${ProjectNameFromSolution} : $ReferencedProject .csproj is not found!"
298
- }
299
313
}
300
314
}
301
315
}
0 commit comments