Skip to content

Commit

Permalink
Merge pull request #237 from CommunityToolkit/multitarget/enabled-tar…
Browse files Browse the repository at this point in the history
…getframework-overrides

Rewired "Available" vs "Enabled" MultiTargets and TargetFrameworks
  • Loading branch information
Arlodotexe authored Dec 23, 2024
2 parents 83dff9f + 2929e6d commit 5a12e3d
Show file tree
Hide file tree
Showing 20 changed files with 137 additions and 169 deletions.
8 changes: 4 additions & 4 deletions Build-Toolkit-Components.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ Param (
[switch]$Verbose
)

# Use the specified MultiTarget TFM and WinUI version
& $PSScriptRoot\MultiTarget\UseUnoWinUI.ps1 $WinUIMajorVersion
& $PSScriptRoot\MultiTarget\UseTargetFrameworks.ps1 -MultiTargets $MultiTargets -ExcludeMultiTargets $ExcludeMultiTargets

if ($MultiTargets -eq 'all') {
$MultiTargets = @('wasm', 'uwp', 'wasdk', 'wpf', 'linuxgtk', 'macos', 'ios', 'android', 'netstandard')
}
Expand Down Expand Up @@ -128,10 +132,6 @@ if ($ExcludeComponents) {
$Components = $Components | Where-Object { $_ -notin $ExcludeComponents }
}

# Use the specified MultiTarget TFM and WinUI version
& $PSScriptRoot\MultiTarget\UseTargetFrameworks.ps1 $MultiTargets
& $PSScriptRoot\MultiTarget\UseUnoWinUI.ps1 $WinUIMajorVersion

