|
6 | 6 | They can be overriden if defined in the consuming project.
|
7 | 7 | -->
|
8 | 8 | <Project InitialTargets="MultiTargetCompatabilityCheck">
|
9 |
| - <Target Name="MultiTargetCompatabilityCheck"> |
10 |
| - <!-- netstandard is not compatible with Uno platforms. --> |
11 |
| - <Error Condition="$(IsNetstandard) == 'true' AND $(IsUno) == 'true'" Text="Projects cannot MultiTarget both netstandard and Uno Platform." /> |
12 |
| - </Target> |
13 | 9 |
|
14 | 10 | <PropertyGroup Condition="$(IsDeployableHead) == 'true'">
|
15 | 11 | <!-- See https://github.com/CommunityToolkit/Labs-Windows/issues/142 -->
|
|
64 | 60 | <HasWinUI Condition="'$(HasWinUI)' == '' AND '$(WinUIMajorVersion)' == '2' AND '$(HasWinUI2)' == 'false'">false</HasWinUI>
|
65 | 61 | <HasWinUI Condition="'$(HasWinUI)' == '' AND ('$(IsUwp)' == 'true' OR '$(IsWinAppSdk)' == 'true' OR '$(IsUno)' == 'true')">true</HasWinUI>
|
66 | 62 |
|
| 63 | + <!-- Can be used to opt-out of the UWP XAML framework reference, if not needed --> |
| 64 | + <HasWindowsUIXaml Condition="'$(HasWindowsUIXaml)' == '' AND '$(IsUwp)' == 'true'">true</HasWindowsUIXaml> |
| 65 | + <HasWindowsUIXaml Condition="'$(HasWindowsUIXaml)' == '' AND '$(IsUwp)' != 'true'">false</HasWindowsUIXaml> |
| 66 | + |
67 | 67 | <!--
|
68 | 68 | The 'UseUwp' property tells the .NET SDK to add a framework reference for the 'Microsoft.Windows.UI.Xaml.dll' assembly, which allows
|
69 | 69 | .NET projects to access UWP XAML types. This is orthogonal to whether WinUI is being used or not. As such, we always set this for
|
70 | 70 | UWP projects that have 'windows' as identifier (i.e. they are not 'UAP' projects, which is legacy UWP), regardless of WinUI.
|
71 | 71 | -->
|
72 |
| - <UseUwp Condition="'$(IsUwp)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows'">true</UseUwp> |
| 72 | + <UseUwp Condition="'$(IsUwp)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows' AND '$(HasWindowsUIXaml)' == 'true'">true</UseUwp> |
73 | 73 | </PropertyGroup>
|
| 74 | + |
| 75 | + <Target Name="MultiTargetCompatabilityCheck"> |
| 76 | + |
| 77 | + <!-- .NET Standard is not compatible with Uno platforms --> |
| 78 | + <Error Condition="'$(IsNetstandard)' == 'true' AND '$(IsUno)' == 'true'" Text="Projects cannot MultiTarget both netstandard and Uno Platform." /> |
| 79 | + |
| 80 | + <!-- |
| 81 | + UWP XAML can only be enabled for UWP projects. No need to warn for UWP XAML |
| 82 | + being disabled when WinUI 2 is used, as that will already fail to build. |
| 83 | + --> |
| 84 | + <Error Condition="'$(HasWindowsUIXaml)' == 'true' AND '$(IsUwp)' != 'true'" Text="Projects cannot reference Windows UI XAML if they're not targeting UWP." /> |
| 85 | + <Error Condition="'$(HasWindowsUIXaml)' == 'false' AND '$(IsUwp)' == 'true' AND '$(MultiTargetPlatformIdentifier)' != 'windows'" Text="Projects cannot disabl Windows UI XAML if they're targeting legacy UWP." /> |
| 86 | + </Target> |
74 | 87 | </Project>
|
0 commit comments