[win] Add Hot Restart define constant in a target instead of an evaluation property (#17470)

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
This commit is contained in:
Mauro Agnoletti 2023-02-08 03:47:24 -05:00 коммит произвёл GitHub
Родитель 7f7942eae0
Коммит 8b0763b568
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 7 добавлений и 3 удалений

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

@ -13,8 +13,5 @@
<HotRestartIPAPath>$(HotRestartSignedAppOutputDir)$(_AppBundleName).ipa</HotRestartIPAPath>
<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>
</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.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"
Condition="'$(_CanOutputAppBundle)' == 'true' And '$(IsHotRestartBuild)' == 'true' And '$(IsHotRestartEnvironmentReady)' == 'true'" >