-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare MAUI to support building with NuGets (#11946)
* Prepare MAUI to support building with NuGets * Exclude resizetizer when UseMauiNuGets=True
- Loading branch information
1 parent
962802d
commit 8d3ada2
Showing
3 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
src/Workload/Microsoft.Maui.Sdk/Sdk/Microsoft.Maui.NuGets.Sdk.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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<Project> | ||
|
||
<!-- | ||
Most of these properties and items are found in other places and we _could_ reuse and modify targets. | ||
But, in an effort to not change to many things that already work, the NuGet support is duplicating a few | ||
of the elements here. Not only is this OK, but in the later service releases and then in .NET 8+, all | ||
of this goes away. | ||
--> | ||
|
||
<!-- NOTE: These items are found in .nuspec\Microsoft.Maui.Controls.SingleProject.props --> | ||
<PropertyGroup Condition=" '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' "> | ||
<!-- All Windows apps require WinExe --> | ||
<OutputType Condition="'$(OutputType)' == 'Exe'">WinExe</OutputType> | ||
<!-- Generate ReadyToRun (AOT) when building for Release --> | ||
<PublishReadyToRun Condition=" '$(PublishReadyToRun)' == '' and '$(Configuration)' == 'Release' and '$(OutputType)' == 'WinExe' ">true</PublishReadyToRun> | ||
</PropertyGroup> | ||
|
||
<!-- NOTE: These items are found in .nuspec\Microsoft.Maui.Controls.SingleProject.props --> | ||
<!-- The Windows App SDK does not support AnyCPU without a RID, so make sure we pick the "best" one we can --> | ||
<PropertyGroup Condition=" '$(SingleProject)' == 'true' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' "> | ||
<_SingleProjectRIDRequired Condition="'$(OutputType)' == 'WinExe'">true</_SingleProjectRIDRequired> | ||
<_SingleProjectRIDSpecified Condition="'$(RuntimeIdentifier)' != '' or '$(RuntimeIdentifiers)' != ''">true</_SingleProjectRIDSpecified> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(SingleProject)' == 'true' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' and '$(_SingleProjectRIDRequired)' == 'true' and '$(_SingleProjectRIDSpecified)' != 'true' "> | ||
<_SingleProjectHostArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)</_SingleProjectHostArchitecture> | ||
<_SingleProjectHostArchitecture>$(_SingleProjectHostArchitecture.ToLower())</_SingleProjectHostArchitecture> | ||
<RuntimeIdentifier>win10-$(_SingleProjectHostArchitecture)</RuntimeIdentifier> | ||
<_MauiUsingDefaultRuntimeIdentifier>true</_MauiUsingDefaultRuntimeIdentifier> | ||
</PropertyGroup> | ||
|
||
|
||
<!-- Import any platform-specific targets files that set defaults --> | ||
<Import Project="$(MicrosoftMauiSdkPlatformTargets)" Condition="'$(MicrosoftMauiSdkPlatformTargets)' != ''" /> | ||
|
||
|
||
<!-- NOTE: These items are found in .src\Workload\Microsoft.Maui.Sdk\Sdk\Microsoft.Maui.Sdk.After.targets --> | ||
<!-- .NET MAUI features --> | ||
<ItemGroup> | ||
<ProjectCapability Include="Maui" /> | ||
<ProjectCapability Include="MauiAssets" /> | ||
<ProjectCapability Include="MauiBlazor" Condition=" '$(UsingMicrosoftNETSdkRazor)' == 'true' " /> | ||
<ProjectCapability Include="MauiCore" /> | ||
<ProjectCapability Include="MauiEssentials" /> | ||
</ItemGroup> | ||
|
||
<!-- NOTE: These items are found in .nuspec\Microsoft.Maui.Controls.SingleProject.targets --> | ||
<!-- SingleProject-specific features --> | ||
<ItemGroup Condition=" '$(SingleProject)' == 'true' "> | ||
<ProjectCapability Include="Msix" /> | ||
<ProjectCapability Include="MauiSingleProject" /> | ||
<ProjectCapability Include="LaunchProfiles" /> | ||
<!-- If VS is older than Dev17 --> | ||
<ProjectCapability Include="XamarinStaticLaunchProfiles" Condition=" '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' < '17.0' " /> | ||
<!-- Otherwise define LaunchProfilesGroupByPlatformFilters by default --> | ||
<ProjectCapability Include="LaunchProfilesGroupByPlatformFilters" Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' >= '17.0' " /> | ||
<ProjectCapability Include="SingleTargetBuildForStartupProjects" Condition=" '$(EnableSingleTargetBuildForStartupProjects)' != 'false' " /> | ||
</ItemGroup> | ||
|
||
</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