[release/7.0.1xx-xcode14.2] [win] Add Hot Restart define constant in a target instead of an evaluation property. (#17471)

This is needed in order to read the correct value of the "IsHotRestartBuild" property set by the VS extension. Doing it in a PropertyGroup at evaluation was not getting the correct value since it was not being set as an MSBuild global property

This PR is related to this other one in the XVS extension: https://github.com/xamarin/XamarinVS/pull/13612


Backport of #17470

Co-authored-by: Mauro Agnoletti <mauro.agnoletti@gmail.com>
This commit is contained in:
VS MobileTools Engineering Service 2 2023-02-08 03:49:07 -05:00 коммит произвёл GitHub
Родитель c18ed0c38b
Коммит 9ffa71bdb3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 7 добавлений и 3 удалений

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

@ -13,8 +13,5 @@
<HotRestartIPAPath>$(HotRestartSignedAppOutputDir)$(_AppBundleName).ipa</HotRestartIPAPath> <HotRestartIPAPath>$(HotRestartSignedAppOutputDir)$(_AppBundleName).ipa</HotRestartIPAPath>
<UnpackHotRestartFrameworks Condition="'$(UnpackHotRestartFrameworks)' == ''">true</UnpackHotRestartFrameworks> <UnpackHotRestartFrameworks Condition="'$(UnpackHotRestartFrameworks)' == ''">true</UnpackHotRestartFrameworks>
<_IsHotRestartDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)HOTRESTART($|;)'))</_IsHotRestartDefined>
<DefineConstants Condition="!$(_IsHotRestartDefined) And '$(IsHotRestartBuild)' == 'true'">HOTRESTART;$(DefineConstants)</DefineConstants>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

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

@ -14,6 +14,13 @@
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets') And '$(MessagingBuildTargetsImported)' != 'true'" /> <Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Build.targets') And '$(MessagingBuildTargetsImported)' != 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets') And '$(MessagingAppleTargetsImported)' != 'true'" /> <Import Project="$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets" Condition="Exists('$(MSBuildThisFileDirectory)Xamarin.Messaging.Apple.targets') And '$(MessagingAppleTargetsImported)' != 'true'" />
<Target Name="AddHotRestartDefineConstants" BeforeTargets="AddImplicitDefineConstants">
<PropertyGroup>
<_IsHotRestartDefined>$([System.Text.RegularExpressions.Regex]::IsMatch('$(DefineConstants.Trim())', '(^|;)HOTRESTART($|;)'))</_IsHotRestartDefined>
<DefineConstants Condition="!$(_IsHotRestartDefined) And '$(IsHotRestartBuild)' == 'true'">HOTRESTART;$(DefineConstants)</DefineConstants>
</PropertyGroup>
</Target>
<Target Name="_DetectHotRestartSigningIdentity" AfterTargets="_DetectAppManifest" <Target Name="_DetectHotRestartSigningIdentity" AfterTargets="_DetectAppManifest"
Condition="'$(_CanOutputAppBundle)' == 'true' And '$(IsHotRestartBuild)' == 'true' And '$(IsHotRestartEnvironmentReady)' == 'true'" > Condition="'$(_CanOutputAppBundle)' == 'true' And '$(IsHotRestartBuild)' == 'true' And '$(IsHotRestartEnvironmentReady)' == 'true'" >