2016-10-29 08:04:20 +00:00
|
|
|
// 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
|
|
|
|
{
|
2016-11-03 06:01:57 +00:00
|
|
|
public class DotNetPackPJ : DotNetTool
|
2016-10-29 08:04:20 +00:00
|
|
|
{
|
|
|
|
protected override string Command
|
|
|
|
{
|
2016-11-03 06:01:57 +00:00
|
|
|
get { return "pack"; }
|
2016-10-29 08:04:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override string Args
|
|
|
|
{
|
2016-11-03 06:01:57 +00:00
|
|
|
get { return $"{GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetBuildBasePath()} {GetOutput()} {GetVersionSuffix()}"; }
|
2016-10-29 08:04:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public string Configuration { get; set; }
|
|
|
|
|
|
|
|
public bool NoBuild { get; set; }
|
2016-11-03 06:01:57 +00:00
|
|
|
|
|
|
|
public string BuildBasePath { get; set; }
|
|
|
|
|
2016-10-29 08:04:20 +00:00
|
|
|
public string Output { get; set; }
|
|
|
|
|
|
|
|
public string ProjectPath { get; set; }
|
|
|
|
|
|
|
|
public string VersionSuffix { get; set; }
|
|
|
|
|
|
|
|
private string GetConfiguration()
|
|
|
|
{
|
|
|
|
if (!string.IsNullOrEmpty(Configuration))
|
|
|
|
{
|
|
|
|
return $"--configuration {Configuration}";
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
private string GetNoBuild()
|
|
|
|
{
|
|
|
|
if (NoBuild)
|
|
|
|
{
|
|
|
|
return $"--no-build";
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2016-11-03 06:01:57 +00:00
|
|
|
|
|
|
|
private string GetBuildBasePath()
|
|
|
|
{
|
|
|
|
if (!string.IsNullOrEmpty(BuildBasePath))
|
|
|
|
{
|
|
|
|
return $"--build-base-path {BuildBasePath}";
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2016-10-29 08:04:20 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|