Skip to content

Commit

Permalink
.NET8 Windows for SIL.Windows.Forms (#1358)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmyers authored Jan 23, 2025
1 parent 17bf041 commit e3f8d8d
Show file tree
Hide file tree
Showing 68 changed files with 214 additions and 5,511 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
framework: [net462, net48, net8.0]
framework: [net462, net48, net8.0, net8.0-windows]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.framework }}
cancel-in-progress: true
Expand Down
7 changes: 0 additions & 7 deletions Palaso.sln
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SIL.TestUtilities.Tests", "SIL.TestUtilities.Tests\SIL.TestUtilities.Tests.csproj", "{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardTestApp", "TestApps\ClipboardTestApp\ClipboardTestApp.csproj", "{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLineRunnerTestApp", "TestApps\CommandLineRunnerTestApp\CommandLineRunnerTestApp.csproj", "{6407C2F9-F62D-4568-B694-7A79C72582C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SIL.Archiving", "SIL.Archiving\SIL.Archiving.csproj", "{01B31D97-63A4-4FC6-940F-D7278F4D0F65}"
Expand Down Expand Up @@ -294,10 +292,6 @@ Global
{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}.Release|Any CPU.Build.0 = Release|Any CPU
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Release|Any CPU.Build.0 = Release|Any CPU
{6407C2F9-F62D-4568-B694-7A79C72582C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6407C2F9-F62D-4568-B694-7A79C72582C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6407C2F9-F62D-4568-B694-7A79C72582C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -324,7 +318,6 @@ Global
{2A206833-C713-4ACB-ACD3-EB971415119E} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
{24FAE6A1-3B6E-4E5A-BAB2-78DCAA1566C4} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
{CA8F3657-3D85-4C97-81A6-5C212627B2F6} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
{6407C2F9-F62D-4568-B694-7A79C72582C9} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
{321BB622-8185-4173-8770-742CD620BC18} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
EndGlobalSection
Expand Down
4 changes: 4 additions & 0 deletions SIL.Core.Desktop.Tests/i18n/StringCatalogTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ namespace SIL.Tests.i18n
{

[TestFixture]
#if NET
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
#endif
[Platform(Include = "Win")]
public class StringCatalogTests
{
private string _poFile = Path.GetTempFileName();
Expand Down
3 changes: 3 additions & 0 deletions SIL.Core.Desktop/i18n/StringCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace SIL.i18n
{
#if NET
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
#endif
public class StringCatalog
{
private Dictionary<string, string> _catalog;
Expand Down
4 changes: 2 additions & 2 deletions SIL.Core.Tests/IO/PathHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void NormalizePath_WindowsStylePathConvertsToSlashes()
public void StripFilePrefix_EnsureFilePrefixIsRemoved_Windows()
{
var prefix = Uri.UriSchemeFile + ":";
var fullPathname = Assembly.GetExecutingAssembly().CodeBase;
const string fullPathname = "file:///C:/Users/source/";
Assert.IsTrue(fullPathname.StartsWith(prefix));

var reducedPathname = PathHelper.StripFilePrefix(fullPathname);
Expand All @@ -335,7 +335,7 @@ public void StripFilePrefix_EnsureFilePrefixIsRemoved_Windows()
public void StripFilePrefix_EnsureFilePrefixIsRemoved_Linux()
{
var prefix = Uri.UriSchemeFile + ":";
var fullPathname = Assembly.GetExecutingAssembly().CodeBase;
const string fullPathname = "file:///usr/local/bin/";
Assert.IsTrue(fullPathname.StartsWith(prefix));

var reducedPathname = PathHelper.StripFilePrefix(fullPathname);
Expand Down
2 changes: 1 addition & 1 deletion SIL.Core.Tests/IO/TempFileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void CreateAndGetPathButDontMakeTheFile_ReturnsUniqueFilenames()
[Test]
public void InFolderOf_WorksProperly()
{
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().Location;
UriBuilder uri = new UriBuilder(codeBase);
string originalPath = Uri.UnescapeDataString(uri.Path);
string filePath, filePath2;
Expand Down
11 changes: 0 additions & 11 deletions SIL.Core.Tests/Xml/XmlUtilsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,6 @@ public void WriteNode_PreserveNamespacesArePreserved()
public void WriteNode_ProtectsAgainstXmlnsFormatThrashing()
{
string input = @"<text><span class='bold' xmlns:fw='http://software.sil.org/fieldworks' fw:special='yes' xml:space='preserve'> </span></text>";
string expectedOutput =
"<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n"
+ "<root>\r\n"
+ " <text>\r\n"
+ " <span\r\n"
+ " class=\"bold\"\r\n"
+ " xmlns:fw=\"http://software.sil.org/fieldworks\"\r\n"
+ " fw:special=\"yes\"\r\n"
+ " xml:space=\"preserve\"> </span>\r\n"
+ " </text>\r\n"
+ "</root>";
var output = new StringBuilder();
var preserveNamespace = new HashSet<string>();
preserveNamespace.Add("xml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
namespace SIL.DictionaryServices.Tests
{
[TestFixture]
[Platform(Include = "Win")]
[OfflineSldr]
#if NET
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
#endif
public class LiftLexEntryRepositoryCachingTests
{
private TemporaryFolder _tempfolder;
Expand Down Expand Up @@ -371,4 +375,4 @@ public void GetAllEntriesSortedByDefinition_DeleteAllItemsAfterFirstCall_EntryIs


}
}
}
14 changes: 13 additions & 1 deletion SIL.Lift.Tests/Parsing/ExtensibleMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,17 @@ public override bool Equals(object o)
}
return true;
}
}

public override int GetHashCode()
{
unchecked
{
var hashCode = (_expectedId != null ? _expectedId.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ _expectedGuid.GetHashCode();
hashCode = (hashCode * 397) ^ _expectedCreationTime.GetHashCode();
hashCode = (hashCode * 397) ^ _expectedModificationTime.GetHashCode();
return hashCode;
}
}
}
}
15 changes: 15 additions & 0 deletions SIL.Lift.Tests/Parsing/LiftMultiTextAnnotationMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,20 @@ public override bool Equals(object o)
&& t.Who == _expectedWhoOfFirstAnnotation
&& t.When == _expectedWhenOfFirstAnnotation);
}

public override int GetHashCode()
{
unchecked
{
int hashCode = base.GetHashCode();
hashCode = (hashCode * 397) ^ (_expectedLanguageOfFirstAnnotation != null ? _expectedLanguageOfFirstAnnotation.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (_expectedNameOfFirstAnnotation != null ? _expectedNameOfFirstAnnotation.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (_expectedValueOfFirstAnnotation != null ? _expectedValueOfFirstAnnotation.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (_expectedWhoOfFirstAnnotation != null ? _expectedWhoOfFirstAnnotation.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ _expectedWhenOfFirstAnnotation.GetHashCode();
hashCode = (hashCode * 397) ^ _expectedCount;
return hashCode;
}
}
}
}
12 changes: 12 additions & 0 deletions SIL.Lift.Tests/Parsing/TraitMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,17 @@ public override bool Equals(object o)
&&(trait.Name == _expectedName)
&& (trait.Value == _expectedValue);
}

public override int GetHashCode()
{
unchecked
{
int hashCode = base.GetHashCode();
hashCode = (hashCode * 397) ^ (_expectedName != null ? _expectedName.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (_expectedValue != null ? _expectedValue.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ _expectedNumberofAnnotations;
return hashCode;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="L10NSharp" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="L10NSharp" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
</ItemGroup>
Expand Down
8 changes: 0 additions & 8 deletions SIL.Windows.Forms.Keyboarding.Tests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,4 @@
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /></startup>
<system.windows.forms jitDebugging="true" />
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.5.5.0" newVersion="4.5.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="L10NSharp" Version="7.0.0" />
<PackageReference Include="L10NSharp" Version="8.0.0-beta*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="ibusdotnet" Version="2.0.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="JetBrains.Annotations" Version="2024.2.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="L10NSharp" Version="7.0.0" />
<PackageReference Include="L10NSharp" Version="8.0.0-beta*" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Mono.Unix" Version="7.1.0-final.1.21458.1" />
<PackageReference Include="SIL.ReleaseTasks" Version="2.5.0" PrivateAssets="All" />
Expand Down
8 changes: 0 additions & 8 deletions SIL.Windows.Forms.Tests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,4 @@
</SIL.Windows.Forms.Tests.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Globalization;
using System.Threading;
using L10NSharp;
using NUnit.Framework;
using SIL.Windows.Forms.ClearShare;

Expand All @@ -13,6 +14,7 @@ public class CreativeCommonsLicenseTests
public void Setup()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("sv-SE"); //sweden, which uses commas for decimal point (regression test)
LocalizationManager.StrictInitializationMode = false;
}

[Test]
Expand Down
Loading

0 comments on commit e3f8d8d

Please sign in to comment.