Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH4038: Adds MSBuildSettings to DotNetRunSettings #4039

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Cake.Common/Tools/DotNet/Run/DotNetRunSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using Cake.Common.Tools.DotNet.MSBuild;

namespace Cake.Common.Tools.DotNet.Run
{
Expand Down Expand Up @@ -45,5 +46,10 @@ public class DotNetRunSettings : DotNetSettings
/// Gets or sets the target runtime.
/// </summary>
public string Runtime { get; set; }

/// <summary>
/// Gets or sets additional arguments to be passed to MSBuild.
/// </summary>
public DotNetMSBuildSettings MSBuildSettings { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/Cake.Common/Tools/DotNet/Run/DotNetRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System;
using Cake.Common.Tools.DotNet.MSBuild;
using Cake.Core;
using Cake.Core.IO;
using Cake.Core.Tooling;
Expand All @@ -14,6 +15,8 @@ namespace Cake.Common.Tools.DotNet.Run
/// </summary>
public sealed class DotNetRunner : DotNetTool<DotNetRunSettings>
{
private readonly ICakeEnvironment _environment;

/// <summary>
/// Initializes a new instance of the <see cref="DotNetRunner" /> class.
/// </summary>
Expand All @@ -27,6 +30,7 @@ public DotNetRunner(
IProcessRunner processRunner,
IToolLocator tools) : base(fileSystem, environment, processRunner, tools)
{
_environment = environment;
}

/// <summary>
Expand Down Expand Up @@ -108,6 +112,12 @@ private ProcessArgumentBuilder GetArguments(string project, ProcessArgumentBuild
builder.Append(settings.RollForward.Value.ToString("F"));
}

// MSBuild Settings
if (settings.MSBuildSettings != null)
{
builder.AppendMSBuildSettings(settings.MSBuildSettings, _environment);
}

// Arguments
if (!arguments.IsNullOrEmpty())
{
Expand Down