Skip to content

Commit

Permalink
Merge pull request #273 from Sergio0694/user/sergiopedri/fix-uwp-packing
Browse files Browse the repository at this point in the history
Fix UWP NuGet packing
  • Loading branch information
jstedfast authored Sep 16, 2024
2 parents b5008a7 + 6006a3b commit ced0df6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ The [documentation](https://github.com/Microsoft/XamlBehaviors/wiki) explains ho
- Open the "BehaviorsSDKManaged.sln" solution in Visual Studio
- Change Build Configuration to Release
- Build [Ctrl + B]
- Run `msbuild /t:Pack src/BehaviorsSDKManaged/Microsoft.Xaml.Interactions.Design/Microsoft.Xaml.Interactions.Design.csproj`
- Ensure that [nuget.exe](https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools?tabs=windows) is available in PATH
- Run `msbuild /t:pack src\BehaviorsSDKManaged\Microsoft.Xaml.Interactions.Design\Microsoft.Xaml.Interactions.Design.csproj`
- *(Optional)* Add `/p:TimestampPackage=true` to include the timestamp in the NuGet package version

For WinUI:
Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ extends:
platform: Any CPU
configuration: Release
clean: true
- task: VSBuild@1
displayName: Build UWP Managed NuGet package
inputs:
solution: src\BehaviorsSDKManaged\Microsoft.Xaml.Interactions.Design\Microsoft.Xaml.Interactions.Design.csproj
msbuildArgs: /t:Pack /p:SignType=$(SignType) /p:TimestampPackage=$(TimestampPackage) /p:PackageOutputPath="$(Build.SourcesDirectory)out"
configuration: Release
- task: VSBuild@1
displayName: Build WinUI Managed NuGet package
inputs:
Expand Down
2 changes: 1 addition & 1 deletion scripts/Microsoft.Xaml.Behaviors.Uwp.Managed.nuspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package >
<package>
<metadata>
<id>Microsoft.Xaml.Behaviors.Uwp.Managed</id>
<version>$version$</version><!--Overridden using -Version switch in nuget pack command-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,20 @@
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<PropertyGroup>
<PackageId>Microsoft.Xaml.Behaviors.Uwp.Managed</PackageId>
<Title>Microsoft.Xaml.Behaviors.Uwp.Managed</Title>
<Authors>Microsoft</Authors>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageTags>Behavior Action Behaviors Actions Blend Managed C# Interaction Interactivity Interactions</PackageTags>
<PackageLicenseUrl>http://go.microsoft.com/fwlink/?LinkID=708401</PackageLicenseUrl>
<PackageProjectUrl>http://go.microsoft.com/fwlink/?LinkID=651678</PackageProjectUrl>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=708511</PackageIconUrl>
<NuspecFile>..\..\..\scripts\Microsoft.Xaml.Behaviors.Uwp.Managed.nuspec</NuspecFile>
<PackageOutputPath>..\..\..\out\NuGetPackages</PackageOutputPath>
</PropertyGroup>
<Import Project="..\Version\NuGetPackageVersion.props" />
<Import Project="..\..\..\scripts\Microsoft.Xaml.Behaviors.Signing.targets" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" Condition="Exists('..\packages\Microsoft.VisualStudioEng.MicroBuild.Core.1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" />

<!--
This project needs to be packed with 'nuget pack' directly on the .nuspec file.
Note that in order to add this comment, 'nuget.exe' must be present in PATH.
This target can be remove if we figure out how to just import the "pack" targets correctly.
-->
<Target Name="Pack">
<PropertyGroup>
<PackageOutputPath>..\..\..\out\NuGetPackages</PackageOutputPath>
</PropertyGroup>
<Exec Command="nuget pack ..\..\..\scripts\Microsoft.Xaml.Behaviors.Uwp.Managed.nuspec -outputDirectory $(PackageOutputPath) -version $(PackageVersion)" />
</Target>
</Project>

0 comments on commit ced0df6

Please sign in to comment.