Skip to content

Commit

Permalink
preview: Support .NET 8 #10
Browse files Browse the repository at this point in the history
Fix cs project not buildable without defining CsWinRTComponent
Upgrade to WASDK 1.5
  • Loading branch information
roxk committed Apr 11, 2024
1 parent 5bd0022 commit 7b8746f
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 32 deletions.
4 changes: 2 additions & 2 deletions WinUI3XamlPreview/Nuget/WinUI3XamlPreview-Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<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" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-$(Native-Platform)\native\WinUI3XamlPreview.dll" />
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-$(Native-Platform)\native\WinUI3XamlPreview.pri" />
</ItemGroup>
<PropertyGroup>
<PreviewDir>$(OutDir)..\$(ProjectName)_Preview</PreviewDir>
Expand Down
14 changes: 7 additions & 7 deletions WinUI3XamlPreview/Nuget/WinUI3XamlPreview.nuspec.template
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
<file target="lib\uap10.0\WinUI3XamlPreview" src="..\x64\Release\WinUI3XamlPreview\WinUI3XamlPreview\**\*.*"/>

<!-- Platform DLLs and resources -->
<!--<file target="runtimes\win10-arm64\native\WinUI3XamlPreview.dll" src="..\WinUI3XamlPreview\ARM64\Release\WinUI3XamlPreview\WinUI3XamlPreview.dll" />-->
<!--<file target="runtimes\win10-arm64\native" src="..\WinUI3XamlPreview\ARM64\Release\WinUI3XamlPreview\WinUI3XamlPreview.pri" />-->
<!--<file target="runtimes\win10-arm64\native\WinUI3XamlPreview\Assets" src="..\WinUI3XamlPreview\arm64\Release\WinUI3XamlPreview\Assets\**\*.*"/>-->
<file target="runtimes\win10-x64\native\WinUI3XamlPreview" src="..\x64\Release\WinUI3XamlPreview\WinUI3XamlPreview\**\*.*"/>
<file target="runtimes\win10-x64\native\WinUI3XamlPreview.dll" src="..\x64\Release\WinUI3XamlPreview\WinUI3XamlPreview.dll" />
<file target="runtimes\win10-x64\native" src="..\x64\Release\WinUI3XamlPreview\WinUI3XamlPreview.pri" />
<!--<file target="runtimes\win-arm64\native\WinUI3XamlPreview.dll" src="..\WinUI3XamlPreview\ARM64\Release\WinUI3XamlPreview\WinUI3XamlPreview.dll" />-->
<!--<file target="runtimes\win-arm64\native" src="..\WinUI3XamlPreview\ARM64\Release\WinUI3XamlPreview\WinUI3XamlPreview.pri" />-->
<!--<file target="runtimes\win-arm64\native\WinUI3XamlPreview\Assets" src="..\WinUI3XamlPreview\arm64\Release\WinUI3XamlPreview\Assets\**\*.*"/>-->
<file target="runtimes\win-x64\native\WinUI3XamlPreview" src="..\x64\Release\WinUI3XamlPreview\WinUI3XamlPreview\**\*.*"/>
<file target="runtimes\win-x64\native\WinUI3XamlPreview.dll" src="..\x64\Release\WinUI3XamlPreview\WinUI3XamlPreview.dll" />
<file target="runtimes\win-x64\native" src="..\x64\Release\WinUI3XamlPreview\WinUI3XamlPreview.pri" />

<file target="build\WinUI3XamlPreview.targets" src="WinUI3XamlPreview.targets"/>
<file target="build\native\WinUI3XamlPreview.targets" src="WinUI3XamlPreview-Native.targets"/>

<!-- .NET projection -->
<file target="lib\net6.0-windows10.0.22621.0\WinUI3XamlPreviewCs.dll" src="..\AnyCPU\Release\WinUI3XamlPreviewCs\bin\WinUI3XamlPreviewCs.dll" />
<file target="lib\net8.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" />
Expand Down
2 changes: 1 addition & 1 deletion WinUI3XamlPreview/Nuget/WinUI3XamlPreview.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>
<Delete Files="@(_FilesToDelete)"/>
</Target>
<Target Name="CopyPreviewAppToOutputDir" AfterTargets="AfterBuild" Condition="$(WinUI3XPEnabled) and $(CsWinRTComponent)">
<Target Name="CopyPreviewAppToOutputDir" AfterTargets="AfterBuild" Condition="$(WinUI3XPEnabled) and $(CsWinRTComponent) == true">
<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;"/>
Expand Down
6 changes: 3 additions & 3 deletions WinUI3XamlPreview/TestNuget/TestNuget.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<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.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>
<Target Name="EnsureLocalPackage" BeforeTargets="EnsureNuGetPackageBuildImports">
<Exec Command="powershell -c &quot;if (test-path $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg) { nuget restore $(ProjectPath) -PackagesDirectory $(ProjectDir)..\packages; 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>
12 changes: 6 additions & 6 deletions WinUI3XamlPreview/TestPackagedCs/TestPackagedCs.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>TestPackagedCs</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
</PropertyGroup>
Expand All @@ -23,8 +23,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230913002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240404000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" />
<PackageReference Include="WinUI3XamlPreview" Version="0.0.0" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>
Expand All @@ -47,7 +47,7 @@
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
</PropertyGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<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;" />
<Exec Command="powershell -c &quot;if (test-path $(ProjectDir)..\LocalPackages\WinUI3XamlPreview.0.0.0.nupkg) { nuget restore $(ProjectPath) -PackagesDirectory $(ProjectDir)..\packages; 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>
<ItemGroup>
<CustomAdditionalCompileInputs Remove="MyUserControl.xaml" />
Expand Down
16 changes: 8 additions & 8 deletions WinUI3XamlPreview/WinUI3XamlPreview/WinUI3XamlPreview.vcxproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.props')" />
<Import Project="..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.props')" />
<Import Project="..\packages\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.props" Condition="Exists('..\packages\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.props')" />
<Import Project="..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\packages\Microsoft.WindowsAppSDK.1.4.230913002\build\native\Microsoft.WindowsAppSDK.props')" />
<Import Project="..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
Expand Down Expand Up @@ -211,24 +211,24 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets')" />
<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\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.targets" Condition="Exists('..\packages\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.targets')" />
<Import Project="..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.targets')" />
<Import Project="..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.755\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
<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\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.props'))" />
<Error Condition="!Exists('..\packages\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\IdlGen.IdlGen.Cpp.0.2.2\build\native\IdlGen.IdlGen.Cpp.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.3233\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.WindowsAppSDK.1.5.240404000\build\native\Microsoft.WindowsAppSDK.targets'))" />
</Target>
<Target Name="GetPriIndexName">
<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions WinUI3XamlPreview/WinUI3XamlPreview/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<package id="IdlGen.IdlGen.Cpp" version="0.2.2" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.230706.1" targetFramework="native" />
<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="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.3233" targetFramework="native" />
<package id="Microsoft.WindowsAppSDK" version="1.5.240404000" targetFramework="native" />
</packages>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<Platform>AnyCPU</Platform>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>

Expand All @@ -13,8 +14,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.7" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.230913002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240404000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 7b8746f

Please sign in to comment.