-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Centralize relationship of UseMaui* MSBuild properties
When the UseMaui MSBuild property is true this implies UseMauiAssets and UseMauiCore are also true, and UseMauiCore implies UseMauiEssentials. Codify this relationship explicitly in the workload targets so conditions elsewhere in the targets only have to check one of these properties rather than implicitly redefining this relationship. Note that UseMauiEssentials currently causes all of the controls build targets to be imported as they do some generic stuff (e.g. SingleProject). Ideally these would be separated out so they could be imported independently.
- Loading branch information
Showing
3 changed files
with
28 additions
and
13 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 |
---|---|---|
@@ -1,29 +1,33 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<!-- allow more explicit intent on conditions that bring in controls --> | ||
<_UseMauiControls Condition="'$(UseMaui)'=='true'">true</_UseMauiControls> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' "> | ||
<FrameworkReference | ||
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' " | ||
Condition="'$(UseMauiCore)' == 'true'" | ||
Include="Microsoft.Maui.Extensions" | ||
IsImplicitlyDefined="true" | ||
Pack="false" | ||
PrivateAssets="All" | ||
/> | ||
<FrameworkReference | ||
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' " | ||
Condition="'$(UseMauiCore)' == 'true'" | ||
Include="Microsoft.Maui.Core" | ||
IsImplicitlyDefined="true" | ||
Pack="false" | ||
PrivateAssets="All" | ||
/> | ||
<FrameworkReference | ||
Condition=" '$(UseMaui)' == 'true' " | ||
Condition="'$(_UseMauiControls)' == 'true'" | ||
Include="Microsoft.Maui.Controls" | ||
IsImplicitlyDefined="true" | ||
Pack="false" | ||
PrivateAssets="All" | ||
/> | ||
<FrameworkReference | ||
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiEssentials)' == 'true' " | ||
Condition="'$(UseMauiEssentials)' == 'true'" | ||
Include="Microsoft.Maui.Essentials" | ||
IsImplicitlyDefined="true" | ||
Pack="false" | ||
|
@@ -32,6 +36,11 @@ | |
</ItemGroup> | ||
|
||
<Import Project="../targets/BundledVersions.targets" /> | ||
<Import Project="Microsoft.Maui.Controls.Sdk.targets" Condition=" '$(UseMaui)' == 'true' " /> | ||
<!-- | ||
these targets currently bring in a mixture of controls logic (xamlc, default xaml items etc) and generic logic (singleproject) | ||
they should really be split up and conditioned separately so projects can get singleproject logic without all the controls stuff. | ||
perhaps singleproject should be a UseSingleProject that works by itself? | ||
--> | ||
<Import Project="Microsoft.Maui.Controls.Sdk.targets" Condition="'$(UseMauiEssentials)' == 'true'" /> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mhutch
Author
Member
|
||
|
||
</Project> |
10 changes: 8 additions & 2 deletions
10
src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.targets
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,10 +1,16 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<!-- UseMaui implies UseMauiAssets and UseMauiCore, and UseMauiCore implies UseMauiEssentials. --> | ||
<UseMauiCore Condition="'$(UseMaui)'=='true'">true</UseMauiCore> | ||
<UseMauiAssets Condition="'$(UseMaui)'=='true'">true</UseMauiAssets> | ||
<UseMauiEssentials Condition="'$(UseMauiCore)'=='true'">true</UseMauiEssentials> | ||
</PropertyGroup> | ||
<Import | ||
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' or '$(UseMauiEssentials)' == 'true' " | ||
Condition="'$(UseMauiEssentials)' == 'true'" | ||
Project="Sdk.targets" Sdk="Microsoft.Maui.Controls.Sdk" | ||
/> | ||
<Import | ||
Condition=" '$(UseMaui)' == 'true' or '$(UseMauiAssets)' == 'true' " | ||
Condition="'$(UseMauiAssets)' == 'true'" | ||
Project="Sdk.targets" Sdk="Microsoft.Maui.Resizetizer.Sdk" | ||
/> | ||
</Project> |
I do think the targets need to be split up.
$(UseMauiEssentials)
doesn't really use any MSBuild targets, so maybe you have to put$(UseMaui)
here until they are split up?So far I took the approach of taking what they had and got it to the point it works...