12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?xml version="1.0" encoding="utf-8"?>
- <!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
- <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- Check TargetPlatformMinVersion during build to block unsupported configurations. -->
- <Target Name="MicrosoftUIXamlCheckTargetPlatformVersion" BeforeTargets="PrepareForBuild"
- Condition="'$(TargetPlatformVersion)' != '' and '$(TargetPlatformMinVersion)' != '' and '$(SkipMicrosoftUIXamlCheckTargetPlatformVersion)'==''">
- <PropertyGroup>
- <MicrosoftUIXamlTargetPlatformMinCheckValue>$([System.Version]::Parse('$(TargetPlatformMinVersion)').Build)</MicrosoftUIXamlTargetPlatformMinCheckValue>
- </PropertyGroup>
- <Error
- Text="Microsoft.UI.Xaml nuget package requires TargetPlatformMinVersion >= 10.0.17763.0 (current project is $(MicrosoftUIXamlTargetPlatformMinCheckValue))"
- Condition="$(MicrosoftUIXamlTargetPlatformMinCheckValue) < 17763" />
- <PropertyGroup>
- <MicrosoftUIXamlTargetPlatformCheckValue>$([System.Version]::Parse('$(TargetPlatformVersion)').Build)</MicrosoftUIXamlTargetPlatformCheckValue>
- </PropertyGroup>
- <Error
- Text="Microsoft.UI.Xaml nuget package requires TargetPlatformVersion >= 10.0.18362.0 (current project is $(MicrosoftUIXamlTargetPlatformCheckValue))"
- Condition="$(MicrosoftUIXamlTargetPlatformCheckValue) < 18362" />
- </Target>
- <!-- WACK certification requires that types referenced by dependent packages exist in WinMD files in the root of the AppX.
- However, the BuildNativePackage target requires that it *not* be in that location, or else that target will return an error.
- In order to enable apps to pass WACK certification that reference packages that reference us, we'll add it to the package payload
- after that target has completed. -->
- <ItemGroup>
- <XamlWinmd Include="$(MSBuildThisFileDirectory)..\lib\uap10.0\Microsoft.UI.Xaml.winmd">
- <SkipHarvestingWinmdRegistration Condition="'$(MicrosoftUIXamlAppxVersion)' != ''">true</SkipHarvestingWinmdRegistration>
- <TargetPath>Microsoft.UI.Xaml.winmd</TargetPath>
- <OutputGroup>CustomOutputGroupForPackaging</OutputGroup>
- <ProjectName>$(ProjectName)</ProjectName>
- <Implementation Condition="'$(MicrosoftUIXamlAppxVersion)' == ''">Microsoft.UI.Xaml.dll</Implementation>
- </XamlWinmd>
- </ItemGroup>
- <PropertyGroup>
- <XamlWinmdName>Microsoft.UI.Xaml.winmd</XamlWinmdName>
- <XamlCompactXbfName>Microsoft.UI.Xaml\DensityStyles\Compact.xbf</XamlCompactXbfName>
- </PropertyGroup>
- <Target Name="_FixWinmdCopyLocal" AfterTargets="ResolveNuGetPackageAssets">
- <ItemGroup>
- <XamlWinMdCopyLocal Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)' == '$(XamlWinmdName)'" />
- </ItemGroup>
- <ItemGroup Condition="'@(XamlWinMdCopyLocal)' != ''">
- <ReferenceCopyLocalPaths Remove="@(XamlWinMdCopyLocal)" />
- </ItemGroup>
- </Target>
- <Target Name="_FixWinmdPackaging" BeforeTargets="_ComputeAppxPackagePayload">
- <ItemGroup>
- <XamlWinmdPackagingOutput Include="@(PackagingOutputs)" Condition="'%(PackagingOutputs.Filename)%(PackagingOutputs.Extension)' == '$(XamlWinmdName)'" />
- </ItemGroup>
- <ItemGroup Condition="'@(XamlWinmdPackagingOutput)' != ''">
- <PackagingOutputs Remove="@(XamlWinmdPackagingOutput)" />
- </ItemGroup>
- <ItemGroup>
- <PackagingOutputs Include="@(XamlWinmd)" />
- </ItemGroup>
- </Target>
- <Target Name="_RemoveXamlWinmdFromWinMetadataFolder" AfterTargets="BuildNativePackage" BeforeTargets="_AddXamlWinmdToPackageLayoutRoot">
- <ItemGroup>
- <XamlWinmdAppxPackagePayload Include="@(AppxPackagePayload)" Condition="'%(AppxPackagePayload.TargetPath)' == '$(WinMetadataDir)\$(XamlWinmdName)'" />
- <XamlWinmdAppxUploadPackagePayload Include="@(AppxUploadPackagePayload)" Condition="'%(AppxUploadPackagePayload.TargetPath)' == '$(WinMetadataDir)\$(XamlWinmdName)'" />
- </ItemGroup>
- <ItemGroup Condition="'@(XamlWinmdAppxPackagePayload)' != ''">
- <AppxPackagePayload Remove="@(XamlWinmdAppxPackagePayload)" />
- </ItemGroup>
- <ItemGroup Condition="'@(XamlWinmdAppxUploadPackagePayload)' != ''">
- <AppxUploadPackagePayload Remove="@(XamlWinmdAppxUploadPackagePayload)" />
- </ItemGroup>
- </Target>
- <Target Name="_AddXamlWinmdToPackageLayoutRoot" AfterTargets="BuildNativePackage">
- <ItemGroup>
- <AppxPackagePayload Include="@(XamlWinmd)">
- <TargetPath>Microsoft.UI.Xaml.winmd</TargetPath>
- </AppxPackagePayload>
- <AppxUploadPackagePayload Include="@(XamlWinmd)">
- <TargetPath>Microsoft.UI.Xaml.winmd</TargetPath>
- </AppxUploadPackagePayload>
- </ItemGroup>
- <Copy SourceFiles="@(XamlWinmd)" DestinationFiles="@(XamlWinmd -> '$(OutDir)\%(Filename)%(Extension)')" />
- </Target>
- </Project>
|