diff options
| author | Ignacio Etcheverry <neikeq@users.noreply.github.com> | 2018-10-25 18:18:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-25 18:18:40 +0200 |
| commit | d47cec43f2f4ef2cd6d1a0acf6e99a9dd8d31eef (patch) | |
| tree | 5dd8beb564a74a8fd52d98f4ca727077532bfad2 /modules/mono/editor/GodotSharpTools/Project/ProjectExtensions.cs | |
| parent | dbaa22329761ce7a4d8bab291871b5b5ba359cbe (diff) | |
| parent | 1aac95a7375e58bacade69ed12f9dade484a03a8 (diff) | |
| download | redot-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.cs | 16 |
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; } } } |
