-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewired and cleaned up "Available" vs "Enabled" MultiTargets and Targ…
…etFrameworks. Lifted TFM toggling above TFM declarations into MultiTarget system, enables overriding "Available" TargetFrameworks properly per-project.
- Loading branch information
1 parent
83dff9f
commit 7036724
Showing
13 changed files
with
105 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.