Skip to content

Commit

Permalink
preview: Update nuget to include dll loader #7
Browse files Browse the repository at this point in the history
Fix nuget test projects
  • Loading branch information
roxk committed Apr 1, 2024
1 parent 422dcbf commit 944bd3d
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 134 deletions.
1 change: 1 addition & 0 deletions WinUI3XamlPreview/Nuget/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.nuspec
*.zip
20 changes: 20 additions & 0 deletions WinUI3XamlPreview/Nuget/WinUI3XamlPreview-Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,31 @@
<Native-Platform Condition="'$(Platform)' == 'Win32'">x86</Native-Platform>
<Native-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</Native-Platform>
</PropertyGroup>
<PropertyGroup>
<CleanDependsOn>
$(CleanDependsOn);WinUI3XPClean
</CleanDependsOn>
</PropertyGroup>
<ItemGroup Condition="$(WinUI3XPEnabled)">
<Reference Include="$(MSBuildThisFileDirectory)..\..\lib\uap10.0\WinUI3XamlPreview.winmd">
<Implementation>WinUI3XamlPreview.dll</Implementation>
</Reference>
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(Native-Platform)\native\WinUI3XamlPreview.dll" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\win10-$(Native-Platform)\native\WinUI3XamlPreview.pri" />
</ItemGroup>
<PropertyGroup>
<PreviewDir>$(OutDir)..\$(ProjectName)_Preview</PreviewDir>
</PropertyGroup>
<Target Name="WinUI3XPClean">
<ItemGroup>
<_FilesToDelete Remove="@(_FilesToDelete)"/>
<_FilesToDelete Include="$(PreviewDir)\**"/>
</ItemGroup>
<Delete Files="@(_FilesToDelete)"/>
</Target>
<Target Name="CopyPreviewAppToOutputDir" AfterTargets="AfterBuild" Condition="$(WinUI3XPEnabled)">
<Exec Command="xcopy /y /e /i &quot;$(OutDir)&quot; &quot;$(PreviewDir)&quot;"/>
<!-- loader has higher priority -->
<Exec Command="powershell -c &quot;Expand-Archive '$(MSBuildThisFileDirectory)..\..\tools\WinUI3XamlPreview.DllLoader.zip' -DestinationPath '$(PreviewDir)' -Force&quot;"/>
</Target>
</Project>
3 changes: 3 additions & 0 deletions WinUI3XamlPreview/Nuget/WinUI3XamlPreview.nuspec.template
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@

<!-- .NET projection -->
<file target="lib\net6.0-windows10.0.22621.0\WinUI3XamlPreviewCs.dll" src="..\AnyCPU\Release\WinUI3XamlPreviewCs\bin\WinUI3XamlPreviewCs.dll" />

