summaryrefslogtreecommitdiff
path: root/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs')
-rw-r--r--modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs b/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs
new file mode 100644
index 0000000000..a50b4fb064
--- /dev/null
+++ b/modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+using Microsoft.Build.Construction;
+
+namespace GodotSharpTools.Project
+{
+ public static class ProjectUtils
+ {
+ public static void AddItemToProjectChecked(string projectPath, string itemType, string include)
+ {
+ var dir = Directory.GetParent(projectPath).FullName;
+ var root = ProjectRootElement.Open(projectPath);
+ root.AddItemChecked(itemType, include.RelativeToPath(dir).Replace("/", "\\"));
+ root.Save();
+ }
+ }
+}