Skip to content
Open
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
23 changes: 23 additions & 0 deletions src/Cake.Unity/UnityEditorArguments.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,26 @@ public class UnityEditorArguments
/// </code>
/// </example>
public Action<dynamic> SetCustomArguments { set => value.Invoke(customArguments); }

/// <summary>
/// <para>Custom arguments that are supplied among other arguments in format "-key value". </para>
/// <para>Usefull for third-party builders or tools that required arguments with only singe dash in command line befor argument name</para>
/// <para>Expected to be used in conjunction with ExecuteMethod argument. </para>
/// </summary>
/// <example>
/// <code>
/// new UnityEditorArguments
/// {
/// ExecuteMethod = "Build.RunCommandLineBuild",
/// SetCustomSingleDashArguments = x =>
/// {
/// x.headlessPath = "./";
/// },
/// };
/// </code>
/// </example>
public Action<dynamic> SetCustomSingleDashArguments { set => value.Invoke(сustomSingleDashArguments); }
private readonly ExpandoObject сustomSingleDashArguments = new ExpandoObject();

internal ProcessArgumentBuilder CustomizeCommandLineArguments(ProcessArgumentBuilder builder, ICakeEnvironment environment)
{
Expand Down Expand Up @@ -476,6 +496,9 @@ internal ProcessArgumentBuilder CustomizeCommandLineArguments(ProcessArgumentBui

foreach (var customArgument in customArguments)
builder.AppendQuoted($"--{customArgument.Key}={customArgument.Value}");

foreach (var сustomSingleDashArgument in сustomSingleDashArguments)
builder.AppendQuoted($"-{сustomSingleDashArgument.Key} {сustomSingleDashArgument.Value}");

return builder;
}
Expand Down