You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
3.2 C#: Upgrade GodotTools to nuget Microsoft.Build
This upgrade is needed in order to support reading and editing project files that use Sdks as well as other new features. A common example in 3.2 is having to specify a PackageReference version with a child element rather than the attribute. This is no longer the case now. Partial cherry-pick off3bcd5f8ddMost of the other changes from that commit were already partially cherry-picked in3928fe200f.
This commit is contained in:
@@ -2,8 +2,8 @@ using GodotTools.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using DotNet.Globbing;
|
||||
using Microsoft.Build.Construction;
|
||||
using Microsoft.Build.Globbing;
|
||||
|
||||
namespace GodotTools.ProjectEditor
|
||||
{
|
||||
@@ -11,8 +11,6 @@ namespace GodotTools.ProjectEditor
|
||||
{
|
||||
public static ProjectItemElement FindItemOrNull(this ProjectRootElement root, string itemType, string include, bool noCondition = false)
|
||||
{
|
||||
GlobOptions globOptions = new GlobOptions {Evaluation = {CaseInsensitive = false}};
|
||||
|
||||
string normalizedInclude = include.NormalizePath();
|
||||
|
||||
foreach (var itemGroup in root.ItemGroups)
|
||||
@@ -25,7 +23,7 @@ namespace GodotTools.ProjectEditor
|
||||
if (item.ItemType != itemType)
|
||||
continue;
|
||||
|
||||
var glob = Glob.Parse(item.Include.NormalizePath(), globOptions);
|
||||
var glob = MSBuildGlob.Parse(item.Include.NormalizePath());
|
||||
|
||||
if (glob.IsMatch(normalizedInclude))
|
||||
return item;
|
||||
@@ -36,8 +34,6 @@ namespace GodotTools.ProjectEditor
|
||||
}
|
||||
public static ProjectItemElement FindItemOrNullAbs(this ProjectRootElement root, string itemType, string include, bool noCondition = false)
|
||||
{
|
||||
GlobOptions globOptions = new GlobOptions {Evaluation = {CaseInsensitive = false}};
|
||||
|
||||
string normalizedInclude = Path.GetFullPath(include).NormalizePath();
|
||||
|
||||
foreach (var itemGroup in root.ItemGroups)
|
||||
@@ -50,7 +46,7 @@ namespace GodotTools.ProjectEditor
|
||||
if (item.ItemType != itemType)
|
||||
continue;
|
||||
|
||||
var glob = Glob.Parse(Path.GetFullPath(item.Include).NormalizePath(), globOptions);
|
||||
var glob = MSBuildGlob.Parse(Path.GetFullPath(item.Include).NormalizePath());
|
||||
|
||||
if (glob.IsMatch(normalizedInclude))
|
||||
return item;
|
||||
|
||||
Reference in New Issue
Block a user