function Invoke-MSBuildWithBinlog {
param (
[string]$TargetHeadPath
Expand Down
18 changes: 18 additions & 0 deletions MultiTarget/AvailableMultiTargets.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<!-- Imports the <MultiTarget> values for the current project. -->
<PropertyGroup>
<MultiTargetIsSampleProject Condition="$(MSBuildProjectName.EndsWith('.Samples')) == 'true'">true</MultiTargetIsSampleProject>
</PropertyGroup>

<Import Project="$(MSBuildProjectDirectory)\MultiTarget.props" Condition="Exists('$(MSBuildProjectDirectory)\MultiTarget.props') AND '$(MultiTarget)' == ''" />

<!-- If in a sample project, pull the MultiTarget settings from the source project. -->
<!-- This behavior is also implemented in GeneratedAllProjectReferences.ps1 for <ProjectReference> generation. -->
<Import Project="$(MSBuildProjectDirectory)/../src/MultiTarget.props" Condition="$(MultiTargetIsSampleProject) == 'true' AND !Exists('$(MSBuildProjectDirectory)\MultiTarget.props') AND Exists('$(MSBuildProjectDirectory)/../src/MultiTarget.props') AND '$(MultiTarget)' == ''" />

<Import Project="$(MSBuildThisFileDirectory)\Defaults.props" Condition="'$(MultiTarget)' == ''" />

<PropertyGroup>
<AvailableMultiTargets>$(AvailableMultiTargets);$(MultiTarget)</AvailableMultiTargets>
</PropertyGroup>
</Project>
25 changes: 16 additions & 9 deletions MultiTarget/AvailableTargetFrameworks.props
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
<Project>
<!--
Defines the TargetFrameworks available to each MultiTarget.
Can be overridden by the user to enable / disable individual TargetFramworks per MultiTarget.
Does not define the EnabledTargetFrameworks, which are used to build the project.
-->
<PropertyGroup>
<!-- See https://github.com/CommunityToolkit/Tooling-Windows-Submodule/pull/235#issuecomment-2530131559 -->
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == '' AND '$(BuildingInsideVisualStudio)' == 'true'">uap10.0.17763;</UwpTargetFramework>
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == '' AND '$(BuildingInsideVisualStudio)' != 'true'">uap10.0.17763;net8.0-windows10.0.26100.0;</UwpTargetFramework>
<WinAppSdkTargetFramework Condition="'$(WinAppSdkTargetFramework)' == ''">net9.0-windows10.0.19041.0;net8.0-windows10.0.19041.0;</WinAppSdkTargetFramework>
<UwpTargetFrameworks Condition="'$(UwpTargetFrameworks)' == '' AND '$(BuildingInsideVisualStudio)' == 'true'">uap10.0.17763;</UwpTargetFrameworks>

<!-- We also include 'net9.0-windows10.0.26100.0' explicitly for UWP as a workaround for https://github.com/CommunityToolkit/Tooling-Windows-Submodule/issues/238 -->
<UwpTargetFrameworks Condition="'$(UwpTargetFrameworks)' == '' AND '$(BuildingInsideVisualStudio)' != 'true'">uap10.0.17763;net8.0-windows10.0.26100.0;net9.0-windows10.0.26100.0;</UwpTargetFrameworks>
<WinAppSdkTargetFrameworks Condition="'$(WinAppSdkTargetFrameworks)' == ''">net9.0-windows10.0.19041.0;net8.0-windows10.0.19041.0;</WinAppSdkTargetFrameworks>

<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net9.0;</WasmHeadTargetFramework>
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net9.0;</LinuxHeadTargetFramework>
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net9.0;</WpfHeadTargetFramework>

<AndroidLibTargetFramework Condition="'$(AndroidLibTargetFramework)' == ''">net9.0-android;</AndroidLibTargetFramework>
<MacOSLibTargetFramework Condition="'$(MacOSLibTargetFramework)' == ''">net9.0-maccatalyst;</MacOSLibTargetFramework>
<iOSLibTargetFramework Condition="'$(iOSLibTargetFramework)' == ''">net9.0-ios;</iOSLibTargetFramework>
<AndroidLibTargetFrameworks Condition="'$(AndroidLibTargetFrameworks)' == ''">net9.0-android;</AndroidLibTargetFrameworks>
<MacOSLibTargetFrameworks Condition="'$(MacOSLibTargetFrameworks)' == ''">net9.0-maccatalyst;</MacOSLibTargetFrameworks>
<iOSLibTargetFrameworks Condition="'$(iOSLibTargetFrameworks)' == ''">net9.0-ios;</iOSLibTargetFrameworks>

<!-- Used for comparison to current TargetFramework -->
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net9.0;</LinuxLibTargetFramework>
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net9.0;</WasmLibTargetFramework>
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net9.0;</WpfLibTargetFramework>
<LinuxLibTargetFrameworks Condition="'$(LinuxLibTargetFrameworks)' == ''">net9.0;</LinuxLibTargetFrameworks>
<WasmLibTargetFrameworks Condition="'$(WasmLibTargetFrameworks)' == ''">net9.0;</WasmLibTargetFrameworks>
<WpfLibTargetFrameworks Condition="'$(WpfLibTargetFrameworks)' == ''">net9.0;</WpfLibTargetFrameworks>

<!-- Used for defining TargetFramework under platforms that need it -->
<DotnetStandardCommonTargetFramework Condition="'$(DotnetStandardCommonTargetFramework)' == ''">netstandard2.0</DotnetStandardCommonTargetFramework>
Expand Down
13 changes: 3 additions & 10 deletions MultiTarget/EnabledMultiTargets.props
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<!-- Imports the <MultiTarget> values for the current project. -->
<Project>
<!--Indicates which MultiTargets are enabled via UseTargetFrameworks script. -->
<!-- Do not commit changes made to default values by tooling. -->
<PropertyGroup>
<MultiTargetIsSampleProject Condition="$(MSBuildProjectName.EndsWith('.Samples')) == 'true'">true</MultiTargetIsSampleProject>
<EnabledMultiTargets>wasm;uwp;netstandard</EnabledMultiTargets>
</PropertyGroup>

<Import Project="$(MSBuildProjectDirectory)\MultiTarget.props" Condition="Exists('$(MSBuildProjectDirectory)\MultiTarget.props') AND '$(MultiTarget)' == ''" />

<!-- If in a sample project, pull the MultiTarget settings from the source project. -->
<!-- This behavior is also implemented in GeneratedAllProjectReferences.ps1 for <ProjectReference> generation. -->
<Import Project="$(MSBuildProjectDirectory)/../src/MultiTarget.props" Condition="$(MultiTargetIsSampleProject) == 'true' AND !Exists('$(MSBuildProjectDirectory)\MultiTarget.props') AND Exists('$(MSBuildProjectDirectory)/../src/MultiTarget.props') AND '$(MultiTarget)' == ''" />

<Import Project="$(MSBuildThisFileDirectory)\Defaults.props" Condition="'$(MultiTarget)' == ''" />
</Project>
45 changes: 23 additions & 22 deletions MultiTarget/EnabledTargetFrameworks.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
<Project>
<PropertyGroup>
<!-- See https://github.com/CommunityToolkit/Tooling-Windows-Submodule/pull/235#issuecomment-2530131559 -->
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == '' AND '$(BuildingInsideVisualStudio)' == 'true'">uap10.0.17763;</UwpTargetFramework>
<UwpTargetFramework Condition="'$(UwpTargetFramework)' == '' AND '$(BuildingInsideVisualStudio)' != 'true'">uap10.0.17763;net8.0-windows10.0.26100.0;</UwpTargetFramework>


<WasmHeadTargetFramework Condition="'$(WasmHeadTargetFramework)' == ''">net9.0;</WasmHeadTargetFramework>
<LinuxHeadTargetFramework Condition="'$(LinuxHeadTargetFramework)' == ''">net9.0;</LinuxHeadTargetFramework>
<WpfHeadTargetFramework Condition="'$(WpfHeadTargetFramework)' == ''">net9.0;</WpfHeadTargetFramework>




<Project>
<PropertyGroup>
<!--
MultiTarget is a custom property that indicates which target a project is designed to be built for / run on.
Used to create project references, generate solution files, enable/disable TargetFrameworks, and build nuget packages.
AvailableMultiTargets is a list of all possible MultiTargets that a project can be built for.
EnabledMultiTargets is an exclusive list of MultiTargets that should be built, and can be customized by the user via global property.
-->
<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('uwp')) == 'true' AND $(AvailableMultiTargets.Contains('uwp')) == 'true'">$(TargetFrameworks);$(UwpTargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('wasdk')) == 'true' AND $(AvailableMultiTargets.Contains('wasdk')) == 'true'">$(TargetFrameworks);$(WinAppSdkTargetFrameworks)</TargetFrameworks>

<!-- Used for comparison to current TargetFramework -->
<LinuxLibTargetFramework Condition="'$(LinuxLibTargetFramework)' == ''">net9.0;</LinuxLibTargetFramework>
<WasmLibTargetFramework Condition="'$(WasmLibTargetFramework)' == ''">net9.0;</WasmLibTargetFramework>
<WpfLibTargetFramework Condition="'$(WpfLibTargetFramework)' == ''">net9.0;</WpfLibTargetFramework>
<!--
TargetFrameworks for WasmLibTargetFrameworks, WpfLibTargetFrameworks, and LinuxLibTargetFrameworks all use the same value.
Duplicate values can't be removed during the evaluation phase without breaking things, so we use a single value for all that need it.
-->
<IsNetCommonMultiTargetEnabled Condition="$(EnabledMultiTargets.Contains('wasm')) == 'true' OR $(EnabledMultiTargets.Contains('wpf')) == 'true' OR $(EnabledMultiTargets.Contains('linuxgtk')) == 'true'">true</IsNetCommonMultiTargetEnabled>
<IsNetCommonMultiTargetAvailable Condition="$(AvailableMultiTargets.Contains('wasm')) == 'true' OR $(AvailableMultiTargets.Contains('wpf')) == 'true' OR $(AvailableMultiTargets.Contains('linuxgtk')) == 'true'">true</IsNetCommonMultiTargetAvailable>
<TargetFrameworks Condition="$(IsNetCommonMultiTargetEnabled) == 'true' AND $(IsNetCommonMultiTargetAvailable) == 'true'">$(TargetFrameworks);$(DotnetCommonTargetFramework)</TargetFrameworks>

<!-- Used for defining TargetFramework under platforms that need it -->
<DotnetStandardCommonTargetFramework Condition="'$(DotnetStandardCommonTargetFramework)' == ''">netstandard2.0</DotnetStandardCommonTargetFramework>
<DotnetCommonTargetFramework Condition="'$(DotnetCommonTargetFramework)' == ''">net9.0;</DotnetCommonTargetFramework>
</PropertyGroup>
<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('macos')) == 'true' AND $(AvailableMultiTargets.Contains('macos')) == 'true'">$(TargetFrameworks);$(MacOSLibTargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('ios')) == 'true' AND $(AvailableMultiTargets.Contains('ios')) == 'true'">$(TargetFrameworks);$(iOSLibTargetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('android')) == 'true' AND $(AvailableMultiTargets.Contains('android')) == 'true'">$(TargetFrameworks);$(AndroidLibTargetFrameworks)</TargetFrameworks>

