|
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.IO;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
using GodotTools.Build;
|
|
using GodotTools.Build;
|
|
|
|
+using GodotTools.Ides.Rider;
|
|
using GodotTools.Internals;
|
|
using GodotTools.Internals;
|
|
using GodotTools.Utils;
|
|
using GodotTools.Utils;
|
|
using static GodotTools.Internals.Globals;
|
|
using static GodotTools.Internals.Globals;
|
|
@@ -16,6 +17,7 @@ namespace GodotTools
|
|
|
|
|
|
public const string PropNameMsbuildMono = "MSBuild (Mono)";
|
|
public const string PropNameMsbuildMono = "MSBuild (Mono)";
|
|
public const string PropNameMsbuildVs = "MSBuild (VS Build Tools)";
|
|
public const string PropNameMsbuildVs = "MSBuild (VS Build Tools)";
|
|
|
|
+ public const string PropNameMsbuildJetBrains = "MSBuild (JetBrains Rider)";
|
|
|
|
|
|
public const string MsBuildIssuesFileName = "msbuild_issues.csv";
|
|
public const string MsBuildIssuesFileName = "msbuild_issues.csv";
|
|
public const string MsBuildLogFileName = "msbuild_log.txt";
|
|
public const string MsBuildLogFileName = "msbuild_log.txt";
|
|
@@ -23,7 +25,8 @@ namespace GodotTools
|
|
public enum BuildTool
|
|
public enum BuildTool
|
|
{
|
|
{
|
|
MsBuildMono,
|
|
MsBuildMono,
|
|
- MsBuildVs
|
|
|
|
|
|
+ MsBuildVs,
|
|
|
|
+ JetBrainsMsBuild
|
|
}
|
|
}
|
|
|
|
|
|
private static void RemoveOldIssuesFile(BuildInfo buildInfo)
|
|
private static void RemoveOldIssuesFile(BuildInfo buildInfo)
|
|
@@ -181,7 +184,7 @@ namespace GodotTools
|
|
var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, config);
|
|
var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, config);
|
|
|
|
|
|
// Add Godot defines
|
|
// Add Godot defines
|
|
- string constants = buildTool == BuildTool.MsBuildVs ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\"";
|
|
|
|
|
|
+ string constants = buildTool != BuildTool.MsBuildMono ? "GodotDefineConstants=\"" : "GodotDefineConstants=\\\"";
|
|
|
|
|
|
foreach (var godotDefine in godotDefines)
|
|
foreach (var godotDefine in godotDefines)
|
|
constants += $"GODOT_{godotDefine.ToUpper().Replace("-", "_").Replace(" ", "_").Replace(";", "_")};";
|
|
constants += $"GODOT_{godotDefine.ToUpper().Replace("-", "_").Replace(" ", "_").Replace(";", "_")};";
|
|
@@ -189,7 +192,7 @@ namespace GodotTools
|
|
if (Internal.GodotIsRealTDouble())
|
|
if (Internal.GodotIsRealTDouble())
|
|
constants += "GODOT_REAL_T_IS_DOUBLE;";
|
|
constants += "GODOT_REAL_T_IS_DOUBLE;";
|
|
|
|
|
|
- constants += buildTool == BuildTool.MsBuildVs ? "\"" : "\\\"";
|
|
|
|
|
|
+ constants += buildTool != BuildTool.MsBuildMono ? "\"" : "\\\"";
|
|
|
|
|
|
buildInfo.CustomProperties.Add(constants);
|
|
buildInfo.CustomProperties.Add(constants);
|
|
|
|
|
|
@@ -245,18 +248,22 @@ namespace GodotTools
|
|
public static void Initialize()
|
|
public static void Initialize()
|
|
{
|
|
{
|
|
// Build tool settings
|
|
// Build tool settings
|
|
-
|
|
|
|
- EditorDef("mono/builds/build_tool", OS.IsWindows ? BuildTool.MsBuildVs : BuildTool.MsBuildMono);
|
|
|
|
-
|
|
|
|
var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
|
|
var editorSettings = GodotSharpEditor.Instance.GetEditorInterface().GetEditorSettings();
|
|
-
|
|
|
|
|
|
+ var msbuild = BuildTool.MsBuildMono;
|
|
|
|
+ if (OS.IsWindows)
|
|
|
|
+ msbuild = RiderPathManager.IsRider((string) editorSettings.GetSetting(RiderPathManager.EditorPathSettingName))
|
|
|
|
+ ? BuildTool.JetBrainsMsBuild
|
|
|
|
+ : BuildTool.MsBuildVs;
|
|
|
|
+
|
|
|
|
+ EditorDef("mono/builds/build_tool", msbuild);
|
|
|
|
+
|
|
editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary
|
|
editorSettings.AddPropertyInfo(new Godot.Collections.Dictionary
|
|
{
|
|
{
|
|
["type"] = Godot.Variant.Type.Int,
|
|
["type"] = Godot.Variant.Type.Int,
|
|
["name"] = "mono/builds/build_tool",
|
|
["name"] = "mono/builds/build_tool",
|
|
["hint"] = Godot.PropertyHint.Enum,
|
|
["hint"] = Godot.PropertyHint.Enum,
|
|
["hint_string"] = OS.IsWindows ?
|
|
["hint_string"] = OS.IsWindows ?
|
|
- $"{PropNameMsbuildMono},{PropNameMsbuildVs}" :
|
|
|
|
|
|
+ $"{PropNameMsbuildMono},{PropNameMsbuildVs},{PropNameMsbuildJetBrains}" :
|
|
$"{PropNameMsbuildMono}"
|
|
$"{PropNameMsbuildMono}"
|
|
});
|
|
});
|
|
|
|
|