Skip to content

Commit

Permalink
.NET8 Windows for SIL.Windows.Forms.Keyboarding and .WritingSystems
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josephmyers committed Jan 23, 2025
1 parent e992206 commit 8fd83be
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<RootNamespace>SIL.Windows.Forms.Keyboarding.Tests</RootNamespace>
<AssemblyTitle>SIL.Windows.Forms.Keyboarding.Tests</AssemblyTitle>
<Description>Unit tests for SIL.Windows.Forms.Keyboarding</Description>
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

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

<ItemGroup>
<ItemGroup Condition=" $(DefineConstants.Contains('NETFRAMEWORK')) ">
<Reference Include="System.Windows.Forms" />
</ItemGroup>

<!-- explicitly remove Linux files for Windows -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8-windows'">
<Compile Remove="TestHelper\GnomeKeyboardRetrievingHelperDouble.cs" />
<Compile Remove="TestHelper\GnomeShellIbusKeyboardRetrievingAdaptorDouble.cs" />
<Compile Remove="CombinedIbusKeyboardRetrievingAdaptorTests.cs" />
<Compile Remove="CombinedIbusKeyboardSwitchingAdaptorTests.cs" />
<Compile Remove="GnomeKeyboardRetrievingHelperTests.cs" />
<Compile Remove="GnomeShellIbusKeyboardRetrievingAdaptorTests.cs" />
<Compile Remove="GnomeShellIbusKeyboardSwitchingAdaptorTests.cs" />
<Compile Remove="IbusDefaultEventHandlerTests.cs" />
<Compile Remove="IbusKeyboardAdaptorTests.cs" />
<Compile Remove="IbusKeyboardDescriptionTests.cs" />
<Compile Remove="IbusXkbKeyboardDescriptionTests.cs" />
<Compile Remove="LinuxKeyboardControllerTests.cs" />
<Compile Remove="UnityKeyboardRetrievingHelperTests.cs" />
<Compile Remove="XkbKeyboardAdapterTests.cs" />
<Compile Remove="XklEngineTests.cs" />
</ItemGroup>

</Project>
4 changes: 4 additions & 0 deletions SIL.Windows.Forms.Keyboarding/KeyboardController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
using SIL.ObjectModel;
using SIL.PlatformUtilities;
using SIL.Reporting;
#if NETFRAMEWORK
using SIL.Windows.Forms.Keyboarding.Linux;
#endif
using SIL.Windows.Forms.Keyboarding.Windows;

namespace SIL.Windows.Forms.Keyboarding
Expand Down Expand Up @@ -217,10 +219,12 @@ private void SetDefaultKeyboardAdaptors()
}
: new IKeyboardRetrievingAdaptor[]
{
#if NETFRAMEWORK
new XkbKeyboardRetrievingAdaptor(), new IbusKeyboardRetrievingAdaptor(),
new UnityXkbKeyboardRetrievingAdaptor(), new UnityIbusKeyboardRetrievingAdaptor(),
new CombinedIbusKeyboardRetrievingAdaptor(),
new GnomeShellIbusKeyboardRetrievingAdaptor()
#endif
}
);
}
Expand Down
15 changes: 13 additions & 2 deletions SIL.Windows.Forms.Keyboarding/SIL.Windows.Forms.Keyboarding.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
<RootNamespace>SIL.Windows.Forms.Keyboarding</RootNamespace>
<AssemblyTitle>SIL.Windows.Forms.Keyboarding</AssemblyTitle>
<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>
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8-windows'">
<Content Remove="Linux\**" />
<Compile Remove="Linux\**" />
<EmbeddedResource Remove="Linux\**" />
<None Remove="Linux\**" />
</ItemGroup>

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

<ItemGroup Condition=" $(DefineConstants.Contains('NETFRAMEWORK')) ">
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>

<ItemGroup>
<Reference Include="Keyman10Interop">
<HintPath>..\lib\Keyman10Interop.dll</HintPath>
Expand All @@ -33,8 +46,6 @@
<Reference Include="KeymanLink">
<HintPath>..\lib\KeymanLink.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<None Include="../lib/Keyman*.dll">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<IsPackable>false</IsPackable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<RootNamespace>SIL.Windows.Forms.WritingSystems</RootNamespace>
<AssemblyTitle>SIL.Windows.Forms.WritingSystems</AssemblyTitle>
<Description>SIL.Windows.Forms.WritingSystems contains Windows Forms UI elements for displaying and editing writing systems as defined by the SIL.WritingSystems assembly.</Description>
<TargetFrameworks>$(TargetFrameworks);net8-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
Expand Down

0 comments on commit 8fd83be

Please sign in to comment.