diff options
author | Raul Santos <raulsntos@gmail.com> | 2023-02-10 03:19:30 +0100 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2023-02-10 03:19:30 +0100 |
commit | 2a1523d7517154f13625c09d0e77f2538c8c56d6 (patch) | |
tree | c09e50fe1a3c7db09c9f7f93c29780fe69bcf958 /modules/mono/editor | |
parent | 5c1295dc20323ee1596369b5bcf91ba6a9383336 (diff) |
Build C# csproj instead of the solution
Diffstat (limited to 'modules/mono/editor')
3 files changed, 14 insertions, 8 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildInfo.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildInfo.cs index 1e4fd2f09a..7c02f29606 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildInfo.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildInfo.cs @@ -12,6 +12,7 @@ namespace GodotTools.Build public sealed partial class BuildInfo : RefCounted // TODO Remove RefCounted once we have proper serialization { public string Solution { get; private set; } + public string Project { get; private set; } public string Configuration { get; private set; } public string? RuntimeIdentifier { get; private set; } public string? PublishOutputDir { get; private set; } @@ -28,6 +29,7 @@ namespace GodotTools.Build { return obj is BuildInfo other && other.Solution == Solution && + other.Project == Project && other.Configuration == Configuration && other.RuntimeIdentifier == RuntimeIdentifier && other.PublishOutputDir == PublishOutputDir && other.Restore == Restore && other.Rebuild == Rebuild && other.OnlyClean == OnlyClean && @@ -41,6 +43,7 @@ namespace GodotTools.Build { int hash = 17; hash = (hash * 29) + Solution.GetHashCode(); + hash = (hash * 29) + Project.GetHashCode(); hash = (hash * 29) + Configuration.GetHashCode(); hash = (hash * 29) + (RuntimeIdentifier?.GetHashCode() ?? 0); hash = (hash * 29) + (PublishOutputDir?.GetHashCode() ?? 0); @@ -57,22 +60,25 @@ namespace GodotTools.Build private BuildInfo() { Solution = string.Empty; + Project = string.Empty; Configuration = string.Empty; } - public BuildInfo(string solution, string configuration, bool restore, bool rebuild, bool onlyClean) + public BuildInfo(string solution, string project, string configuration, bool restore, bool rebuild, bool onlyClean) { Solution = solution; + Project = project; Configuration = configuration; Restore = restore; Rebuild = rebuild; OnlyClean = onlyClean; } - public BuildInfo(string solution, string configuration, string runtimeIdentifier, + public BuildInfo(string solution, string project, string configuration, string runtimeIdentifier, string publishOutputDir, bool restore, bool rebuild, bool onlyClean) { Solution = solution; + Project = project; Configuration = configuration; RuntimeIdentifier = runtimeIdentifier; PublishOutputDir = publishOutputDir; diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs index 349f9d0cb8..ed3a4c6e26 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs @@ -262,7 +262,7 @@ namespace GodotTools.Build bool onlyClean = false ) { - var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, configuration, + var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, GodotSharpDirs.ProjectCsProjPath, configuration, restore: true, rebuild, onlyClean); // If a platform was not specified, try determining the current one. If that fails, let MSBuild auto-detect it. @@ -282,7 +282,7 @@ namespace GodotTools.Build [DisallowNull] string publishOutputDir ) { - var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, configuration, + var buildInfo = new BuildInfo(GodotSharpDirs.ProjectSlnPath, GodotSharpDirs.ProjectCsProjPath, configuration, runtimeIdentifier, publishOutputDir, restore: true, rebuild: false, onlyClean: false); buildInfo.CustomProperties.Add($"GodotTargetPlatform={platform}"); diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs index d6549c1b70..d550c36b82 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs @@ -139,8 +139,8 @@ namespace GodotTools.Build // `dotnet clean` / `dotnet build` commands arguments.Add(buildInfo.OnlyClean ? "clean" : "build"); - // Solution - arguments.Add(buildInfo.Solution); + // C# Project + arguments.Add(buildInfo.Project); // `dotnet clean` doesn't recognize these options if (!buildInfo.OnlyClean) @@ -180,8 +180,8 @@ namespace GodotTools.Build { arguments.Add("publish"); // `dotnet publish` command - // Solution - arguments.Add(buildInfo.Solution); + // C# Project + arguments.Add(buildInfo.Project); // Restore // `dotnet publish` restores by default, unless requested not to |