Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/Cli/Microsoft.DotNet.Cli.Utils/RuntimeEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ internal enum Platform
Darwin = 3,
FreeBSD = 4,
illumos = 5,
Solaris = 6
Solaris = 6,
Haiku = 7
}

internal static class RuntimeEnvironment
Expand Down Expand Up @@ -45,6 +46,8 @@ private static string GetOSName()
return GetDistroId() ?? nameof(Platform.illumos);
case Platform.Solaris:
return nameof(Platform.Solaris);
case Platform.Haiku:
return nameof(Platform.Haiku);
default:
return nameof(Platform.Unknown);
}
Expand All @@ -67,6 +70,8 @@ private static string GetOSVersion()
// RuntimeInformation.OSDescription example on Solaris 11.3: SunOS 5.11 11.3
// we only need the major version; 11
return RuntimeInformation.OSDescription.Split(' ')[2].Split('.')[0];
case Platform.Haiku:
return Environment.OSVersion.Version.ToString(1);
default:
return string.Empty;
}
Expand Down Expand Up @@ -251,6 +256,10 @@ private static Platform DetermineOSPlatform()
{
return Platform.Solaris;
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("HAIKU")))
{
return Platform.Haiku;
}
#endif

return Platform.Unknown;
Expand Down
11 changes: 11 additions & 0 deletions src/Layout/redist/PortableRuntimeIdentifierGraph.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@
"unix-x64"
]
},
"haiku": {
"#import": [
"unix"
]
},
"haiku-x64": {
"#import": [
"haiku",
"unix-x64"
]
},
"illumos": {
"#import": [
"unix"
Expand Down