diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 127dd1e35..4c6d55181 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: jobs: build: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: windows-latest steps: diff --git a/Directory.Build.props b/Directory.Build.props index 68822ccce..276c6cadb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - net461 + net461;net48 Debug;Release SIL International SIL International diff --git a/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs b/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs index ff294e983..f14166905 100644 --- a/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs +++ b/SIL.Archiving.Tests/IMDIArchivingDlgViewModelTests.cs @@ -111,7 +111,7 @@ public void IsPathWritable_WindowsInvalidPath_False() var writable = _model.IsPathWritable(dir); Assert.False(writable); Assert.AreEqual(1, m_messages.Count); - Assert.AreEqual("The path is not of a legal form.", m_messages[0].MsgText); + Assert.IsTrue(m_messages[0].MsgText.Contains("path"), "Error should mention the path in its explanation."); Assert.AreEqual(ArchivingDlgViewModel.MessageType.Warning, m_messages[0].MsgType); } @@ -122,7 +122,7 @@ public void IsPathWritable_IllegalCharacterInPath_False() var writable = _model.IsPathWritable(dir); Assert.False(writable); Assert.AreEqual(1, m_messages.Count); - Assert.AreEqual("Illegal characters in path.", m_messages[0].MsgText); + Assert.IsTrue(m_messages[0].MsgText.Contains("path"), "Error should mention the path in its explanation."); Assert.AreEqual(ArchivingDlgViewModel.MessageType.Warning, m_messages[0].MsgType); } diff --git a/SIL.Core.Desktop/SIL.Core.Desktop.csproj b/SIL.Core.Desktop/SIL.Core.Desktop.csproj index 2f66699ee..493500070 100644 --- a/SIL.Core.Desktop/SIL.Core.Desktop.csproj +++ b/SIL.Core.Desktop/SIL.Core.Desktop.csproj @@ -6,12 +6,12 @@ SIL prompt 4 - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 - + @@ -20,7 +20,7 @@ - + diff --git a/SIL.Core/IO/DirectoryHelper.cs b/SIL.Core/IO/DirectoryHelper.cs index 19a30df3b..4a9992f4c 100644 --- a/SIL.Core/IO/DirectoryHelper.cs +++ b/SIL.Core/IO/DirectoryHelper.cs @@ -82,7 +82,7 @@ public static bool AreEquivalent(DirectoryInfo dirInfo1, DirectoryInfo dirInfo2) : StringComparison.InvariantCulture; var backslash = new[] { - '\\', '/' + '\\', '/', '.' }; // added this step because mono does not implicitly convert from char to char[] return string.Compare(dirInfo1.FullName.TrimEnd(backslash), dirInfo2.FullName.TrimEnd(backslash), comparison) == 0; diff --git a/SIL.Core/ObjectModel/ObservableHashSet.cs b/SIL.Core/ObjectModel/ObservableHashSet.cs index ed0e577d4..e852f1766 100644 --- a/SIL.Core/ObjectModel/ObservableHashSet.cs +++ b/SIL.Core/ObjectModel/ObservableHashSet.cs @@ -18,6 +18,6 @@ public ObservableHashSet(IEnumerable items, IEqualityComparer comparer) : protected override IEqualityComparer Comparer => Items.Comparer; - protected HashSet Items => (HashSet) _set; + protected HashSet Items => (HashSet) Set; } } diff --git a/SIL.Core/ObjectModel/ObservableISet.cs b/SIL.Core/ObjectModel/ObservableISet.cs index 4de70a9fd..7e7d835bd 100644 --- a/SIL.Core/ObjectModel/ObservableISet.cs +++ b/SIL.Core/ObjectModel/ObservableISet.cs @@ -20,21 +20,21 @@ event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged protected virtual event PropertyChangedEventHandler PropertyChanged; private readonly SimpleMonitor _reentrancyMonitor = new SimpleMonitor(); - protected readonly ISet _set; + protected readonly ISet Set; public ObservableISet(ISet set) { - _set = set; + Set = set; } IEnumerator IEnumerable.GetEnumerator() { - return _set.GetEnumerator(); + return Set.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return _set.GetEnumerator(); + return Set.GetEnumerator(); } void ICollection.Add(T item) @@ -47,8 +47,8 @@ void ICollection.Add(T item) public virtual void UnionWith(IEnumerable other) { CheckReentrancy(); - T[] addedItems = other.Where(x => !_set.Contains(x)).ToArray(); - _set.UnionWith(addedItems); + T[] addedItems = other.Where(x => !Set.Contains(x)).ToArray(); + Set.UnionWith(addedItems); if (addedItems.Length > 0) { OnPropertyChanged(new PropertyChangedEventArgs("Count")); @@ -59,8 +59,8 @@ public virtual void UnionWith(IEnumerable other) public virtual void IntersectWith(IEnumerable other) { CheckReentrancy(); - T[] removedItems = _set.Where(x => !other.Contains(x)).ToArray(); - _set.ExceptWith(removedItems); + T[] removedItems = Set.Where(x => !other.Contains(x)).ToArray(); + Set.ExceptWith(removedItems); if (removedItems.Length > 0) { OnPropertyChanged(new PropertyChangedEventArgs("Count")); @@ -71,8 +71,8 @@ public virtual void IntersectWith(IEnumerable other) public virtual void ExceptWith(IEnumerable other) { CheckReentrancy(); - T[] removedItems = other.Where(x => _set.Contains(x)).ToArray(); - _set.ExceptWith(removedItems); + T[] removedItems = other.Where(x => Set.Contains(x)).ToArray(); + Set.ExceptWith(removedItems); if (removedItems.Length > 0) { OnPropertyChanged(new PropertyChangedEventArgs("Count")); @@ -87,14 +87,14 @@ public virtual void SymmetricExceptWith(IEnumerable other) var removedItems = new List(); foreach (T item in other.Distinct(Comparer)) { - if (_set.Contains(item)) + if (Set.Contains(item)) removedItems.Add(item); else addedItems.Add(item); } - _set.UnionWith(addedItems); - _set.ExceptWith(removedItems); + Set.UnionWith(addedItems); + Set.ExceptWith(removedItems); if (addedItems.Count > 0 || removedItems.Count > 0) OnPropertyChanged(new PropertyChangedEventArgs("Count")); @@ -106,38 +106,38 @@ public virtual void SymmetricExceptWith(IEnumerable other) public bool IsSubsetOf(IEnumerable other) { - return _set.IsSubsetOf(other); + return Set.IsSubsetOf(other); } public bool IsSupersetOf(IEnumerable other) { - return _set.IsSupersetOf(other); + return Set.IsSupersetOf(other); } public bool IsProperSupersetOf(IEnumerable other) { - return _set.IsProperSupersetOf(other); + return Set.IsProperSupersetOf(other); } public bool IsProperSubsetOf(IEnumerable other) { - return _set.IsProperSubsetOf(other); + return Set.IsProperSubsetOf(other); } public bool Overlaps(IEnumerable other) { - return _set.Overlaps(other); + return Set.Overlaps(other); } public bool SetEquals(IEnumerable other) { - return _set.SetEquals(other); + return Set.SetEquals(other); } public virtual bool Add(T item) { CheckReentrancy(); - if (_set.Add(item)) + if (Set.Add(item)) { OnPropertyChanged(new PropertyChangedEventArgs("Count")); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item)); @@ -149,8 +149,8 @@ public virtual bool Add(T item) public virtual void Clear() { CheckReentrancy(); - int origCount = _set.Count; - _set.Clear(); + int origCount = Set.Count; + Set.Clear(); if (origCount > 0) { OnPropertyChanged(new PropertyChangedEventArgs("Count")); @@ -160,18 +160,18 @@ public virtual void Clear() public bool Contains(T item) { - return _set.Contains(item); + return Set.Contains(item); } public void CopyTo(T[] array, int arrayIndex) { - _set.CopyTo(array, arrayIndex); + Set.CopyTo(array, arrayIndex); } public virtual bool Remove(T item) { CheckReentrancy(); - if (_set.Remove(item)) + if (Set.Remove(item)) { OnPropertyChanged(new PropertyChangedEventArgs("Count")); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item)); @@ -182,7 +182,7 @@ public virtual bool Remove(T item) public int Count { - get { return _set.Count; } + get { return Set.Count; } } bool ICollection.IsReadOnly diff --git a/SIL.Core/ObjectModel/ObservableSortedSet.cs b/SIL.Core/ObjectModel/ObservableSortedSet.cs index eef43d781..e1670485a 100644 --- a/SIL.Core/ObjectModel/ObservableSortedSet.cs +++ b/SIL.Core/ObjectModel/ObservableSortedSet.cs @@ -12,6 +12,6 @@ public ObservableSortedSet(IEnumerable items) : base(new SortedSet(items)) protected override IEqualityComparer Comparer => EqualityComparer.Default; - protected SortedSet Items => (SortedSet) _set; + protected SortedSet Items => (SortedSet) Set; } } diff --git a/SIL.Core/PlatformUtilities/Platform.cs b/SIL.Core/PlatformUtilities/Platform.cs index f01f95fb1..191d229cc 100644 --- a/SIL.Core/PlatformUtilities/Platform.cs +++ b/SIL.Core/PlatformUtilities/Platform.cs @@ -39,7 +39,7 @@ public static bool IsMono public static bool IsPreWindows10 => IsWindows && OperatingSystemDescription != "Windows 10"; -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET471_OR_GREATER public static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); public static bool IsMac => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); public static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); diff --git a/SIL.Core/SIL.Core.csproj b/SIL.Core/SIL.Core.csproj index c9895e467..3531e3b58 100644 --- a/SIL.Core/SIL.Core.csproj +++ b/SIL.Core/SIL.Core.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 SIL.Core provides general utilities for language software. It is the base library for all Palaso libraries. diff --git a/SIL.DblBundle/SIL.DblBundle.csproj b/SIL.DblBundle/SIL.DblBundle.csproj index 2eaac0386..e2395fc01 100644 --- a/SIL.DblBundle/SIL.DblBundle.csproj +++ b/SIL.DblBundle/SIL.DblBundle.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 SIL.DblBundle SIL.DblBundle SIL.DblBundle provides classes for building a Digital Bible Library (DBL) bundle. diff --git a/SIL.DictionaryServices/SIL.DictionaryServices.csproj b/SIL.DictionaryServices/SIL.DictionaryServices.csproj index a950dc26a..b42f7ee53 100644 --- a/SIL.DictionaryServices/SIL.DictionaryServices.csproj +++ b/SIL.DictionaryServices/SIL.DictionaryServices.csproj @@ -4,7 +4,7 @@ SIL.DictionaryServices SIL.DictionaryServices SIL.DictionaryServices contains classes for defining a simple lexical model that can be used across applications. - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 diff --git a/SIL.Lexicon/SIL.Lexicon.csproj b/SIL.Lexicon/SIL.Lexicon.csproj index ab5ffecff..afcbb3394 100644 --- a/SIL.Lexicon/SIL.Lexicon.csproj +++ b/SIL.Lexicon/SIL.Lexicon.csproj @@ -4,7 +4,7 @@ SIL.Lexicon SIL.Lexicon SIL.Lexicon contains various lexicon utility classes that can be used across applications. Currently, this assembly contains classes for persisting lexicon settings that can be shared by different lexicon applications. - net461;netstandard2.0 + $(TargetFrameworks);netstandard2.0 diff --git a/SIL.Lift/SIL.Lift.csproj b/SIL.Lift/SIL.Lift.csproj index 19f7297a1..acde7ba79 100644 --- a/SIL.Lift/SIL.Lift.csproj +++ b/SIL.Lift/SIL.Lift.csproj @@ -3,7 +3,7 @@ SIL.Lift SIL.Lift SIL.Lift contains classes for reading and writing Lexicon Interchange FormaT (LIFT) data. This assembly currently supports LIFT 0.13. - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 diff --git a/SIL.Linux.Logging/SIL.Linux.Logging.csproj b/SIL.Linux.Logging/SIL.Linux.Logging.csproj index 0366f157c..d76076110 100644 --- a/SIL.Linux.Logging/SIL.Linux.Logging.csproj +++ b/SIL.Linux.Logging/SIL.Linux.Logging.csproj @@ -4,7 +4,7 @@ SIL.Linux.Logging SIL.Linux.Logging SIL.Linux.Logging provides a library to log to the syslog service. - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 diff --git a/SIL.Scripture/SIL.Scripture.csproj b/SIL.Scripture/SIL.Scripture.csproj index fee3aaff1..aff3dc4e0 100644 --- a/SIL.Scripture/SIL.Scripture.csproj +++ b/SIL.Scripture/SIL.Scripture.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 SIL.Scripture SIL.Scripture SIL.Scripture provides classes for working with Scripture data such as references and versifications. diff --git a/SIL.TestUtilities/SIL.TestUtilities.csproj b/SIL.TestUtilities/SIL.TestUtilities.csproj index 0dfd5702d..c5067785f 100644 --- a/SIL.TestUtilities/SIL.TestUtilities.csproj +++ b/SIL.TestUtilities/SIL.TestUtilities.csproj @@ -4,7 +4,7 @@ SIL.TestUtilities SIL.TestUtilities SIL.TestUtilities contains convenience classes for developing unit tests. - net461;netstandard2.0 + $(TargetFrameworks);netstandard2.0 diff --git a/SIL.Windows.Forms/Extensions/ToolStripExtensions.cs b/SIL.Windows.Forms/Extensions/ToolStripExtensions.cs index 59126f998..4dc11915f 100644 --- a/SIL.Windows.Forms/Extensions/ToolStripExtensions.cs +++ b/SIL.Windows.Forms/Extensions/ToolStripExtensions.cs @@ -92,6 +92,7 @@ public static void SizeTextRectangleToText(this ToolStripItemTextRenderEventArgs /// the WinForms DLL will be able to have access to SIL.WritingSystems, and then this method /// could be moved into L10nSharp.Windows.Forms. [PublicAPI] + [CLSCompliant(false)] public static void InitializeWithAvailableUILocales(this ToolStripDropDownItem menu, Func localeSelectedAction = null, ILocalizationManager lm = null, LocalizationIncompleteViewModel localizationIncompleteViewModel = null, diff --git a/SIL.Windows.Forms/ImageToolbox/AcquireImageControl.cs b/SIL.Windows.Forms/ImageToolbox/AcquireImageControl.cs index 921aa6fdb..09309cba2 100644 --- a/SIL.Windows.Forms/ImageToolbox/AcquireImageControl.cs +++ b/SIL.Windows.Forms/ImageToolbox/AcquireImageControl.cs @@ -349,7 +349,7 @@ private void GetFromDevice(ImageAcquisitionService.DeviceKind deviceKind) /// public void SetInitialSearchString(string searchTerm) { - _galleryControl.SetIntialSearchTerm(searchTerm); + _galleryControl.SetInitialSearchTerm(searchTerm); } /// diff --git a/SIL.Windows.Forms/LocalizationIncompleteDlg/LocalizationIncompleteViewModel.cs b/SIL.Windows.Forms/LocalizationIncompleteDlg/LocalizationIncompleteViewModel.cs index cf2d3cfa4..55e299d39 100644 --- a/SIL.Windows.Forms/LocalizationIncompleteDlg/LocalizationIncompleteViewModel.cs +++ b/SIL.Windows.Forms/LocalizationIncompleteDlg/LocalizationIncompleteViewModel.cs @@ -10,6 +10,7 @@ namespace SIL.Windows.Forms.LocalizationIncompleteDlg /// public class LocalizationIncompleteViewModel { + [CLSCompliant(false)] public ILocalizationManager PrimaryLocalizationManager { get; } public string EmailAddressForLocalizationRequests => @@ -48,6 +49,7 @@ public class LocalizationIncompleteViewModel /// An action to handle issuing a localization /// request (typically by passing the to /// DesktopAnalytics.Track + [CLSCompliant(false)] public LocalizationIncompleteViewModel(ILocalizationManager appLm, string crowdinProjectName, Action issueRequestForLocalization) { diff --git a/SIL.WritingSystems.Tests/SldrTests.cs b/SIL.WritingSystems.Tests/SldrTests.cs index db8cd7cc6..cff4632a7 100644 --- a/SIL.WritingSystems.Tests/SldrTests.cs +++ b/SIL.WritingSystems.Tests/SldrTests.cs @@ -155,6 +155,7 @@ public void GetLdmlFile_LanguageTagWithSuppressedScript_DownloadsFile() #region SLDR cache [Test] + [Category("SkipOnTeamCity")] public void GetLdmlFile_CacheFileWithUid_StatusFileFromSldrCache() { using var environment = new TestEnvironment(); @@ -182,6 +183,7 @@ public void GetLdmlFile_CacheFileWithUid_StatusFileFromSldrCache() } [Test] + [Category("SkipOnTeamCity")] public void GetLdmlFile_CacheFileWithUidUnknown_StatusFileFromSldrCache() { using var environment = new TestEnvironment(); @@ -249,6 +251,7 @@ public void GetLdmlFile_SldrCacheDestinationPath_ReturnsCacheFile() } [Test] + [Category("SkipOnTeamCity")] public void GetLdmlFile_SldrStagingEnvironmentVariable_UsesStagingUrl() { var originalStagingValue = Environment.GetEnvironmentVariable(Sldr.SldrStaging); @@ -283,6 +286,7 @@ public void GetLdmlFile_NotModified_DoesntDownloadNewFile() [Test] [Category("LongRunning")] // ~2 minutes [Category("ByHand")] // The following test tests a smaller sample each checkin; this can be used when a larger sample needs to be tested. + [Category("SkipOnTeamCity")] public void GetLdmlFile_GetsValidLDML([Values("false", "true")] string isStaging, [Values("ar", "az", "bn", "de", "en", "es", "en-GB", "fa", "fr", "hi", "hu", "id", "km", "ko", "ml", "ms", "my", "ne", "pt", "ru", "rw", "sw", "ta", "te", "th", "tr", "ur", "vi", "zh", "zh-CN")] string ietfLanguageTag) @@ -291,6 +295,7 @@ public void GetLdmlFile_GetsValidLDML([Values("false", "true")] string isStaging } [Test] + [Category("SkipOnTeamCity")] public void GetLdmlFile_GetsValidLDML([Values("ar", "en", "fr", "ko", "sw")] string ietfLanguageTag) { DownloadAndVerifyLDML("false", ietfLanguageTag); diff --git a/SIL.WritingSystems/IcuUCharCategoryExtensions.cs b/SIL.WritingSystems/IcuUCharCategoryExtensions.cs index b999ac35b..e908d7501 100644 --- a/SIL.WritingSystems/IcuUCharCategoryExtensions.cs +++ b/SIL.WritingSystems/IcuUCharCategoryExtensions.cs @@ -1,3 +1,4 @@ +using System; using System.Globalization; using Icu; @@ -5,6 +6,7 @@ namespace SIL.WritingSystems { public static class IcuUCharCategoryExtensions { + [CLSCompliant(false)] public static UnicodeCategory ToUnicodeCategory(this Character.UCharCategory category) { switch (category) diff --git a/SIL.WritingSystems/SIL.WritingSystems.csproj b/SIL.WritingSystems/SIL.WritingSystems.csproj index 65d4698fd..9b688c402 100644 --- a/SIL.WritingSystems/SIL.WritingSystems.csproj +++ b/SIL.WritingSystems/SIL.WritingSystems.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net461 + $(TargetFrameworks);netstandard2.0 SIL.WritingSystems contains classes for managing and persisting writing systems using the Locale Data Markup Language (LDML) format. This library also contains classes for processing IETF (BCP-47) language tags and accessing the SIL Locale Data Repository (SLDR). @@ -20,7 +20,7 @@ - +