Skip to content

Commit

Permalink
Move some of the require props into Core (#6767)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow authored May 5, 2022
1 parent d82da03 commit 306a7fc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 0 additions & 4 deletions .nuspec/Microsoft.Maui.Controls.SingleProject.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

<PropertyGroup Condition=" '$(SingleProject)' == 'true' and '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' ">
<OutputType Condition="'$(OutputType)' == 'Exe'">WinExe</OutputType>
<EnableMsixTooling Condition="'$(EnableMsixTooling)' == ''">true</EnableMsixTooling>
<EnablePreviewMsixTooling Condition="'$(EnablePreviewMsixTooling)' == ''">$(EnableMsixTooling)</EnablePreviewMsixTooling>
<WindowsPackageType Condition=" '$(WindowsPackageType)' == '' and '$(EnableMsixTooling)' == 'true' and ('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe') ">MSIX</WindowsPackageType>
<WinUISDKReferences Condition=" '$(WinUISDKReferences)' == '' and '$(EnableMsixTooling)' == 'true' and ('$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe') ">false</WinUISDKReferences>
<GenerateLibraryLayout Condition=" '$(GenerateLibraryLayout)' == '' and '$(EnableMsixTooling)' == 'true' and '$(OutputType)' != 'Exe' and '$(OutputType)' != 'WinExe' ">true</GenerateLibraryLayout>
<WindowsAppSdkBootstrapInitialize Condition=" '$(WindowsAppSdkBootstrapInitialize)' == '' and '$(EnableMsixTooling)' == 'true' and '$(OutputType)' != 'Exe' and '$(OutputType)' != 'WinExe' ">false</WindowsAppSdkBootstrapInitialize>
<PublishAppXPackage Condition=" '$(PublishAppXPackage)' == '' and '$(EnableMsixTooling)' == 'true' and '$(WindowsPackageType)' == 'MSIX' ">true</PublishAppXPackage>
<_SingleProjectRIDRequired Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">true</_SingleProjectRIDRequired>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
<MSBuildWarningsAsMessages Condition=" '$(TargetPlatformIdentifier)' == 'Android' ">$(MSBuildWarningsAsMessages);XA4218</MSBuildWarningsAsMessages>
</PropertyGroup>

<Import Project="WinUI.targets" Condition=" '$(TargetPlatformIdentifier)' == 'windows' " />
<!--
This double check seems excessive, but importing the WinUI.targets when building for windows is not
sufficient. The WASDK targets assume everything is WinUI and thus just passes along the TFM of the app.
As a result, if you have a net6.0 class library, the app will call MSBuild on that library - with the Windows TFM!
This results in the $(TargetPlatformIdentifier) condition being met - even though there are no WASK targets to run!
-->
<Import Project="WinUI.targets" Condition=" '$(TargetPlatformIdentifier)' == 'windows' and '$(WindowsAppSDKWinUI)' == 'true'" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
<UsingMicrosoftMauiCoreSdk>true</UsingMicrosoftMauiCoreSdk>
</PropertyGroup>

<!-- Set some property defaults that MAUI requires - especially for dotnet build to work -->
<PropertyGroup Condition=" '$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'windows' ">
<EnableMsixTooling Condition=" '$(EnableMsixTooling)' == '' ">true</EnableMsixTooling>
<EnablePreviewMsixTooling Condition=" '$(EnablePreviewMsixTooling)' == '' ">$(EnableMsixTooling)</EnablePreviewMsixTooling>
<GenerateLibraryLayout Condition=" '$(GenerateLibraryLayout)' == '' and '$(EnableMsixTooling)' == 'true' and '$(OutputType)' != 'Exe' and '$(OutputType)' != 'WinExe' ">true</GenerateLibraryLayout>
<WinUISDKReferences Condition=" '$(WinUISDKReferences)' == '' and '$(EnableMsixTooling)' == 'true' ">false</WinUISDKReferences>
</PropertyGroup>

<!-- Imported last -->
<PropertyGroup>
<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)Microsoft.Maui.Core.Sdk.After.targets</AfterMicrosoftNETSdkTargets>
Expand Down
2 changes: 1 addition & 1 deletion src/Workload/Microsoft.Maui.Sdk/Sdk/WinUI.NetCore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@

</Target>

<Target Name="GetPriOutputs"
<Target Name="GetPriOutputs"
Condition="'$(AppxGeneratePriEnabled)'=='true'"
Returns="@(PriOutputs);@(ProjectPriFile)"
DependsOnTargets="$(GetPriOutputsDependsOn)">
Expand Down

0 comments on commit 306a7fc

Please sign in to comment.