<TargetFrameworks Condition="$(EnabledMultiTargets.Contains('netstandard')) == 'true' AND $(AvailableMultiTargets.Contains('netstandard')) == 'true'">$(TargetFrameworks);$(DotnetStandardCommonTargetFramework)</TargetFrameworks>
</PropertyGroup>
</Project>
9 changes: 5 additions & 4 deletions MultiTarget/Library.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<IsDeployableHead>false</IsDeployableHead>
</PropertyGroup>

<!-- Get the enabled MultiTarget features for this project / run -->
<!-- Get this project's declared (available to enable) MultiTargets -->
<!-- Use <MultiTarget> values to define <TargetFrameworks> -->
<Import Project="$(ToolingDirectory)\MultiTarget\AvailableTargetFrameworks.props" />
<Import Project="$(ToolingDirectory)\MultiTarget\AvailableMultiTargets.props" />
<Import Project="$(ToolingDirectory)\MultiTarget\EnabledMultiTargets.props" />
<Import Project="$(ToolingDirectory)\MultiTarget\EnabledTargetFrameworks.props" />
<Import Project="$(ToolingDirectory)\MultiTarget\WinUI.TargetVersion.props" />

<!-- Use <MultiTarget> values to define <TargetFrameworks> -->
<Import Project="$(ToolingDirectory)\MultiTarget\MultiTargetToTargetFramework.props" />
<Import Project="$(ToolingDirectory)\MultiTarget\WinUI.TargetVersion.props" />

