1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

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
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) public static string NormalizePath(this string path)
{ {
if (string.IsNullOrEmpty(path))
return path;
bool rooted = path.IsAbsolutePath(); bool rooted = path.IsAbsolutePath();
path = path.Replace('\\', '/'); path = path.Replace('\\', '/');

View File

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