2017-10-02 23:24:00 +02:00
|
|
|
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);
|
2017-10-05 00:10:51 +02:00
|
|
|
if (root.AddItemChecked(itemType, include.RelativeToPath(dir).Replace("/", "\\")))
|
|
|
|
root.Save();
|
2017-10-02 23:24:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|