9212605e89
* binding redirects tests: Simplify and get ready for enabling * fix targets broken during cleanup * fix non-windows build * apply pr feedback: remove some not needed code * remigrate BindingRedirects samples, add x64 to bind redir proj
90 lines
2.1 KiB
C#
90 lines
2.1 KiB
C#
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
namespace Microsoft.DotNet.Cli.Build
|
|
{
|
|
public class DotNetPack : DotNetTool
|
|
{
|
|
protected override string Command
|
|
{
|
|
get { return "pack"; }
|
|
}
|
|
|
|
protected override string Args
|
|
{
|
|
get { return $"{GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()}"; }
|
|
}
|
|
|
|
public string Configuration { get; set; }
|
|
|
|
public bool NoBuild { get; set; }
|
|
|
|
public string Output { get; set; }
|
|
|
|
public string ProjectPath { get; set; }
|
|
|
|
public string VersionSuffix { get; set; }
|
|
|
|
public string Runtime { get; set; }
|
|
|
|
private string GetConfiguration()
|
|
{
|
|
if (!string.IsNullOrEmpty(Configuration))
|
|
{
|
|
return $"--configuration {Configuration}";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
private string GetNoBuild()
|
|
{
|
|
if (NoBuild)
|
|
{
|
|
return $"--no-build";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
private string GetOutput()
|
|
{
|
|
if (!string.IsNullOrEmpty(Output))
|
|
{
|
|
return $"--output {Output}";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
private string GetProjectPath()
|
|
{
|
|
if (!string.IsNullOrEmpty(ProjectPath))
|
|
{
|
|
return $"{ProjectPath}";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
private string GetVersionSuffix()
|
|
{
|
|
if (!string.IsNullOrEmpty(VersionSuffix))
|
|
{
|
|
return $"--version-suffix {VersionSuffix}";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
private string GetRuntime()
|
|
{
|
|
if (!string.IsNullOrEmpty(Runtime))
|
|
{
|
|
return $"/p:RuntimeIdentifier={Runtime}";
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|