diff --git a/.ci-config.json b/.ci-config.json index 023497961dd7..2e992e823072 100644 --- a/.ci-config.json +++ b/.ci-config.json @@ -225,7 +225,6 @@ "tools/CheckIgnoredFile.ps1", "tools/CleanupBuild.ps1", "tools/CommonIncrementVersion.ps1", - "tools/CreateAliasMapping.ps1", "tools/CreateMappings_rules.json", "tools/CreateMappings.ps1", "tools/CreateRegistryEntry.ps1" diff --git a/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/CIFilterTask.cs b/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/CIFilterTask.cs index 7295fd37f19a..60a5b0b5d98f 100644 --- a/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/CIFilterTask.cs +++ b/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/CIFilterTask.cs @@ -414,7 +414,11 @@ public override bool Execute() var csprojMap = ReadMapFile(CsprojMapFilePath, "CsprojMapFilePath"); Console.WriteLine(string.Format("FilesChanged: {0}", FilesChanged.Length)); - if (FilesChanged != null) + if (!string.IsNullOrWhiteSpace(TargetModule)) + { + return ProcessTargetModule(csprojMap); + } + else if (FilesChanged != null) { if (FilesChanged.Length > 0) { @@ -435,10 +439,6 @@ public override bool Execute() return true; } } - else if (!string.IsNullOrWhiteSpace(TargetModule)) - { - return ProcessTargetModule(csprojMap); - } return true; } } diff --git a/tools/CreateFilterMappings.ps1 b/tools/CreateFilterMappings.ps1 index 925772d1b0ec..055ca25a7ca1 100644 --- a/tools/CreateFilterMappings.ps1 +++ b/tools/CreateFilterMappings.ps1 @@ -251,6 +251,17 @@ function Create-CsprojMappings <# Maps a normalized path to the projects to be built based on the service folder provided. #> + +function Get-ModuleFromPath +{ + param + ( + [Parameter(Mandatory = $true)] + [string]$FilePath + ) + + return $FilePath.Replace('/', '\').Split('\src\')[1].Split('\')[0] +} function Add-CsprojMappings { param @@ -267,14 +278,12 @@ function Add-CsprojMappings $Values = New-Object System.Collections.Generic.HashSet[string] foreach ($CsprojFile in $CsprojFiles) { - $Fields = $CsprojFile.FullName.Replace('/', '\').Split('\') - $Project = $Fields[$Fields.Length - 3] + $Project = Get-ModuleFromPath $CsprojFile.FullName foreach ($ProjectName in $Script:ProjectToSolutionMappings.Keys) { foreach ($Solution in $Script:ProjectToSolutionMappings[$ProjectName]) { - $Fields = $Solution.Replace('/', '\').Split('\') - $ProjectNameFromSolution = $Fields[$Fields.Length - 2] + $ProjectNameFromSolution = Get-ModuleFromPath $Solution if ($ProjectNameFromSolution -eq $Project) { foreach ($ReferencedProject in $Script:SolutionToProjectMappings[$Solution])