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

Normalize RAR output paths #6533

Merged
merged 5 commits into from
Jul 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Tasks/AssemblyDependency/Reference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ internal string FullPath
}
}

internal void NormalizeFullPath()
{
_fullPath = FileUtilities.NormalizePath(_fullPath);
_fullPathWithoutExtension = null;
_directoryName = null;
}

/// <summary>
/// The directory that this assembly lives in.
/// </summary>
Expand Down
12 changes: 11 additions & 1 deletion src/Tasks/AssemblyDependency/ReferenceTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,12 @@ internal void AddReference(AssemblyNameExtension assemblyName, Reference referen
}
}

if (reference.FullPath.Length > 0 && ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_0))
{
// Saves effort and makes deduplication possible downstream
reference.NormalizeFullPath();
}

References[assemblyName] = reference;
}

Expand Down Expand Up @@ -1337,7 +1343,11 @@ out userRequestedSpecificFile
// If the path was resolved, then specify the full path on the reference.
if (resolvedPath != null)
{
if (!Path.IsPathRooted(resolvedPath))
if (ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_0))
{
resolvedPath = FileUtilities.NormalizePath(resolvedPath);
}
else if (!Path.IsPathRooted(resolvedPath))
{
resolvedPath = Path.GetFullPath(resolvedPath);
}
Expand Down