summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2017-10-29 10:11:20 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2017-10-29 10:11:20 +0100
commit15e30187eed48c4f70efe94c2624c2e50d302295 (patch)
treec05c5441ceeb78917664389896a18864232021a3 /modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
parent8fca54fb0dacbc66fab6ad6e53336e1a17f5b83e (diff)
downloadredot-engine-15e30187eed48c4f70efe94c2624c2e50d302295.tar.gz
Fix regression from #12473 and #12388
Diffstat (limited to 'modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs')
-rw-r--r--modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs37
1 files changed, 14 insertions, 23 deletions
diff --git a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
index bdbef82aad..04da0600cc 100644
--- a/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
+++ b/modules/mono/editor/GodotSharpTools/Build/BuildSystem.cs
@@ -16,33 +16,24 @@ namespace GodotSharpTools.Build
private extern static void godot_icall_BuildInstance_ExitCallback(string solution, string config, int exitCode);
[MethodImpl(MethodImplOptions.InternalCall)]
- private extern static MSBuildInfo godot_icall_BuildInstance_get_MSBuildInfo();
+ private extern static void godot_icall_BuildInstance_get_MSBuildInfo(ref string msbuildPath, ref string frameworkPath);
- [StructLayout(LayoutKind.Sequential)]
private struct MSBuildInfo
{
- string path;
- string frameworkPathOverride;
-
- public string MSBuildPath
- {
- get { return path; }
- }
-
- public string FrameworkPathOverride
- {
- get { return frameworkPathOverride; }
- }
+ public string path;
+ public string frameworkPathOverride;
}
private static MSBuildInfo GetMSBuildInfo()
{
- MSBuildInfo ret = godot_icall_BuildInstance_get_MSBuildInfo();
+ MSBuildInfo msbuildInfo = new MSBuildInfo();
+
+ godot_icall_BuildInstance_get_MSBuildInfo(ref msbuildInfo.path, ref msbuildInfo.frameworkPathOverride);
- if (ret.MSBuildPath == null)
+ if (msbuildInfo.path == null)
throw new FileNotFoundException("Cannot find the MSBuild executable.");
- return ret;
+ return msbuildInfo;
}
private string solution;
@@ -70,12 +61,12 @@ namespace GodotSharpTools.Build
if (customProperties != null)
customPropertiesList.AddRange(customProperties);
- if (msbuildInfo.FrameworkPathOverride.Length > 0)
- customPropertiesList.Add("FrameworkPathOverride=" + msbuildInfo.FrameworkPathOverride);
+ if (msbuildInfo.frameworkPathOverride != null)
+ customPropertiesList.Add("FrameworkPathOverride=" + msbuildInfo.frameworkPathOverride);
string compilerArgs = BuildArguments(loggerAssemblyPath, loggerOutputDir, customPropertiesList);
- ProcessStartInfo startInfo = new ProcessStartInfo(msbuildInfo.MSBuildPath, compilerArgs);
+ ProcessStartInfo startInfo = new ProcessStartInfo(msbuildInfo.path, compilerArgs);
// No console output, thanks
startInfo.RedirectStandardOutput = true;
@@ -114,12 +105,12 @@ namespace GodotSharpTools.Build
if (customProperties != null)
customPropertiesList.AddRange(customProperties);
- if (msbuildInfo.FrameworkPathOverride.Length > 0)
- customPropertiesList.Add("FrameworkPathOverride=" + msbuildInfo.FrameworkPathOverride);
+ if (msbuildInfo.frameworkPathOverride.Length > 0)
+ customPropertiesList.Add("FrameworkPathOverride=" + msbuildInfo.frameworkPathOverride);
string compilerArgs = BuildArguments(loggerAssemblyPath, loggerOutputDir, customPropertiesList);
- ProcessStartInfo startInfo = new ProcessStartInfo(msbuildInfo.MSBuildPath, compilerArgs);
+ ProcessStartInfo startInfo = new ProcessStartInfo(msbuildInfo.path, compilerArgs);
// No console output, thanks
startInfo.RedirectStandardOutput = true;