[dotnet] Make relase builds for desktop universal by default. Fixes #15620. (#15769)

This commit is contained in:
Rolf Bjarne Kvinge 2022-08-31 16:45:10 +02:00 коммит произвёл GitHub
Родитель e1b8eff6a9
Коммит 2ddb7a6d68
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 10 добавлений и 14 удалений

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

@ -38,6 +38,7 @@
<!-- Set the default RuntimeIdentifier if not already specified. --> <!-- Set the default RuntimeIdentifier if not already specified. -->
<PropertyGroup Condition="'$(_RuntimeIdentifierIsRequired)' == 'true' And '$(RuntimeIdentifier)' == '' And '$(RuntimeIdentifiers)' == '' "> <PropertyGroup Condition="'$(_RuntimeIdentifierIsRequired)' == 'true' And '$(RuntimeIdentifier)' == '' And '$(RuntimeIdentifiers)' == '' ">
<!-- The _<platform>RuntimeIdentifier values are set from the IDE -->
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'iOS'">$(_iOSRuntimeIdentifier)</RuntimeIdentifier> <RuntimeIdentifier Condition="'$(_PlatformName)' == 'iOS'">$(_iOSRuntimeIdentifier)</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'tvOS'">$(_tvOSRuntimeIdentifier)</RuntimeIdentifier> <RuntimeIdentifier Condition="'$(_PlatformName)' == 'tvOS'">$(_tvOSRuntimeIdentifier)</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(_PlatformName)' == 'macOS'">$(_macOSRuntimeIdentifier)</RuntimeIdentifier> <RuntimeIdentifier Condition="'$(_PlatformName)' == 'macOS'">$(_macOSRuntimeIdentifier)</RuntimeIdentifier>
@ -47,21 +48,13 @@
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(_PlatformName)' == 'iOS'">iossimulator-x64</RuntimeIdentifier> <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(_PlatformName)' == 'iOS'">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(_PlatformName)' == 'tvOS'">tvossimulator-x64</RuntimeIdentifier> <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(_PlatformName)' == 'tvOS'">tvossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(_PlatformName)' == 'macOS'">osx-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(_PlatformName)' == 'MacCatalyst'">maccatalyst-x64</RuntimeIdentifier>
<!--
Workaround/hack:
The Microsoft.NET.RuntimeIdentifierInference.targets file is loaded <!-- For release desktop builds we default to universal apps in .NET 7+ -->
before this file, and executes some logic depending on whether the <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(Configuration)' != 'Release' And '$(_PlatformName)' == 'macOS'">osx-x64</RuntimeIdentifier>
RuntimeIdentifier is set or not. Since RuntimeIdentifier isn't set at <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' And '$(Configuration)' != 'Release' And '$(_PlatformName)' == 'MacCatalyst'">maccatalyst-x64</RuntimeIdentifier>
that point (we're setting it here), we need to replicate the logic in <RuntimeIdentifiers Condition="'$(RuntimeIdentifier)' == '' And '$(Configuration)' == 'Release' And '$(_PlatformName)' == 'macOS'">osx-x64;osx-arm64</RuntimeIdentifiers>
the Microsoft.NET.RuntimeIdentifierInference.targets file to make sure <RuntimeIdentifiers Condition="'$(RuntimeIdentifier)' == '' And '$(Configuration)' == 'Release' And '$(_PlatformName)' == 'MacCatalyst'">maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers>
things work as expected.
Ref: https://github.com/dotnet/runtime/issues/54406
-->
<SelfContained>true</SelfContained>
</PropertyGroup> </PropertyGroup>
<!-- We're never using any app hosts --> <!-- We're never using any app hosts -->
@ -71,7 +64,7 @@
</PropertyGroup> </PropertyGroup>
<!-- App extensions are self-contained, even though their OutputType=Library. This must be done here and not targets as it is checked before targets are invoked. --> <!-- App extensions are self-contained, even though their OutputType=Library. This must be done here and not targets as it is checked before targets are invoked. -->
<PropertyGroup Condition="'$(IsAppExtension)' == 'true'"> <PropertyGroup Condition="'$(IsAppExtension)' == 'true' And '$(RuntimeIdentifier)' != ''">
<SelfContained>true</SelfContained> <SelfContained>true</SelfContained>
</PropertyGroup> </PropertyGroup>

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

@ -30,6 +30,7 @@
<NativeLibName>macos-fat</NativeLibName> <NativeLibName>macos-fat</NativeLibName>
<SupportedOSPlatformVersion Condition="'$(SupportedOSPlatformVersion)' == ''">10.14</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="'$(SupportedOSPlatformVersion)' == ''">10.14</SupportedOSPlatformVersion>
<CompilerResponseFile>$(MSBuildThisFileDirectory)\..\..\src\build\dotnet\macos-defines-dotnet.rsp</CompilerResponseFile> <CompilerResponseFile>$(MSBuildThisFileDirectory)\..\..\src\build\dotnet\macos-defines-dotnet.rsp</CompilerResponseFile>
<RuntimeIdentifiers Condition="'$(Configuration)' == 'Release' And '$(SingleArchReleaseBuild)' == 'true'">osx-x64</RuntimeIdentifiers>
</PropertyGroup> </PropertyGroup>
<!-- Logic for Mac Catalyst --> <!-- Logic for Mac Catalyst -->
@ -38,6 +39,7 @@
<NativeLibName>maccatalyst-fat</NativeLibName> <NativeLibName>maccatalyst-fat</NativeLibName>
<SupportedOSPlatformVersion Condition="'$(SupportedOSPlatformVersion)' == ''">13.3</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="'$(SupportedOSPlatformVersion)' == ''">13.3</SupportedOSPlatformVersion>
<CompilerResponseFile>$(MSBuildThisFileDirectory)\..\..\src\build\dotnet\maccatalyst-defines-dotnet.rsp</CompilerResponseFile> <CompilerResponseFile>$(MSBuildThisFileDirectory)\..\..\src\build\dotnet\maccatalyst-defines-dotnet.rsp</CompilerResponseFile>
<RuntimeIdentifiers Condition="'$(Configuration)' == 'Release' And '$(SingleArchReleaseBuild)' == 'true'">maccatalyst-x64</RuntimeIdentifiers>
</PropertyGroup> </PropertyGroup>
<!-- Logic for all test suites --> <!-- Logic for all test suites -->

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

@ -12,6 +12,7 @@
<MonoBundlingExtraArgs>$(MtouchExtraArgs)</MonoBundlingExtraArgs> <MonoBundlingExtraArgs>$(MtouchExtraArgs)</MonoBundlingExtraArgs>
<RootTestsDirectory>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\..'))</RootTestsDirectory> <RootTestsDirectory>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\..\..'))</RootTestsDirectory>
<ThisTestDirectory>$(RootTestsDirectory)\linker\ios\link all</ThisTestDirectory> <ThisTestDirectory>$(RootTestsDirectory)\linker\ios\link all</ThisTestDirectory>
<SingleArchReleaseBuild>true</SingleArchReleaseBuild>
</PropertyGroup> </PropertyGroup>
<Import Project="$(RootTestsDirectory)/common/shared-dotnet.csproj" /> <Import Project="$(RootTestsDirectory)/common/shared-dotnet.csproj" />