summaryrefslogtreecommitdiff
path: root/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2020-06-15 21:29:16 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2020-06-15 21:29:16 +0200
commit54df72dcc6b60693234880e7b1e4dde3a8f082f5 (patch)
tree008ad3b3a1293ef42c3000cb572a1577c65e3366 /modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs
parent17af0104785eac9c416bb89989d82e2968f8ab8f (diff)
C#: Add VisualStudio support
Diffstat (limited to 'modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs')
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs
index 069a1edaa3..8774b4ee31 100644
--- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs
+++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs
@@ -165,6 +165,21 @@ namespace GodotTools.ProjectEditor
return result.ToArray();
}
+ public static void EnsureHasProjectTypeGuids(MSBuildProject project)
+ {
+ var root = project.Root;
+
+ bool found = root.PropertyGroups.Any(pg =>
+ string.IsNullOrEmpty(pg.Condition) && pg.Properties.Any(p => p.Name == "ProjectTypeGuids"));
+
+ if (found)
+ return;
+
+ root.AddProperty("ProjectTypeGuids", ProjectGenerator.GodotDefaultProjectTypeGuids);
+
+ project.HasUnsavedChanges = true;
+ }
+
/// Simple function to make sure the Api assembly references are configured correctly
public static void FixApiHintPath(MSBuildProject project)
{