<!-- Enable project identifiers -->
<Import Project="$(ToolingDirectory)\MultiTarget\MultiTargetIdentifiers.props" />
Expand Down
41 changes: 23 additions & 18 deletions MultiTarget/MultiTargetIdentifiers.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@
</PropertyGroup>

<PropertyGroup>
<MultiTargetsWasm Condition="$(MultiTarget.Contains('wasm')) == 'true'">true</MultiTargetsWasm>
<MultiTargetsWpf Condition="$(MultiTarget.Contains('wpf')) == 'true'">true</MultiTargetsWpf>
<MultiTargetsLinuxGtk Condition="$(MultiTarget.Contains('linuxgtk')) == 'true'">true</MultiTargetsLinuxGtk>
<MultiTargetsDroid Condition="$(MultiTarget.Contains('android')) == 'true'">true</MultiTargetsDroid>
<MultiTargetsMacOS Condition="$(MultiTarget.Contains('macos')) == 'true'">true</MultiTargetsMacOS>
<MultiTargetsiOS Condition="$(MultiTarget.Contains('ios')) == 'true'">true</MultiTargetsiOS>
<MultiTargetsUwp Condition="$(MultiTarget.Contains('uwp')) == 'true'">true</MultiTargetsUwp>
<MultiTargetsWasdk Condition="$(MultiTarget.Contains('wasdk')) == 'true'">true</MultiTargetsWasdk>
<MultiTargetsNetstandard Condition="$(MultiTarget.Contains('netstandard')) == 'true'">true</MultiTargetsNetstandard>
<MultiTargetsWasm Condition="$(AvailableMultiTargets.Contains('wasm')) == 'true'">true</MultiTargetsWasm>
<MultiTargetsWpf Condition="$(AvailableMultiTargets.Contains('wpf')) == 'true'">true</MultiTargetsWpf>
<MultiTargetsLinuxGtk Condition="$(AvailableMultiTargets.Contains('linuxgtk')) == 'true'">true</MultiTargetsLinuxGtk>
<MultiTargetsDroid Condition="$(AvailableMultiTargets.Contains('android')) == 'true'">true</MultiTargetsDroid>
<MultiTargetsMacOS Condition="$(AvailableMultiTargets.Contains('macos')) == 'true'">true</MultiTargetsMacOS>
<MultiTargetsiOS Condition="$(AvailableMultiTargets.Contains('ios')) == 'true'">true</MultiTargetsiOS>
<MultiTargetsUwp Condition="$(AvailableMultiTargets.Contains('uwp')) == 'true'">true</MultiTargetsUwp>
<MultiTargetsWasdk Condition="$(AvailableMultiTargets.Contains('wasdk')) == 'true'">true</MultiTargetsWasdk>
<MultiTargetsNetstandard Condition="$(AvailableMultiTargets.Contains('netstandard')) == 'true'">true</MultiTargetsNetstandard>

