Browse Source

Merge pull request #40596 from neikeq/fix-msbuild-restore-not-called

C#: Fix restore not called when building game projects
Rémi Verschelde 5 years ago
parent
commit
72d449b53e
1 changed files with 7 additions and 2 deletions
  1. 7 2
      modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs

+ 7 - 2
modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs

@@ -118,9 +118,14 @@ namespace GodotTools.Build
             string arguments = string.Empty;
             string arguments = string.Empty;
 
 
             if (buildTool == BuildTool.DotnetCli)
             if (buildTool == BuildTool.DotnetCli)
-                arguments += "msbuild "; // `dotnet msbuild` command
+                arguments += "msbuild"; // `dotnet msbuild` command
 
 
-            arguments += $@"""{buildInfo.Solution}"" /t:{string.Join(",", buildInfo.Targets)} " +
+            arguments += $@" ""{buildInfo.Solution}""";
+
+            if (buildInfo.Restore)
+                arguments += " /restore";
+
+            arguments += $@" /t:{string.Join(",", buildInfo.Targets)} " +
                          $@"""/p:{"Configuration=" + buildInfo.Configuration}"" /v:normal " +
                          $@"""/p:{"Configuration=" + buildInfo.Configuration}"" /v:normal " +
                          $@"""/l:{typeof(GodotBuildLogger).FullName},{GodotBuildLogger.AssemblyPath};{buildInfo.LogsDirPath}""";
                          $@"""/l:{typeof(GodotBuildLogger).FullName},{GodotBuildLogger.AssemblyPath};{buildInfo.LogsDirPath}""";