From e36fb95c50ce0cd0ab9621afe668332895712c2e Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Mon, 2 Oct 2017 23:24:00 +0200 Subject: Added mono module --- .../mono/editor/GodotSharpTools/Project/ProjectUtils.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs (limited to 'modules/mono/editor/GodotSharpTools/Project/ProjectUtils.cs') 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(); + } + } +} -- cgit v1.2.3