<!-- DLL loader app -->
<file target="tools\WinUI3XamlPreview.DllLoader.zip" src="WinUI3XamlPreview.DllLoader.zip" />
</files>
</package>
2 changes: 0 additions & 2 deletions WinUI3XamlPreview/TestDep/TestDep.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
<Import Project="..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets')" />
<Import Project="..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets')" />
<Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets" Condition="Exists('..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand All @@ -186,6 +185,5 @@
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets'))" />
</Target>
</Project>
1 change: 0 additions & 1 deletion WinUI3XamlPreview/TestDep/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220914.1" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.755" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.4.230913002" targetFramework="native" />
<package id="WinUI3XamlPreview.WinUI3XamlPreview" version="0.0.0" targetFramework="native" />
</packages>
1 change: 0 additions & 1 deletion WinUI3XamlPreview/TestDep/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@
#include <winrt/Microsoft.UI.Dispatching.h>
#include <wil/cppwinrt_helpers.h>
#include "DepCustomControl.h"
#include <winrt/WinUI3XamlPreview.h>
7 changes: 5 additions & 2 deletions WinUI3XamlPreview/TestDepOfDep/TestDepOfDep.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<Import Project="..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets')" />
<Import Project="..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets')" />
<Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets" Condition="Exists('..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets')" />
<Import Project="..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets" Condition="Exists('..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand All @@ -183,6 +183,9 @@
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets'))" />
<Error Condition="!Exists('..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets'))" />
</Target>
<Target Name="EnsureLocalPackage" BeforeTargets="EnsureNuGetPackageBuildImports">
<Exec Command="powershell -c &quot;if (test-path $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg) { exit 0 }; $(ProjectDir)..\scripts\build-nuget -version 0.0.0; move $(ProjectDir)..\Nuget\WinUI3XamlPreview.0.0.0.nupkg -destination $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg; nuget restore $(ProjectPath) -PackagesDirectory $(ProjectDir)..\packages&quot;" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion WinUI3XamlPreview/TestDepOfDep/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220914.1" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.755" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.4.230913002" targetFramework="native" />
<package id="WinUI3XamlPreview.WinUI3XamlPreview" version="0.0.0" targetFramework="native" />
<package id="WinUI3XamlPreview" version="0.0.0" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230913002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="WinUI3XamlPreview.WinUI3XamlPreview" Version="0.0.0" />
<PackageReference Include="WinUI3XamlPreview" Version="0.0.0" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions WinUI3XamlPreview/TestNuget/TestNuget.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<Import Project="..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets')" />
<Import Project="..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets')" />
<Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets" Condition="Exists('..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets')" />
<Import Project="..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets" Condition="Exists('..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand All @@ -204,9 +204,9 @@
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.ImplementationLibrary.1.0.220914.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.WinUI3XamlPreview.targets'))" />
<Error Condition="!Exists('..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WinUI3XamlPreview.0.0.0\build\native\WinUI3XamlPreview.targets'))" />
</Target>
<Target Name="EnsureLocalPackage" BeforeTargets="EnsureNuGetPackageBuildImports">
<Exec Command="powershell -c &quot;if (test-path $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0.nupkg) { exit 0 }; $(ProjectDir)..\scripts\build-nuget -version 0.0.0; move $(ProjectDir)..\Nuget\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0.nupkg -destination $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0.nupkg; nuget restore $(ProjectPath) -PackagesDirectory $(ProjectDir)..\packages&quot;" />
<Exec Command="powershell -c &quot;if (test-path $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg) { exit 0 }; $(ProjectDir)..\scripts\build-nuget -version 0.0.0; move $(ProjectDir)..\Nuget\WinUI3XamlPreview.0.0.0.nupkg -destination $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg; nuget restore $(ProjectPath) -PackagesDirectory $(ProjectDir)..\packages&quot;" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion WinUI3XamlPreview/TestNuget/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.220914.1" targetFramework="native" />
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.755" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.4.230913002" targetFramework="native" />
<package id="WinUI3XamlPreview.WinUI3XamlPreview" version="0.0.0" targetFramework="native" />
<package id="WinUI3XamlPreview" version="0.0.0" targetFramework="native" />
</packages>
4 changes: 2 additions & 2 deletions WinUI3XamlPreview/TestPackagedCs/TestPackagedCs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230913002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="WinUI3XamlPreview.WinUI3XamlPreview" Version="0.0.0" />
<PackageReference Include="WinUI3XamlPreview" Version="0.0.0" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

Expand All @@ -47,6 +47,6 @@
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="powershell -c &quot;if (test-path $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0.nupkg) { exit 0 }; $(ProjectDir)..\scripts\build-nuget -version 0.0.0; move $(ProjectDir)..\Nuget\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0.nupkg -destination $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.WinUI3XamlPreview.0.0.0.nupkg; nuget restore $(ProjectPath) -PackagesDirectory $(ProjectDir)..\packages&quot;" />
<Exec Command="powershell -c &quot;if (test-path $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg) { exit 0 }; $(ProjectDir)..\scripts\build-nuget -version 0.0.0; move $(ProjectDir)..\Nuget\WinUI3XamlPreview.0.0.0.nupkg -destination $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg; nuget restore $(ProjectPath) -PackagesDirectory $(ProjectDir)..\packages&quot;" />
</Target>
</Project>
Loading

0 comments on commit 944bd3d

Please sign in to comment.