<IsWasmHead Condition="$(IsDeployableHead) == 'true' AND '$(IsWasmHead)' == '' AND $(WasmHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(WasmHeadTargetFramework)' != ''">true</IsWasmHead>
<IsWasmLib Condition="'$(IsWasmLib)' == '' AND $(WasmHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(MultiTargetsWasm)' == 'true' AND '$(WasmLibTargetFramework)' != ''">true</IsWasmLib>
<IsWasmLib Condition="'$(IsWasmLib)' == '' AND $(WasmHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(MultiTargetsWasm)' == 'true' AND '$(WasmLibTargetFrameworks)' != ''">true</IsWasmLib>
<IsWasm Condition="'$(IsWasm)' == '' AND ('$(IsWasmHead)' == 'true' or '$(IsWasmLib)' == 'true')">true</IsWasm>

<IsWpfHead Condition="$(IsDeployableHead) == 'true' AND '$(IsWpfHead)' == '' AND $(WpfHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(WpfHeadTargetFramework)' != ''">true</IsWpfHead>
<IsWpfLib Condition="'$(IsWpfLib)' == '' AND $(WpfLibTargetFramework.Contains('$(TargetFramework);')) AND '$(WpfLibTargetFramework)' != '' AND '$(MultiTargetsWpf)' == 'true'">true</IsWpfLib>
<IsWpfLib Condition="'$(IsWpfLib)' == '' AND $(WpfLibTargetFrameworks.Contains('$(TargetFramework);')) AND '$(WpfLibTargetFrameworks)' != '' AND '$(MultiTargetsWpf)' == 'true'">true</IsWpfLib>
<IsWpf Condition="'$(IsWpf)' == '' AND ('$(IsWpfHead)' == 'true' or '$(IsWpfLib)' == 'true')">true</IsWpf>

<IsGtkHead Condition="$(IsDeployableHead) == 'true' AND '$(IsGtkHead)' == '' AND $(LinuxHeadTargetFramework.Contains('$(TargetFramework);')) AND '$(LinuxHeadTargetFramework)' != ''">true</IsGtkHead>
<IsGtkLib Condition="'$(IsGtkLib)' == '' AND $(LinuxLibTargetFramework.Contains('$(TargetFramework);')) AND '$(LinuxLibTargetFramework)' != '' AND '$(MultiTargetsLinuxGtk)' == 'true'">true</IsGtkLib>
<IsGtkLib Condition="'$(IsGtkLib)' == '' AND $(LinuxLibTargetFrameworks.Contains('$(TargetFramework);')) AND '$(LinuxLibTargetFrameworks)' != '' AND '$(MultiTargetsLinuxGtk)' == 'true'">true</IsGtkLib>
<IsGtk Condition="'$(IsGtk)' == '' AND ('$(IsGtkHead)' == 'true' or '$(IsGtkLib)' == 'true')">true</IsGtk>

