parent
a3a58423d1
commit
a7366f5864
6 changed files with 193 additions and 40 deletions
|
@ -7,21 +7,46 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
{
|
||||
public sealed class Publish3Command : TestCommand
|
||||
{
|
||||
private string _framework;
|
||||
private string _runtime;
|
||||
|
||||
public Publish3Command()
|
||||
: base("dotnet")
|
||||
{
|
||||
}
|
||||
|
||||
public Publish3Command WithFramework(string framework)
|
||||
{
|
||||
_framework = framework;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Publish3Command WithRuntime(string runtime)
|
||||
{
|
||||
_runtime = runtime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override CommandResult Execute(string args = "")
|
||||
{
|
||||
args = $"publish3 {args}";
|
||||
args = $"publish3 {args} {BuildArgs()}";
|
||||
return base.Execute(args);
|
||||
}
|
||||
|
||||
public override CommandResult ExecuteWithCapturedOutput(string args = "")
|
||||
{
|
||||
args = $"publish3 {args}";
|
||||
args = $"publish3 {args} {BuildArgs()}";
|
||||
return base.ExecuteWithCapturedOutput(args);
|
||||
}
|
||||
|
||||
private string BuildArgs()
|
||||
{
|
||||
return string.Join(" ",
|
||||
FrameworkOption,
|
||||
RuntimeOption);
|
||||
}
|
||||
|
||||
private string FrameworkOption => string.IsNullOrEmpty(_framework) ? "" : $"-f {_framework}";
|
||||
private string RuntimeOption => string.IsNullOrEmpty(_runtime) ? "" : $"-r {_runtime}";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue