Merge pull request #41800 from alexdlm/fix-csproj-read-3.2

[3.2] Handle csproj "Remove" globs
This commit is contained in:
Rémi Verschelde 2020-09-06 08:42:51 +02:00 committed by GitHub
commit 13e2e487a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -23,6 +23,9 @@ namespace GodotTools.Core
public static string NormalizePath(this string path)
{
if (string.IsNullOrEmpty(path))
return path;
bool rooted = path.IsAbsolutePath();
path = path.Replace('\\', '/');

View file

@ -188,9 +188,10 @@ namespace GodotTools.ProjectEditor
if (item.ItemType != itemType)
continue;
string normalizedExclude = item.Exclude.NormalizePath();
var glob = MSBuildGlob.Parse(normalizedExclude);
string normalizedRemove= item.Remove.NormalizePath();
var glob = MSBuildGlob.Parse(normalizedRemove);
excluded.AddRange(result.Where(includedFile => glob.IsMatch(includedFile)));
}