Skip to content

Commit 8fd83be

Browse files
committed
.NET8 Windows for SIL.Windows.Forms.Keyboarding and .WritingSystems
It builds, and the tests appear to be not catastrophic, but I'll wait for the build server to do the actual verification. For .Keyboarding, I completely removed the Linux\ folder on .NET8 Windows. Same for the test files directed at Linux.
1 parent e992206 commit 8fd83be

File tree

5 files changed

+40
-3
lines changed

5 files changed

+40
-3
lines changed

SIL.Windows.Forms.Keyboarding.Tests/SIL.Windows.Forms.Keyboarding.Tests.csproj

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<RootNamespace>SIL.Windows.Forms.Keyboarding.Tests</RootNamespace>
55
<AssemblyTitle>SIL.Windows.Forms.Keyboarding.Tests</AssemblyTitle>
66
<Description>Unit tests for SIL.Windows.Forms.Keyboarding</Description>
7+
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
78
<IsTestProject>true</IsTestProject>
89
</PropertyGroup>
910

@@ -25,8 +26,27 @@
2526
<ProjectReference Include="..\SIL.Windows.Forms.Keyboarding\SIL.Windows.Forms.Keyboarding.csproj" />
2627
</ItemGroup>
2728

28-
<ItemGroup>
29+
<ItemGroup Condition=" $(DefineConstants.Contains('NETFRAMEWORK')) ">
2930
<Reference Include="System.Windows.Forms" />
3031
</ItemGroup>
3132

33+
<!-- explicitly remove Linux files for Windows -->
34+
<ItemGroup Condition="'$(TargetFramework)' == 'net8-windows'">
35+
<Compile Remove="TestHelper\GnomeKeyboardRetrievingHelperDouble.cs" />
36+
<Compile Remove="TestHelper\GnomeShellIbusKeyboardRetrievingAdaptorDouble.cs" />
37+
<Compile Remove="CombinedIbusKeyboardRetrievingAdaptorTests.cs" />
38+
<Compile Remove="CombinedIbusKeyboardSwitchingAdaptorTests.cs" />
39+
<Compile Remove="GnomeKeyboardRetrievingHelperTests.cs" />
40+
<Compile Remove="GnomeShellIbusKeyboardRetrievingAdaptorTests.cs" />
41+
<Compile Remove="GnomeShellIbusKeyboardSwitchingAdaptorTests.cs" />
42+
<Compile Remove="IbusDefaultEventHandlerTests.cs" />
43+
<Compile Remove="IbusKeyboardAdaptorTests.cs" />
44+
<Compile Remove="IbusKeyboardDescriptionTests.cs" />
45+
<Compile Remove="IbusXkbKeyboardDescriptionTests.cs" />
46+
<Compile Remove="LinuxKeyboardControllerTests.cs" />
47+
<Compile Remove="UnityKeyboardRetrievingHelperTests.cs" />
48+
<Compile Remove="XkbKeyboardAdapterTests.cs" />
49+
<Compile Remove="XklEngineTests.cs" />
50+
</ItemGroup>
51+
3252
</Project>

SIL.Windows.Forms.Keyboarding/KeyboardController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
using SIL.ObjectModel;
1313
using SIL.PlatformUtilities;
1414
using SIL.Reporting;
15+
#if NETFRAMEWORK
1516
using SIL.Windows.Forms.Keyboarding.Linux;
17+
#endif
1618
using SIL.Windows.Forms.Keyboarding.Windows;
1719

1820
namespace SIL.Windows.Forms.Keyboarding
@@ -217,10 +219,12 @@ private void SetDefaultKeyboardAdaptors()
217219
}
218220
: new IKeyboardRetrievingAdaptor[]
219221
{
222+
#if NETFRAMEWORK
220223
new XkbKeyboardRetrievingAdaptor(), new IbusKeyboardRetrievingAdaptor(),
221224
new UnityXkbKeyboardRetrievingAdaptor(), new UnityIbusKeyboardRetrievingAdaptor(),
222225
new CombinedIbusKeyboardRetrievingAdaptor(),
223226
new GnomeShellIbusKeyboardRetrievingAdaptor()
227+
#endif
224228
}
225229
);
226230
}

SIL.Windows.Forms.Keyboarding/SIL.Windows.Forms.Keyboarding.csproj

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44
<RootNamespace>SIL.Windows.Forms.Keyboarding</RootNamespace>
55
<AssemblyTitle>SIL.Windows.Forms.Keyboarding</AssemblyTitle>
66
<Description>The SIL.Windows.Forms.Keyboarding library provides cross-platform functionality for keyboard selection and switching in Windows Forms applications. Currently, this library supports system and Keyman keyboards on Windows, and X keyboard extension (XKB) and Intelligent Input Bus (IBus) keyboards on Linux.</Description>
7+
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
78
</PropertyGroup>
9+
10+
<ItemGroup Condition="'$(TargetFramework)' == 'net8-windows'">
11+
<Content Remove="Linux\**" />
12+
<Compile Remove="Linux\**" />
13+
<EmbeddedResource Remove="Linux\**" />
14+
<None Remove="Linux\**" />
15+
</ItemGroup>
816

917
<ItemGroup>
1018
<PackageReference Include="GitVersion.MsBuild" Version="5.11.1" PrivateAssets="all" />
@@ -23,6 +31,11 @@
2331
<ProjectReference Include="..\SIL.Core\SIL.Core.csproj" />
2432
</ItemGroup>
2533

34+
<ItemGroup Condition=" $(DefineConstants.Contains('NETFRAMEWORK')) ">
35+
<Reference Include="Microsoft.VisualBasic" />
36+
<Reference Include="System.Windows.Forms" />
37+
</ItemGroup>
38+
2639
<ItemGroup>
2740
<Reference Include="Keyman10Interop">
2841
<HintPath>..\lib\Keyman10Interop.dll</HintPath>
@@ -33,8 +46,6 @@
3346
<Reference Include="KeymanLink">
3447
<HintPath>..\lib\KeymanLink.dll</HintPath>
3548
</Reference>
36-
<Reference Include="Microsoft.VisualBasic" />
37-
<Reference Include="System.Windows.Forms" />
3849
</ItemGroup>
3950
<ItemGroup>
4051
<None Include="../lib/Keyman*.dll">

SIL.Windows.Forms.WritingSystems.Tests/SIL.Windows.Forms.WritingSystems.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<IsPackable>false</IsPackable>
88
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
99
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
10+
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
1011
<IsTestProject>true</IsTestProject>
1112
</PropertyGroup>
1213

SIL.Windows.Forms.WritingSystems/SIL.Windows.Forms.WritingSystems.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<RootNamespace>SIL.Windows.Forms.WritingSystems</RootNamespace>
55
<AssemblyTitle>SIL.Windows.Forms.WritingSystems</AssemblyTitle>
66
<Description>SIL.Windows.Forms.WritingSystems contains Windows Forms UI elements for displaying and editing writing systems as defined by the SIL.WritingSystems assembly.</Description>
7+
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
78
<UseWindowsForms>true</UseWindowsForms>
89
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
910
</PropertyGroup>

0 commit comments

Comments
 (0)