<IsUwp Condition="'$(IsUwp)' == '' AND $(UwpTargetFramework.Contains('$(TargetFramework);')) AND '$(UwpTargetFramework)' != '' AND '$(MultiTargetsUwp)' == 'true'">true</IsUwp>
<IsWinAppSdk Condition="'$(IsWinAppSdk)' == '' AND $(WinAppSdkTargetFramework.Contains('$(TargetFramework);')) AND '$(WinAppSdkTargetFramework)' != '' AND '$(MultiTargetsWasdk)' == 'true'">true</IsWinAppSdk>
<IsUwp Condition="'$(IsUwp)' == '' AND $(UwpTargetFrameworks.Contains('$(TargetFramework);')) AND '$(UwpTargetFrameworks)' != '' AND '$(MultiTargetsUwp)' == 'true'">true</IsUwp>
<IsWinAppSdk Condition="'$(IsWinAppSdk)' == '' AND $(WinAppSdkTargetFrameworks.Contains('$(TargetFramework);')) AND '$(WinAppSdkTargetFrameworks)' != '' AND '$(MultiTargetsWasdk)' == 'true'">true</IsWinAppSdk>

<MultiTargetPlatformIdentifier Condition="'$(MultiTargetPlatformIdentifier)' == ''">$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</MultiTargetPlatformIdentifier>

<IsDroid Condition="'$(IsDroid)' == '' AND $(AndroidLibTargetFramework.Contains('$(TargetFramework);')) AND '$(AndroidLibTargetFramework)' != '' AND '$(MultiTargetsDroid)' == 'true'">true</IsDroid>
<IsMacOS Condition="'$(IsMacOS)' == '' AND $(MacOSLibTargetFramework.Contains('$(TargetFramework);')) AND '$(MacOSLibTargetFramework)' != '' AND '$(MultiTargetsMacOS)' == 'true'">true</IsMacOS>
<IsiOS Condition="'$(IsiOS)' == '' AND $(iOSLibTargetFramework.Contains('$(TargetFramework);')) AND '$(iOSLibTargetFramework)' != '' AND '$(MultiTargetsiOS)' == 'true'">true</IsiOS>
<IsDroid Condition="'$(IsDroid)' == '' AND $(AndroidLibTargetFrameworks.Contains('$(TargetFramework);')) AND '$(AndroidLibTargetFrameworks)' != '' AND '$(MultiTargetsDroid)' == 'true'">true</IsDroid>
<IsMacOS Condition="'$(IsMacOS)' == '' AND $(MacOSLibTargetFrameworks.Contains('$(TargetFramework);')) AND '$(MacOSLibTargetFrameworks)' != '' AND '$(MultiTargetsMacOS)' == 'true'">true</IsMacOS>
<IsiOS Condition="'$(IsiOS)' == '' AND $(iOSLibTargetFrameworks.Contains('$(TargetFramework);')) AND '$(iOSLibTargetFrameworks)' != '' AND '$(MultiTargetsiOS)' == 'true'">true</IsiOS>
<IsNetstandard Condition="'$(IsNetstandard)' == '' AND $(DotnetStandardCommonTargetFramework.Contains('$(TargetFramework);')) AND '$(MultiTargetsNetstandard)' == 'true'">true</IsNetstandard>

<IsUno Condition="'$(IsWasm)' == 'true' OR '$(IsWpf)' == 'true' OR '$(IsGtk)' == 'true' OR '$(IsDroid)' == 'true' OR '$(IsMacOS)' == 'true' OR '$(IsiOS)' == 'true'">true</IsUno>
Expand All @@ -64,6 +64,11 @@
<HasWinUI Condition="'$(HasWinUI)' == '' AND '$(WinUIMajorVersion)' == '2' AND '$(HasWinUI2)' == 'false'">false</HasWinUI>
<HasWinUI Condition="'$(HasWinUI)' == '' AND ('$(IsUwp)' == 'true' OR '$(IsWinAppSdk)' == 'true' OR '$(IsUno)' == 'true')">true</HasWinUI>

<UseUwp Condition="'$(HasWinUI)' == 'true' AND '$(IsUwp)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows'">true</UseUwp>
<!--
The 'UseUwp' property tells the .NET SDK to add a framework reference for the 'Microsoft.Windows.UI.Xaml.dll' assembly, which allows
.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
UWP projects that have 'windows' as identifier (i.e. they are not 'UAP' projects, which is legacy UWP), regardless of WinUI.
-->
<UseUwp Condition="'$(IsUwp)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows'">true</UseUwp>
</PropertyGroup>
</Project>
Loading

0 comments on commit 5a12e3d

Please sign in to comment.