Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tools] Fix the issue of CI Pipeline #14222

Merged
merged 2 commits into from
Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ci-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -435,10 +439,6 @@ public override bool Execute()
return true;
}
}
else if (!string.IsNullOrWhiteSpace(TargetModule))
{
return ProcessTargetModule(csprojMap);
}
return true;
}
}
Expand Down
17 changes: 13 additions & 4 deletions tools/CreateFilterMappings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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])
Expand Down