Use the portable linux-x64 runtime when building on Linux.

This commit is contained in:
Eric Erhardt 2017-03-24 15:07:54 -05:00
parent dff66c1acb
commit a97b572e49
4 changed files with 13 additions and 1 deletions

View file

@ -7,5 +7,6 @@
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' ">false</IncludeAdditionalSharedFrameworks>
<IncludeNuGetPackageArchive Condition=" '$(IncludeNuGetPackageArchive)' == '' ">true</IncludeNuGetPackageArchive>
<SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' ">false</SkipBuildingInstallers>
<UsePortableLinuxSharedFramework Condition=" '$(UsePortableLinuxSharedFramework)' == '' AND '$(OSPlatform)' == 'linux' ">true</UsePortableLinuxSharedFramework>
</PropertyGroup>
</Project>

View file

@ -5,12 +5,14 @@
<GetCurrentRuntimeInformation>
<Output TaskParameter="Rid" PropertyName="HostRid" />
<Output TaskParameter="OSName" PropertyName="HostOSName" />
<Output TaskParameter="OSPlatform" PropertyName="HostOSPlatform" />
</GetCurrentRuntimeInformation>
<PropertyGroup>
<Rid Condition=" '$(Rid)' == '' ">$(HostRid)</Rid>
<Architecture Condition=" '$(Architecture)' == '' ">x64</Architecture>
<OSName Condition=" '$(OSName)' == '' ">$(HostOSName)</OSName>
<OSPlatform Condition=" '$(OSPlatform)' == '' ">$(HostOSPlatform)</OSPlatform>
<BuildInfoPropsContent>
&lt;Project ToolsVersion=&quot;15.0&quot;&gt;
@ -18,6 +20,7 @@
&lt;Rid&gt;$(Rid)&lt;/Rid&gt;
&lt;Architecture&gt;$(Architecture)&lt;/Architecture&gt;
&lt;OSName&gt;$(OSName)&lt;/OSName&gt;
&lt;OSPlatform&gt;$(OSPlatform)&lt;/OSPlatform&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</BuildInfoPropsContent>

View file

@ -10,7 +10,11 @@
<DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(ProductMonikerRid).$(SharedFrameworkVersion)$(InstallerExtension)</DownloadedSharedFrameworkInstallerFileName>
<DownloadedSharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(DownloadedSharedFrameworkInstallerFileName)</DownloadedSharedFrameworkInstallerFile>
<CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(SharedFrameworkVersion)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
<!-- Use the portable linux-x64 Rid when downloading the shared framework compressed file.
NOTE: There isn't a 'linux-x64' version of the installers or the additional shared framweork. -->
<SharedFrameworkRid>$(ProductMonikerRid)</SharedFrameworkRid>
<SharedFrameworkRid Condition=" '$(UsePortableLinuxSharedFramework)' == 'true' ">linux-x64</SharedFrameworkRid>
<CombinedFrameworkHostCompressedFileName>dotnet-$(SharedFrameworkRid).$(SharedFrameworkVersion)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
</PropertyGroup>
<!-- Additional Shared Framework to be installed -->

View file

@ -16,10 +16,14 @@ namespace Microsoft.DotNet.Cli.Build
[Output]
public string OSName { get; set; }
[Output]
public string OSPlatform { get; set; }
public override bool Execute()
{
Rid = RuntimeEnvironment.GetRuntimeIdentifier();
OSName = GetOSShortName();
OSPlatform = RuntimeEnvironment.OperatingSystemPlatform.ToString().ToLower();
return true;
}