Skip to content

Commit 6447c79

Browse files
committed
Update UnoEdit.Tests project configuration for multi-targeting and Windows SDK support
1 parent 6bae75f commit 6447c79

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

src/UnoEdit.Tests/UnoEdit.Tests.csproj

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<Project Sdk="Uno.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net10.0-desktop</TargetFramework>
4-
<OutputType>Library</OutputType>
3+
<TargetFrameworks>net10.0-desktop</TargetFrameworks>
4+
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>
5+
<OutputType>Exe</OutputType>
56
<StartupObject>UnoEdit.Tests.Program</StartupObject>
7+
<WinUISDKReferences>false</WinUISDKReferences>
8+
<UnoSingleProject>true</UnoSingleProject>
9+
<UnoFeatures>SkiaRenderer;</UnoFeatures>
610
<ImplicitUsings>disable</ImplicitUsings>
711
<Nullable>disable</Nullable>
812
<IsPackable>false</IsPackable>
@@ -12,16 +16,42 @@
1216
<NoWarn>$(NoWarn);CA1416</NoWarn>
1317
</PropertyGroup>
1418

19+
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0-windows10.0.19041.0'">
20+
<UseWinUI>true</UseWinUI>
21+
<EnableWindowsTargeting>true</EnableWindowsTargeting>
22+
<DefineConstants>$(DefineConstants);WINDOWS_APP_SDK</DefineConstants>
23+
<WindowsSdkPackageVersion>10.0.19041.57</WindowsSdkPackageVersion>
24+
</PropertyGroup>
25+
26+
<!-- Uno.SingleProject.WinAppSdk.targets sets OutputType=WinExe for Uno heads after static evaluation.
27+
Restore it to Exe before test validation and compilation. -->
28+
<Target Name="_RestoreOutputTypeForTests"
29+
BeforeTargets="BeforeBuild"
30+
Condition="'$(TargetFramework)' == 'net10.0-windows10.0.19041.0'">
31+
<PropertyGroup>
32+
<OutputType>Exe</OutputType>
33+
</PropertyGroup>
34+
</Target>
35+
1536
<ItemGroup>
1637
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1738
<PackageReference Include="NUnit" />
1839
<PackageReference Include="NUnitLite" />
1940
<PackageReference Include="NUnit3TestAdapter" />
2041
</ItemGroup>
2142

22-
<ItemGroup>
23-
<ProjectReference Include="..\UnoEdit\UnoEdit.csproj" />
24-
<ProjectReference Include="..\UnoEdit.TextMate\UnoEdit.TextMate.csproj" />
43+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0-windows10.0.19041.0'">
44+
<PackageReference Include="Microsoft.WindowsAppSDK" />
45+
</ItemGroup>
46+
47+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0-desktop'">
48+
<ProjectReference Include="..\UnoEdit\UnoEdit.csproj" SetTargetFramework="TargetFramework=net9.0-desktop" />
49+
<ProjectReference Include="..\UnoEdit.TextMate\UnoEdit.TextMate.csproj" SetTargetFramework="TargetFramework=net9.0-desktop" />
50+
</ItemGroup>
51+
52+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0-windows10.0.19041.0'">
53+
<ProjectReference Include="..\UnoEdit\UnoEdit.csproj" SetTargetFramework="TargetFramework=net9.0-windows10.0.19041.0" />
54+
<ProjectReference Include="..\UnoEdit.TextMate\UnoEdit.TextMate.csproj" SetTargetFramework="TargetFramework=net9.0-windows10.0.19041.0" />
2555
</ItemGroup>
2656

2757
<ItemGroup>

0 commit comments

Comments
 (0)