Merge pull request #41790 from alexdlm/fix-csproj-read

Handle csproj "Remove" globs
This commit is contained in:
Rémi Verschelde 2020-09-06 08:42:08 +02:00 committed by GitHub
commit da588226a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 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

@ -61,10 +61,9 @@ 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(includedFiles.Where(includedFile => glob.IsMatch(includedFile)));
}