Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set targetOS properly for HostModel #42144

Merged
merged 1 commit into from
Jul 15, 2024
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
20 changes: 0 additions & 20 deletions src/Installer/core-sdk-tasks/Enumerations/BuildPlatform.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('WINDOWS')) ">win</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('OSX')) ">osx</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('FREEBSD')) ">freebsd</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND $([MSBuild]::IsOSPlatform('ILLUMOS')) ">illumos</HostOSName>
<HostOSName Condition=" '$(HostOSName)' == '' AND '$(IsLinux)' == 'True' ">linux</HostOSName>

<OSName Condition=" '$(OSName)' == '' AND $(Rid) != '' ">$(Rid.Substring(0, $(Rid.LastIndexOf('-'))))</OSName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' AND
($(Rid.StartsWith('rhel.6'))
OR $(Rid.StartsWith('freebsd'))
OR $(Rid.StartsWith('illumos'))
OR $(Rid.StartsWith('linux-musl'))
OR $(Rid.StartsWith('ubuntu.18.04')))">true</SkipBuildingInstallers>
<SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' ">false</SkipBuildingInstallers>
Expand Down
20 changes: 0 additions & 20 deletions src/Layout/toolset-tasks/Enumerations/BuildPlatform.cs
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only used in dotnet/cli-lab repo which has its own copy of this enum.

This file was deleted.

5 changes: 4 additions & 1 deletion src/Tasks/Microsoft.NET.Build.Tasks/GenerateBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down