Skip to content

Commit

Permalink
Adding ProjectCapability generation - attempt #2
Browse files Browse the repository at this point in the history
  • Loading branch information
RBrid committed Mar 22, 2021
1 parent 6655e4c commit c2167df
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
15 changes: 0 additions & 15 deletions build/FrameworkPackage/MakeFrameworkPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -288,21 +288,6 @@ $versionPropsFile =

Set-Content -Value $versionPropsFile $fullOutputPath\MicrosoftUIXamlVersion.props


$capabilitiesPropsFile =
@"
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ProjectCapability Id="VersionGeneral" Include="WinUI" />
<ProjectCapability Id="VersionSpecific" Include="WinUI.$version" />
</ItemGroup>
</Project>
"@

Set-Content -Value $capabilitiesPropsFile $fullOutputPath\MicrosoftUIXamlCapabilities.props


# Also copy in some loose files

$PackageName = $BasePackageName
Expand Down
1 change: 1 addition & 0 deletions build/NuSpecs/MUXControls-Nuget-Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?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">
<Import Project="$(MSBuildThisFileDirectory)\Microsoft.UI.Xaml\Microsoft.UI.Xaml.Capabilities.props"/>
<!-- Check TargetPlatformMinVersion during build to block unsupported configurations. -->
<Target Name="MicrosoftUIXamlCheckTargetPlatformVersion" BeforeTargets="PrepareForBuild"
Condition="'$(TargetPlatformVersion)' != '' and '$(TargetPlatformMinVersion)' != '' and '$(SkipMicrosoftUIXamlCheckTargetPlatformVersion)'==''">
Expand Down
1 change: 0 additions & 1 deletion build/NuSpecs/MUXControls-Nuget-FrameworkPackage.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)\MicrosoftUIXamlCapabilities.props"/>
<Import Project="$(MSBuildThisFileDirectory)\MicrosoftUIXamlVersion.props"/>
<Import Project="$(MSBuildThisFileDirectory)\Common.targets"/>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions build/NuSpecs/MUXControls.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@

<!-- This is here for C++ based projects, see http://nugetdocsbeta.azurewebsites.net/ndocs/guides/create-uwp-packages -->
<file target="build\native\$ID$.targets" src="MUXControls-Nuget-Native.targets"/>

<file target="build" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\Microsoft.UI.Xaml\Microsoft.UI.Xaml.Capabilities.props"/>
<file target="buildTransitive" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\Microsoft.UI.Xaml\Microsoft.UI.Xaml.Capabilities.props"/>
</files>
</package>
2 changes: 0 additions & 2 deletions build/NuSpecs/MUXControlsFrameworkPackage.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@

<file target="tools" src="VisualStudioToolsManifest.xml"/>

<file target="build" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\FrameworkPackage\MicrosoftUIXamlCapabilities.props"/>
<file target="build" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\FrameworkPackage\MicrosoftUIXamlVersion.props"/>
<file target="buildTransitive" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\FrameworkPackage\MicrosoftUIXamlCapabilities.props"/>
<file target="buildTransitive" src="$BUILDOUTPUT$\$BUILDFLAVOR$\$BUILDARCH$\FrameworkPackage\MicrosoftUIXamlVersion.props"/>
<file target="build\Common.targets" src="MUXControls-Nuget-Common.targets"/>
<file target="buildTransitive\Common.targets" src="MUXControls-Nuget-Common.targets"/>
Expand Down
16 changes: 16 additions & 0 deletions build/NuSpecs/build-nupkg.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ if (!(Test-Path $OutputDir)) { mkdir $OutputDir }

$nupkgtitle = "Microsoft.UI.Xaml"


$capabilitiesPropsFile =
@"
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ProjectCapability Id="VersionGeneral" Include="WinUI" />
<ProjectCapability Id="VersionSpecific" Include="WinUI.$version" />
</ItemGroup>
</Project>
"@

Write-Host "Writing Capabilities Props File = $BuildOutput\$BuildFlavor\$BuildArch\Microsoft.UI.Xaml\Microsoft.UI.Xaml.Capabilities.props"
Set-Content -Value $capabilitiesPropsFile $BuildOutput\$BuildFlavor\$BuildArch\Microsoft.UI.Xaml\Microsoft.UI.Xaml.Capabilities.props


function New-TemporaryDirectory {
$parent = [System.IO.Path]::GetTempPath()
$name = [System.IO.Path]::GetRandomFileName()
Expand Down

0 comments on commit c2167df

Please sign in to comment.