Skip to content

Commit

Permalink
Bugfix SharedOutputPath analyzer (#10236)
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKrivanek committed Jun 13, 2024
1 parent 63f447b commit b36ff85
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Build/BuildCheck/Analyzers/SharedOutputPathAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ private void EvaluatedPropertiesAction(BuildCheckDataContext<EvaluatedProperties
context.Data.EvaluatedProperties.TryGetValue("IntermediateOutputPath", out objPath);

string? absoluteBinPath = CheckAndAddFullOutputPath(binPath, context);
// Check objPath only if it is different from binPath
if (
!string.IsNullOrEmpty(objPath) && !string.IsNullOrEmpty(absoluteBinPath) &&
!objPath.Equals(binPath, StringComparison.CurrentCultureIgnoreCase)
Expand All @@ -73,6 +74,9 @@ private void EvaluatedPropertiesAction(BuildCheckDataContext<EvaluatedProperties
path = Path.Combine(Path.GetDirectoryName(projectPath)!, path);
}

// Normalize the path to avoid false negatives due to different path representations.
path = Path.GetFullPath(path);

if (_projectsPerOutputPath.TryGetValue(path!, out string? conflictingProject))
{
context.ReportResult(BuildCheckResult.Create(
Expand Down

0 comments on commit b36ff85

Please sign in to comment.