dotnet-installer/scripts/dotnet-cli-build/Utils/Monikers.cs
Sridhar Periyasamy d4a3190bfc Refactor the build scripts
- Bifurcate Package and Publish targets to enable signing.
- Move publish from bash/ps into c#.
- Create multiple targets to create MSIs and Bundles.
2016-03-07 12:20:50 -08:00

35 lines
1,002 B
C#

using Microsoft.DotNet.Cli.Build.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Cli.Build
{
public class Monikers
{
public static string GetProductMoniker(BuildTargetContext c)
{
string osname = GetOSShortName();
var arch = CurrentArchitecture.Current.ToString();
var version = c.BuildContext.Get<BuildVersion>("BuildVersion").SimpleVersion;
return $"dotnet-{osname}-{arch}.{version}";
}
public static string GetOSShortName()
{
string osname = "";
switch (CurrentPlatform.Current)
{
case BuildPlatform.Windows:
osname = "win";
break;
default:
osname = CurrentPlatform.Current.ToString().ToLower();
break;
}
return osname;
}
}
}