diff --git a/build_projects/dotnet-cli-build/CliMonikers.cs b/build_projects/dotnet-cli-build/CliMonikers.cs new file mode 100644 index 000000000..a3c0175a6 --- /dev/null +++ b/build_projects/dotnet-cli-build/CliMonikers.cs @@ -0,0 +1,14 @@ +using Microsoft.DotNet.Cli.Build.Framework; + +namespace Microsoft.DotNet.Cli.Build +{ + public static class CliMonikers + { + public static string GetSdkDebianPackageName(BuildTargetContext c) + { + var nugetVersion = c.BuildContext.Get("BuildVersion").NuGetVersion; + + return $"dotnet-dev-{nugetVersion}"; + } + } +} diff --git a/build_projects/dotnet-cli-build/DebTargets.cs b/build_projects/dotnet-cli-build/DebTargets.cs index 0fab6aa82..95bca6eed 100644 --- a/build_projects/dotnet-cli-build/DebTargets.cs +++ b/build_projects/dotnet-cli-build/DebTargets.cs @@ -24,7 +24,7 @@ namespace Microsoft.DotNet.Cli.Build public static BuildTargetResult GenerateSdkDeb(BuildTargetContext c) { var channel = c.BuildContext.Get("Channel").ToLower(); - var packageName = Monikers.GetSdkDebianPackageName(c); + var packageName = CliMonikers.GetSdkDebianPackageName(c); var version = c.BuildContext.Get("BuildVersion").NuGetVersion; var debFile = c.BuildContext.Get("SdkInstallerFile"); var manPagesDir = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages"); @@ -116,7 +116,7 @@ namespace Microsoft.DotNet.Cli.Build { IEnumerable orderedPackageNames = new List() { - Monikers.GetSdkDebianPackageName(c), + CliMonikers.GetSdkDebianPackageName(c), Monikers.GetDebianSharedFrameworkPackageName(CliDependencyVersions.SharedFrameworkVersion), Monikers.GetDebianSharedHostPackageName(c) }; diff --git a/build_projects/dotnet-cli-build/PublishTargets.cs b/build_projects/dotnet-cli-build/PublishTargets.cs index ed0b07264..86fb65529 100644 --- a/build_projects/dotnet-cli-build/PublishTargets.cs +++ b/build_projects/dotnet-cli-build/PublishTargets.cs @@ -276,7 +276,7 @@ namespace Microsoft.DotNet.Cli.Build { var version = CliNuGetVersion; - var packageName = Monikers.GetSdkDebianPackageName(c); + var packageName = CliMonikers.GetSdkDebianPackageName(c); var installerFile = c.BuildContext.Get("SdkInstallerFile"); var uploadUrl = AzurePublisherTool.CalculateInstallerUploadUrl(installerFile, Channel, version); diff --git a/build_projects/shared-build-targets-utils/Utils/Monikers.cs b/build_projects/shared-build-targets-utils/Utils/Monikers.cs index d28723643..aa6283925 100644 --- a/build_projects/shared-build-targets-utils/Utils/Monikers.cs +++ b/build_projects/shared-build-targets-utils/Utils/Monikers.cs @@ -45,54 +45,6 @@ namespace Microsoft.DotNet.Cli.Build return $"{CurrentPlatform.Current}_{CurrentArchitecture.Current}"; } - public static string GetDebianPackageName(BuildTargetContext c) - { - var channel = c.BuildContext.Get("Channel").ToLower(); - var packageName = ""; - switch (channel) - { - case "dev": - packageName = "dotnet-nightly"; - break; - case "beta": - case "rc1": - case "rc2": - case "preview": - case "rtm": - packageName = "dotnet"; - break; - default: - throw new Exception($"Unknown channel - {channel}"); - } - - return packageName; - } - - public static string GetSdkDebianPackageName(BuildTargetContext c) - { - var channel = c.BuildContext.Get("Channel").ToLower(); - var nugetVersion = c.BuildContext.Get("BuildVersion").NuGetVersion; - - var packagePrefix = ""; - switch (channel) - { - case "dev": - packagePrefix = "dotnet-nightly"; - break; - case "beta": - case "rc1": - case "rc2": - case "preview": - case "rtm": - packagePrefix = "dotnet"; - break; - default: - throw new Exception($"Unknown channel - {channel}"); - } - - return $"{packagePrefix}-dev-{nugetVersion}"; - } - public static string GetDebianSharedFrameworkPackageName(string sharedFrameworkNugetVersion) { return $"dotnet-sharedframework-{SharedFrameworkName}-{sharedFrameworkNugetVersion}".ToLower();