summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
diff options
context:
space:
mode:
authorIgnacio Etcheverry <neikeq@users.noreply.github.com>2018-10-25 18:18:40 +0200
committerGitHub <noreply@github.com>2018-10-25 18:18:40 +0200
commitd47cec43f2f4ef2cd6d1a0acf6e99a9dd8d31eef (patch)
tree5dd8beb564a74a8fd52d98f4ca727077532bfad2 /modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
parentdbaa22329761ce7a4d8bab291871b5b5ba359cbe (diff)
parent1aac95a7375e58bacade69ed12f9dade484a03a8 (diff)
downloadredot-engine-d47cec43f2f4ef2cd6d1a0acf6e99a9dd8d31eef.tar.gz
Merge pull request #23162 from neikeq/cc
Proper support for namespaces and other enhancement/fixes
Diffstat (limited to 'modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs')
-rw-r--r--modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs b/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
index f00ec5a2ad..647d9ac81d 100644
--- a/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
+++ b/modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs
@@ -1,4 +1,5 @@
using System;
+using DotNet.Globbing;
using Microsoft.Build.Construction;
namespace GodotSharpTools.Project
@@ -7,7 +8,10 @@ namespace GodotSharpTools.Project
{
public static bool HasItem(this ProjectRootElement root, string itemType, string include)
{
- string includeNormalized = include.NormalizePath();
+ GlobOptions globOptions = new GlobOptions();
+ globOptions.Evaluation.CaseInsensitive = false;
+
+ string normalizedInclude = include.NormalizePath();
foreach (var itemGroup in root.ItemGroups)
{
@@ -16,10 +20,14 @@ namespace GodotSharpTools.Project
foreach (var item in itemGroup.Items)
{
- if (item.ItemType == itemType)
+ if (item.ItemType != itemType)
+ continue;
+
+ var glob = Glob.Parse(item.Include.NormalizePath(), globOptions);
+
+ if (glob.IsMatch(normalizedInclude))
{
- if (item.Include.NormalizePath() == includeNormalized)
- return true;
+ return true;
}
}
}