[dotnet] Set the default RuntimeIdentifier earlier.

This commit is contained in:
Rolf Bjarne Kvinge 2021-06-21 12:51:20 +02:00
Родитель f1cc00ce3a
Коммит 7179cac047
2 изменённых файлов: 25 добавлений и 24 удалений

Просмотреть файл

@ -29,30 +29,6 @@
<TargetArchitectures Condition=" '$(_PlatformName)' != 'macOS' And '$(MtouchArch)' != '' ">$(MtouchArch)</TargetArchitectures>
</PropertyGroup>
<!-- If the old-style variables aren't set, figure it out using RuntimeIdentifier. -->
<!-- First set the default RuntimeIdentifier if not already specified. -->
<PropertyGroup Condition=" '$(RuntimeIdentifier)' == '' And '$(RuntimeIdentifiers)' == '' ">
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'iOS'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'tvOS'">tvossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'macOS'">osx-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'MacCatalyst'">maccatalyst-x64</RuntimeIdentifier>
<!--
Workaround/hack:
The Microsoft.NET.RuntimeIdentifierInference.targets file is loaded
before this file, and executes some logic depending on whether the
RuntimeIdentifier is set or not. Since RuntimeIdentifier isn't set at
that point (we're setting it here), we need to replicate the logic in
the Microsoft.NET.RuntimeIdentifierInference.targets file to make sure
things work as expected.
Ref: https://github.com/dotnet/runtime/issues/54406
-->
<SelfContained>true</SelfContained>
<_RuntimeIdentifierUsesAppHost>false</_RuntimeIdentifierUsesAppHost>
<UseAppHost>false</UseAppHost>
<IntermediateOutputPath>$(IntermediateOutputPath)$(RuntimeIdentifier)\</IntermediateOutputPath>
<OutputPath>$(OutputPath)$(RuntimeIdentifier)\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifiers)' != '' And '$(RuntimeIdentifier)' != '' ">
<!-- Check if both RuntimeIdentifier and RuntimeIdentifiers are set, in which case we clear RuntimeIdentifier -->
<!-- Also set a variable that says if this happens, so that we can show a warning later -->

Просмотреть файл

@ -26,4 +26,29 @@
<!-- We don't need any dependency files -->
<GenerateDependencyFile Condition="'$(GenerateDependencyFile)' == ''">false</GenerateDependencyFile>
</PropertyGroup>
<!-- Set the default RuntimeIdentifier if not already specified. -->
<PropertyGroup Condition=" '$(RuntimeIdentifier)' == '' And '$(RuntimeIdentifiers)' == '' ">
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'iOS'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'tvOS'">tvossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'macOS'">osx-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'MacCatalyst'">maccatalyst-x64</RuntimeIdentifier>
<!--
Workaround/hack:
The Microsoft.NET.RuntimeIdentifierInference.targets file is loaded
before this file, and executes some logic depending on whether the
RuntimeIdentifier is set or not. Since RuntimeIdentifier isn't set at
that point (we're setting it here), we need to replicate the logic in
the Microsoft.NET.RuntimeIdentifierInference.targets file to make sure
things work as expected.
Ref: https://github.com/dotnet/runtime/issues/54406
-->
<SelfContained>true</SelfContained>
<_RuntimeIdentifierUsesAppHost>false</_RuntimeIdentifierUsesAppHost>
<UseAppHost>false</UseAppHost>
<IntermediateOutputPath>$(IntermediateOutputPath)$(RuntimeIdentifier)\</IntermediateOutputPath>
<OutputPath>$(OutputPath)$(RuntimeIdentifier)\</OutputPath>
</PropertyGroup>
</Project>