diff --git a/src/Installer/core-sdk-tasks/Enumerations/BuildPlatform.cs b/src/Installer/core-sdk-tasks/Enumerations/BuildPlatform.cs deleted file mode 100644 index 72e68a0dc200..000000000000 --- a/src/Installer/core-sdk-tasks/Enumerations/BuildPlatform.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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.Framework -{ - public enum BuildPlatform - { - Windows = 1, - Unix = 2, - Linux = 3, - OSX = 4, - Ubuntu = 5, - CentOS = 6, - RHEL = 7, - Debian = 8, - Fedora = 9, - OpenSuse = 10, - FreeBSD = 11 - } -} diff --git a/src/Installer/redist-installer/targets/GetRuntimeInformation.targets b/src/Installer/redist-installer/targets/GetRuntimeInformation.targets index e05828c83ea9..db1510b166c0 100644 --- a/src/Installer/redist-installer/targets/GetRuntimeInformation.targets +++ b/src/Installer/redist-installer/targets/GetRuntimeInformation.targets @@ -11,6 +11,7 @@ win osx freebsd + illumos linux $(Rid.Substring(0, $(Rid.LastIndexOf('-')))) diff --git a/src/Installer/redist-installer/targets/SetBuildDefaults.targets b/src/Installer/redist-installer/targets/SetBuildDefaults.targets index 5e6a4bd729b1..e77c7d15b4b6 100644 --- a/src/Installer/redist-installer/targets/SetBuildDefaults.targets +++ b/src/Installer/redist-installer/targets/SetBuildDefaults.targets @@ -7,6 +7,7 @@ true false diff --git a/src/Layout/toolset-tasks/Enumerations/BuildPlatform.cs b/src/Layout/toolset-tasks/Enumerations/BuildPlatform.cs deleted file mode 100644 index 041bc0216b48..000000000000 --- a/src/Layout/toolset-tasks/Enumerations/BuildPlatform.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace Microsoft.DotNet.Cli.Build.Framework -{ - public enum BuildPlatform - { - Windows = 1, - Unix = 2, - Linux = 3, - OSX = 4, - Ubuntu = 5, - CentOS = 6, - RHEL = 7, - Debian = 8, - Fedora = 9, - OpenSuse = 10, - FreeBSD = 11 - } -} diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs index 047ef4d25b61..9aff7c5bc8b2 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs @@ -35,7 +35,10 @@ public class GenerateBundle : TaskBase protected override void ExecuteCore() { OSPlatform targetOS = RuntimeIdentifier.StartsWith("win") ? OSPlatform.Windows : - RuntimeIdentifier.StartsWith("osx") ? OSPlatform.OSX : OSPlatform.Linux; + RuntimeIdentifier.StartsWith("osx") ? OSPlatform.OSX : + RuntimeIdentifier.StartsWith("freebsd") ? OSPlatform.Create("FREEBSD") : + RuntimeIdentifier.StartsWith("illumos") ? OSPlatform.Create("ILLUMOS") : + OSPlatform.Linux; Architecture targetArch = RuntimeIdentifier.EndsWith("-x64") || RuntimeIdentifier.Contains("-x64-") ? Architecture.X64 : RuntimeIdentifier.EndsWith("-x86") || RuntimeIdentifier.Contains("-x86-") ? Architecture.X86 : diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs index f14d4a4cf6ee..63c12a3a749c 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs @@ -185,7 +185,7 @@ private bool GetCrossgen2TargetOS(out string targetOS) string portablePlatform = NuGetUtils.GetBestMatchingRid( runtimeGraph, _targetPlatform, - new[] { "linux", "linux-musl", "osx", "win", "freebsd" }, + new[] { "linux", "linux-musl", "osx", "win", "freebsd", "illumos" }, out _); // For source-build, allow the bootstrap SDK rid to be unknown to the runtime repo graph. @@ -199,6 +199,14 @@ private bool GetCrossgen2TargetOS(out string targetOS) { portablePlatform = "linux"; } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))) + { + portablePlatform = "freebsd"; + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("ILLUMOS"))) + { + portablePlatform = "illumos"; + } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { portablePlatform = "osx"; @@ -212,6 +220,7 @@ private bool GetCrossgen2TargetOS(out string targetOS) "osx" => "osx", "win" => "windows", "freebsd" => "freebsd", + "illumos" => "illumos", _ => null };