dotnet-installer/build_projects/dotnet-cli-build/DotNetPack.cs
John Beisner dbcd83075c
Creating and publishing 'symbols.nuget' to the blob feed. (#8712)
* Creating and publishing '*.symbols.nuget' to the blob feed.

* Reverting 'generatenupkg' methodology.

* Fixing formatting...

* Overwrite should = 'false'

* Second draft - Creating and publishing '*.symbols.nuget' to the blob feed.

* Fixing a VS auto-update.

* Removing the 'Microsoft.SymbolUploader.Build.Task' modifications; need to make a PR just for this.

* Change "sdk.*.Microsoft.DotNet.SDK.*.symbols.nupkg" to "runtime.*.Microsoft.DotNet.SDK.*.symbols.nupkg"; removing the 'DotNetRestore' on the Symbols.csproj

* Removing a 'todo' comment...

* Putting back the 'dotnet restore'

* Fixing a typo...

* Logical separation of the 'nupkg' from the 'symbols.nupkg' enumeration; fixed 'swr' pattern.

* Add "BLOBFEED_STORAGE_CONTAINER"
2018-03-13 08:19:15 -07:00

105 lines
2.4 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 : DotNetMSBuildTool
{
protected override string Command
{
get { return "pack"; }
}
protected override string Args
{
get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {GetIncludeSymbols()} {MsbuildArgs}"; }
}
public string Configuration { get; set; }
public bool NoBuild { get; set; }
public string MsbuildArgs { get; set; }
public string Output { get; set; }
public string ProjectPath { get; set; }
public string VersionSuffix { get; set; }
public string Runtime { get; set; }
public bool IncludeSymbols { 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;
}
private string GetIncludeSymbols()
{
if (IncludeSymbols)
{
return $"--include-symbols";
}
return null;
}
}
}