Skip to content

Commit e3f8d8d

Browse files
authored
.NET8 Windows for SIL.Windows.Forms (#1358)
1 parent 17bf041 commit e3f8d8d

File tree

68 files changed

+214
-5511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+214
-5511
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
framework: [net462, net48, net8.0]
21+
framework: [net462, net48, net8.0, net8.0-windows]
2222
concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.framework }}
2424
cancel-in-progress: true

Palaso.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
114114
EndProject
115115
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SIL.TestUtilities.Tests", "SIL.TestUtilities.Tests\SIL.TestUtilities.Tests.csproj", "{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}"
116116
EndProject
117-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardTestApp", "TestApps\ClipboardTestApp\ClipboardTestApp.csproj", "{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}"
118-
EndProject
119117
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommandLineRunnerTestApp", "TestApps\CommandLineRunnerTestApp\CommandLineRunnerTestApp.csproj", "{6407C2F9-F62D-4568-B694-7A79C72582C9}"
120118
EndProject
121119
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SIL.Archiving", "SIL.Archiving\SIL.Archiving.csproj", "{01B31D97-63A4-4FC6-940F-D7278F4D0F65}"
@@ -294,10 +292,6 @@ Global
294292
{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}.Debug|Any CPU.Build.0 = Debug|Any CPU
295293
{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}.Release|Any CPU.ActiveCfg = Release|Any CPU
296294
{CCB5E6CC-8CC1-4248-924E-D4F36CBEF37D}.Release|Any CPU.Build.0 = Release|Any CPU
297-
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
298-
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
299-
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
300-
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1}.Release|Any CPU.Build.0 = Release|Any CPU
301295
{6407C2F9-F62D-4568-B694-7A79C72582C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
302296
{6407C2F9-F62D-4568-B694-7A79C72582C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
303297
{6407C2F9-F62D-4568-B694-7A79C72582C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -324,7 +318,6 @@ Global
324318
{2A206833-C713-4ACB-ACD3-EB971415119E} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
325319
{24FAE6A1-3B6E-4E5A-BAB2-78DCAA1566C4} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
326320
{CA8F3657-3D85-4C97-81A6-5C212627B2F6} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
327-
{B1E0B522-FEDF-497E-BFCD-A572F67C03C1} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
328321
{6407C2F9-F62D-4568-B694-7A79C72582C9} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
329322
{321BB622-8185-4173-8770-742CD620BC18} = {3C695301-9C39-4715-8EDD-817C63EF81E7}
330323
EndGlobalSection

SIL.Core.Desktop.Tests/i18n/StringCatalogTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ namespace SIL.Tests.i18n
1010
{
1111

1212
[TestFixture]
13+
#if NET
14+
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
15+
#endif
16+
[Platform(Include = "Win")]
1317
public class StringCatalogTests
1418
{
1519
private string _poFile = Path.GetTempFileName();

SIL.Core.Desktop/i18n/StringCatalog.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
namespace SIL.i18n
88
{
9+
#if NET
10+
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
11+
#endif
912
public class StringCatalog
1013
{
1114
private Dictionary<string, string> _catalog;

SIL.Core.Tests/IO/PathHelperTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public void NormalizePath_WindowsStylePathConvertsToSlashes()
322322
public void StripFilePrefix_EnsureFilePrefixIsRemoved_Windows()
323323
{
324324
var prefix = Uri.UriSchemeFile + ":";
325-
var fullPathname = Assembly.GetExecutingAssembly().CodeBase;
325+
const string fullPathname = "file:///C:/Users/source/";
326326
Assert.IsTrue(fullPathname.StartsWith(prefix));
327327

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

341341
var reducedPathname = PathHelper.StripFilePrefix(fullPathname);

SIL.Core.Tests/IO/TempFileTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void CreateAndGetPathButDontMakeTheFile_ReturnsUniqueFilenames()
8080
[Test]
8181
public void InFolderOf_WorksProperly()
8282
{
83-
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
83+
string codeBase = System.Reflection.Assembly.GetExecutingAssembly().Location;
8484
UriBuilder uri = new UriBuilder(codeBase);
8585
string originalPath = Uri.UnescapeDataString(uri.Path);
8686
string filePath, filePath2;

SIL.Core.Tests/Xml/XmlUtilsTests.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,6 @@ public void WriteNode_PreserveNamespacesArePreserved()
208208
public void WriteNode_ProtectsAgainstXmlnsFormatThrashing()
209209
{
210210
string input = @"<text><span class='bold' xmlns:fw='http://software.sil.org/fieldworks' fw:special='yes' xml:space='preserve'> </span></text>";
211-
string expectedOutput =
212-
"<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n"
213-
+ "<root>\r\n"
214-
+ " <text>\r\n"
215-
+ " <span\r\n"
216-
+ " class=\"bold\"\r\n"
217-
+ " xmlns:fw=\"http://software.sil.org/fieldworks\"\r\n"
218-
+ " fw:special=\"yes\"\r\n"
219-
+ " xml:space=\"preserve\"> </span>\r\n"
220-
+ " </text>\r\n"
221-
+ "</root>";
222211
var output = new StringBuilder();
223212
var preserveNamespace = new HashSet<string>();
224213
preserveNamespace.Add("xml");

SIL.DictionaryServices.Tests/LexEntryRepositoryCachingTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
namespace SIL.DictionaryServices.Tests
1212
{
1313
[TestFixture]
14+
[Platform(Include = "Win")]
1415
[OfflineSldr]
16+
#if NET
17+
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
18+
#endif
1519
public class LiftLexEntryRepositoryCachingTests
1620
{
1721
private TemporaryFolder _tempfolder;
@@ -371,4 +375,4 @@ public void GetAllEntriesSortedByDefinition_DeleteAllItemsAfterFirstCall_EntryIs
371375

372376

373377
}
374-
}
378+
}

SIL.Lift.Tests/Parsing/ExtensibleMatcher.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,17 @@ public override bool Equals(object o)
7777
}
7878
return true;
7979
}
80-
}
80+
81+
public override int GetHashCode()
82+
{
83+
unchecked
84+
{
85+
var hashCode = (_expectedId != null ? _expectedId.GetHashCode() : 0);
86+
hashCode = (hashCode * 397) ^ _expectedGuid.GetHashCode();
87+
hashCode = (hashCode * 397) ^ _expectedCreationTime.GetHashCode();
88+
hashCode = (hashCode * 397) ^ _expectedModificationTime.GetHashCode();
89+
return hashCode;
90+
}
91+
}
92+
}
8193
}

SIL.Lift.Tests/Parsing/LiftMultiTextAnnotationMatcher.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,20 @@ public override bool Equals(object o)
4747
&& t.Who == _expectedWhoOfFirstAnnotation
4848
&& t.When == _expectedWhenOfFirstAnnotation);
4949
}
50+
51+
public override int GetHashCode()
52+
{
53+
unchecked
54+
{
55+
int hashCode = base.GetHashCode();
56+
hashCode = (hashCode * 397) ^ (_expectedLanguageOfFirstAnnotation != null ? _expectedLanguageOfFirstAnnotation.GetHashCode() : 0);
57+
hashCode = (hashCode * 397) ^ (_expectedNameOfFirstAnnotation != null ? _expectedNameOfFirstAnnotation.GetHashCode() : 0);
58+
hashCode = (hashCode * 397) ^ (_expectedValueOfFirstAnnotation != null ? _expectedValueOfFirstAnnotation.GetHashCode() : 0);
59+
hashCode = (hashCode * 397) ^ (_expectedWhoOfFirstAnnotation != null ? _expectedWhoOfFirstAnnotation.GetHashCode() : 0);
60+
hashCode = (hashCode * 397) ^ _expectedWhenOfFirstAnnotation.GetHashCode();
61+
hashCode = (hashCode * 397) ^ _expectedCount;
62+
return hashCode;
63+
}
64+
}
5065
}
5166
}

0 commit comments

Comments
 (0)