Skip to content

Commit

Permalink
Merge pull request #13570 from unoplatform/mergify/bp/release/stable/…
Browse files Browse the repository at this point in the history
…4.10/pr-13521

fix(winappsdk): Adjust 1.4 detection (backport #13521)
  • Loading branch information
jeromelaban authored Sep 8, 2023
2 parents 364bbaa + 70bd2be commit 570618e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 7 additions & 1 deletion build/uno.winui.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="../uno.winui.common.props" Condition="'$(WindowsAppSDKWinUI)'!='true'" />
<PropertyGroup>
<!-- Wrap WinAppSDK detection until a stable property can be used -->
<_UnoIsWinAppSDKDefined>false</_UnoIsWinAppSDKDefined>
<_UnoIsWinAppSDKDefined Condition="'$(WindowsAppSDKWinUI)'=='true' or '$(UseWinUITools)'=='true'">true</_UnoIsWinAppSDKDefined>
</PropertyGroup>

<Import Project="../uno.winui.common.props" Condition="'$(_UnoIsWinAppSDKDefined)'!='true'" />

</Project>
4 changes: 2 additions & 2 deletions build/uno.winui.single-project.targets
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</ItemGroup>

<Choose>
<When Condition="'$(WindowsAppSDKWinUI)'!='true'">
<When Condition="'$(_UnoIsWinAppSDKDefined)'!='true'">
<!-- IDE capabilities -->

<!-- Sync with https://github.com/dotnet/maui/blob/ffab30545ac146710a9ee61138be33e52ca4b326/src/Templates/src/templates/maui-mobile/Directory.Build.targets -->
Expand Down Expand Up @@ -148,7 +148,7 @@
</When>
</Choose>

<Target Name="_RemoveRoslynUnoSourceGenerationWinUI" BeforeTargets="CoreCompile;XamlPreCompile" Condition="'$(WindowsAppSDKWinUI)'=='true'">
<Target Name="_RemoveRoslynUnoSourceGenerationWinUI" BeforeTargets="CoreCompile;XamlPreCompile" Condition="'$(_UnoIsWinAppSDKDefined)'=='true'">
<!---
Remove uno source generators when building under WinAppSDK
-->
Expand Down
8 changes: 4 additions & 4 deletions build/uno.winui.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<_IsUnoWinUIPackage>$(MSBuildThisFile.ToLower().Equals('uno.winui.targets'))</_IsUnoWinUIPackage>
</PropertyGroup>

<Import Project="../uno.winui.common.targets" Condition="'$(WindowsAppSDKWinUI)'!='true'" />
<Import Project="../uno.winui.cross-runtime.targets" Condition="'$(WindowsAppSDKWinUI)'!='true'" />
<Import Project="../uno.winui.common.targets" Condition="'$(_UnoIsWinAppSDKDefined)'!='true'" />
<Import Project="../uno.winui.cross-runtime.targets" Condition="'$(_UnoIsWinAppSDKDefined)'!='true'" />
<Import Project="../uno.winui.single-project.targets" />
<Import Project="../uno.winui.runtime-replace.targets" Condition="'$(WindowsAppSDKWinUI)'!='true'" />
<Import Project="../uno.winui.winappsdk.targets" Condition="'$(WindowsAppSDKWinUI)'=='true'" />
<Import Project="../uno.winui.runtime-replace.targets" Condition="'$(_UnoIsWinAppSDKDefined)'!='true'" />
<Import Project="../uno.winui.winappsdk.targets" Condition="'$(_UnoIsWinAppSDKDefined)'=='true'" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<UnoUIUseRoslynSourceGenerators Condition="'$(UnoUIUseRoslynSourceGenerators)'==''">false</UnoUIUseRoslynSourceGenerators>

<ShouldRunGenerator>true</ShouldRunGenerator>
<ShouldRunGenerator Condition="'$(WindowsAppSDKWinUI)'=='true' or $(TargetFramework.StartsWith('uap10.0'))">false</ShouldRunGenerator>
<ShouldRunGenerator Condition="'$(_UnoIsWinAppSDKDefined)'=='true' or $(TargetFramework.StartsWith('uap10.0'))">false</ShouldRunGenerator>

<!--
MSBuild below 17.0 implies C# 7.3 or below, which does not support lambda parameters shadowing (https://github.com/dotnet/csharplang/blob/main/meetings/2019/LDM-2019-01-16.md).
Expand Down

0 comments on commit 570618e

Please sign in to comment.