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 225
225
" tools/CheckIgnoredFile.ps1" ,
226
226
" tools/CleanupBuild.ps1" ,
227
227
" tools/CommonIncrementVersion.ps1" ,
228
- " tools/CreateAliasMapping.ps1" ,
229
228
" tools/CreateMappings_rules.json" ,
230
229
" tools/CreateMappings.ps1" ,
231
230
" tools/CreateRegistryEntry.ps1"
Original file line number Diff line number Diff line change @@ -414,7 +414,11 @@ public override bool Execute()
414
414
var csprojMap = ReadMapFile ( CsprojMapFilePath , "CsprojMapFilePath" ) ;
415
415
416
416
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 )
418
422
{
419
423
if ( FilesChanged . Length > 0 )
420
424
{
@@ -435,10 +439,6 @@ public override bool Execute()
435
439
return true ;
436
440
}
437
441
}
438
- else if ( ! string . IsNullOrWhiteSpace ( TargetModule ) )
439
- {
440
- return ProcessTargetModule ( csprojMap ) ;
441
- }
442
442
return true ;
443
443
}
444
444
}
Original file line number Diff line number Diff line change @@ -251,6 +251,17 @@ function Create-CsprojMappings
251
251
<#
252
252
Maps a normalized path to the projects to be built based on the service folder provided.
253
253
#>
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
+ }
254
265
function Add-CsprojMappings
255
266
{
256
267
param
@@ -267,14 +278,12 @@ function Add-CsprojMappings
267
278
$Values = New-Object System.Collections.Generic.HashSet[string ]
268
279
foreach ($CsprojFile in $CsprojFiles )
269
280
{
270
- $Fields = $CsprojFile.FullName.Replace (' /' , ' \' ).Split(' \' )
271
- $Project = $Fields [$Fields.Length - 3 ]
281
+ $Project = Get-ModuleFromPath $CsprojFile.FullName
272
282
foreach ($ProjectName in $Script :ProjectToSolutionMappings.Keys )
273
283
{
274
284
foreach ($Solution in $Script :ProjectToSolutionMappings [$ProjectName ])
275
285
{
276
- $Fields = $Solution.Replace (' /' , ' \' ).Split(' \' )
277
- $ProjectNameFromSolution = $Fields [$Fields.Length - 2 ]
286
+ $ProjectNameFromSolution = Get-ModuleFromPath $Solution
278
287
if ($ProjectNameFromSolution -eq $Project )
279
288
{
280
289
foreach ($ReferencedProject in $Script :SolutionToProjectMappings [$Solution ])
You can’t perform that action at this time.
0 commit comments