Skip to content

Commit

Permalink
Merge pull request #294 from microsoft/user/sergiopedri/pack-uwp-net9
Browse files Browse the repository at this point in the history
Pack UWP .NET 9 projects for .NET SDK support
  • Loading branch information
Sergio0694 authored Dec 3, 2024
2 parents 5190af3 + 6d5affb commit 97d8833
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 16 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/managed-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ jobs:
name: msbuild_binlog_Release_x64
path: msbuild.binlog
if-no-files-found: error

- name: Build UWP package
run: msbuild /t:pack src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Uwp\Microsoft.Xaml.Interactivity.Uwp.csproj /p:Configuration=Release /p:TimestampPackage=true

- name: Build WinUI 3 package
run: msbuild /t:pack src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.WinUI\Microsoft.Xaml.Interactivity.WinUI.csproj /p:Configuration=Release /p:TimestampPackage=true

- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget_packages
path: out\NuGetPackages\*.nupkg
if-no-files-found: error

samples-build:
runs-on: windows-latest
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ The [documentation](https://github.com/Microsoft/XamlBehaviors/wiki) explains ho
- If you're building from CLI (Visual Studio Developer Command prompt):
- Run `nuget restore src\BehaviorsSDKManaged\BehaviorsSDKManaged.sln`
- Run `msbuild -t:build src\BehaviorsSDKManaged\BehaviorsSDKManaged.sln /p:Configuration=Release`
- Run `msbuild /t:pack src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Design\Microsoft.Xaml.Interactivity.Design.csproj`

For UWP:
- Run `msbuild /t:pack src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Uwp\Microsoft.Xaml.Interactivity.Uwp.csproj /p:Configuration=Release`
- *(Optional)* Add `/p:TimestampPackage=true` to include the timestamp in the NuGet package version

For WinUI:
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extends:
- task: VSBuild@1
displayName: Build UWP Managed NuGet package
inputs:
solution: src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Design\Microsoft.Xaml.Interactivity.Design.csproj
solution: src\BehaviorsSDKManaged\Microsoft.Xaml.Interactivity.Uwp\Microsoft.Xaml.Interactivity.Uwp.csproj
msbuildArgs: /t:Pack /p:SignType=$(SignType) /p:TimestampPackage=$(TimestampPackage) /p:PackageOutputPath="$(Build.SourcesDirectory)\out"
configuration: Release
- task: VSBuild@1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,4 @@
<Import Project="..\Version\NuGetPackageVersion.props" />
<Import Project="..\..\..\scripts\Microsoft.Xaml.Behaviors.Signing.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" DependsOnTargets="TimestampNugetPackage">
<PropertyGroup>
<PackageOutputPath Condition=" '$(PackageOutputPath)' == '' ">..\..\..\out\NuGetPackages</PackageOutputPath>
</PropertyGroup>
<Exec Command="nuget pack ..\..\..\scripts\Microsoft.Xaml.Behaviors.Uwp.Managed.nuspec -outputDirectory $(PackageOutputPath) -version $(PackageVersion)" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,23 @@
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="..\Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems" Label="Shared" />
<Import Project="..\Version\NuGetPackageVersion.props" />
<Import Project="..\..\..\scripts\Microsoft.Xaml.Behaviors.Signing.targets" />
<PropertyGroup>
<!-- We only add this here as it produces the matching assembly attribute, the other properties are in the .nuspec -->
<PackageId>Microsoft.Xaml.Behaviors.Uwp.Managed</PackageId>
<Version>$(PackageVersion)</Version>
<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 Condition=" '$(PackageOutputPath)' == '' ">..\..\..\out\NuGetPackages</PackageOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DocumentationFile>..\..\..\out\Uwp\BehaviorsSDKManaged\bin\$(Platform)\Release\Microsoft.Xaml.Interactivity.xml</DocumentationFile>
</PropertyGroup>
<Import Project="..\Microsoft.Xaml.Interactivity.Shared\Microsoft.Xaml.Interactivity.Shared.projitems" Label="Shared" />
<Import Project="..\..\..\scripts\Microsoft.Xaml.Behaviors.Signing.targets" />
</Project>

0 comments on commit 97d8833

Please sign in to comment.