File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
BuildPackagesTask/Microsoft.Azure.Build.Tasks Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 225225 " tools/CheckIgnoredFile.ps1" ,
226226 " tools/CleanupBuild.ps1" ,
227227 " tools/CommonIncrementVersion.ps1" ,
228- " tools/CreateAliasMapping.ps1" ,
229228 " tools/CreateMappings_rules.json" ,
230229 " tools/CreateMappings.ps1" ,
231230 " tools/CreateRegistryEntry.ps1"
Original file line number Diff line number Diff line change @@ -414,7 +414,11 @@ public override bool Execute()
414414 var csprojMap = ReadMapFile ( CsprojMapFilePath , "CsprojMapFilePath" ) ;
415415
416416 Console . WriteLine ( string . Format ( "FilesChanged: {0}" , FilesChanged . Length ) ) ;
417- if ( FilesChanged != null )
417+ if ( ! string . IsNullOrWhiteSpace ( TargetModule ) )
418+ {
419+ return ProcessTargetModule ( csprojMap ) ;
420+ }
421+ else if ( FilesChanged != null )
418422 {
419423 if ( FilesChanged . Length > 0 )
420424 {
@@ -435,10 +439,6 @@ public override bool Execute()
435439 return true ;
436440 }
437441 }
438- else if ( ! string . IsNullOrWhiteSpace ( TargetModule ) )
439- {
440- return ProcessTargetModule ( csprojMap ) ;
441- }
442442 return true ;
443443 }
444444 }
Original file line number Diff line number Diff line change @@ -251,6 +251,17 @@ function Create-CsprojMappings
251251<#
252252Maps a normalized path to the projects to be built based on the service folder provided.
253253#>
254+
255+ function Get-ModuleFromPath
256+ {
257+ param
258+ (
259+ [Parameter (Mandatory = $true )]
260+ [string ]$FilePath
261+ )
262+
263+ return $FilePath.Replace (' /' , ' \' ).Split(' \src\' )[1 ].Split(' \' )[0 ]
264+ }
254265function Add-CsprojMappings
255266{
256267 param
@@ -267,14 +278,12 @@ function Add-CsprojMappings
267278 $Values = New-Object System.Collections.Generic.HashSet[string ]
268279 foreach ($CsprojFile in $CsprojFiles )
269280 {
270- $Fields = $CsprojFile.FullName.Replace (' /' , ' \' ).Split(' \' )
271- $Project = $Fields [$Fields.Length - 3 ]
281+ $Project = Get-ModuleFromPath $CsprojFile.FullName
272282 foreach ($ProjectName in $Script :ProjectToSolutionMappings.Keys )
273283 {
274284 foreach ($Solution in $Script :ProjectToSolutionMappings [$ProjectName ])
275285 {
276- $Fields = $Solution.Replace (' /' , ' \' ).Split(' \' )
277- $ProjectNameFromSolution = $Fields [$Fields.Length - 2 ]
286+ $ProjectNameFromSolution = Get-ModuleFromPath $Solution
278287 if ($ProjectNameFromSolution -eq $Project )
279288 {
280289 foreach ($ReferencedProject in $Script :SolutionToProjectMappings [$Solution ])
You can’t perform that action at this time.
0 commit comments