diff --git a/CHANGELOG.md b/CHANGELOG.md index fc313936..1349f54c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Changed +- [SIL.BuildTasks.AWS] Changed case of text in log message from "Publishing Sourcefiles" "Publishing SourceFiles". If anything is doing a case-sensitive parse of the log file, looking for this text, this could be a breaking change. + +### Deprecated + +- [SIL.BuildTasks] Deprecated `AbandondedSuites` in favor of correctly spelled `AbandonedSuites`. + ## [3.1.1] - 2025-03-18 + ### Changed - [SIL.BuildTasks] Upgraded dependency on Markdig.Signed to version 0.37.0 (to be consistent with SIL.ReleaseTasks) diff --git a/SIL.BuildTasks.AWS/AwsTaskBase.cs b/SIL.BuildTasks.AWS/AwsTaskBase.cs index 48a5e7c5..6a8dc8de 100644 --- a/SIL.BuildTasks.AWS/AwsTaskBase.cs +++ b/SIL.BuildTasks.AWS/AwsTaskBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) /* * Original code from https://code.google.com/archive/p/snowcode/ @@ -9,16 +9,15 @@ */ using System; -using System.Diagnostics.CodeAnalysis; using Amazon.Runtime; using Amazon.Runtime.CredentialManagement; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks.AWS { - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public abstract class AwsTaskBase : Task { /// @@ -33,8 +32,7 @@ public abstract class AwsTaskBase : Task /// protected AWSCredentials GetAwsCredentials() { - AWSCredentials awsCredentials; - if (!new CredentialProfileStoreChain().TryGetAWSCredentials(CredentialStoreProfileName, out awsCredentials)) + if (!new CredentialProfileStoreChain().TryGetAWSCredentials(CredentialStoreProfileName, out var awsCredentials)) throw new ApplicationException("Unable to get AWS credentials from the credential profile store"); Log.LogMessage(MessageImportance.Normal, "Connecting to AWS using AwsAccessKeyId: {0}", diff --git a/SIL.BuildTasks.AWS/S3/S3BuildPublisher.cs b/SIL.BuildTasks.AWS/S3/S3BuildPublisher.cs index 5c52bc3f..f5f2b1b4 100644 --- a/SIL.BuildTasks.AWS/S3/S3BuildPublisher.cs +++ b/SIL.BuildTasks.AWS/S3/S3BuildPublisher.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) /* * Original code from https://code.google.com/archive/p/snowcode/ @@ -9,8 +9,8 @@ */ using System; -using System.Diagnostics.CodeAnalysis; using Amazon.Runtime; +using JetBrains.Annotations; using Microsoft.Build.Framework; namespace SIL.BuildTasks.AWS.S3 @@ -19,9 +19,7 @@ namespace SIL.BuildTasks.AWS.S3 /// MSBuild task to publish a set of files to a S3 bucket. /// /// If made public the files will be available at https://s3.amazonaws.com/bucket_name/folder/file_name - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class S3BuildPublisher : AwsTaskBase { #region Properties @@ -51,7 +49,7 @@ public class S3BuildPublisher : AwsTaskBase public string DestinationBucket { get; set; } /// - /// Gets or sets if the files should be publically readable + /// Gets or sets if the files should be publicly readable /// public bool IsPublicRead { get; set; } @@ -83,7 +81,7 @@ public override bool Execute() private bool ProcessFiles() { - Log.LogMessage(MessageImportance.Normal, "Publishing Sourcefiles={0} to {1}", Join(SourceFiles), DestinationBucket); + Log.LogMessage(MessageImportance.Normal, "Publishing SourceFiles={0} to {1}", Join(SourceFiles), DestinationBucket); ShowAclWarnings(); diff --git a/SIL.BuildTasks.AWS/SIL.BuildTasks.AWS.csproj b/SIL.BuildTasks.AWS/SIL.BuildTasks.AWS.csproj index 67d5a96b..f6b56685 100644 --- a/SIL.BuildTasks.AWS/SIL.BuildTasks.AWS.csproj +++ b/SIL.BuildTasks.AWS/SIL.BuildTasks.AWS.csproj @@ -1,13 +1,16 @@  net472 - SIL.BuildTasks + SIL.BuildTasks.AWS SIL.BuildTasks.AWS defines a S3BuildPublisher msbuild task to publish a set of files to a S3 bucket. SIL.BuildTasks.AWS true + + All + diff --git a/SIL.BuildTasks.Tests/SIL.BuildTasks.Tests.csproj b/SIL.BuildTasks.Tests/SIL.BuildTasks.Tests.csproj index 4417d671..b22cf5aa 100644 --- a/SIL.BuildTasks.Tests/SIL.BuildTasks.Tests.csproj +++ b/SIL.BuildTasks.Tests/SIL.BuildTasks.Tests.csproj @@ -11,6 +11,9 @@ + + All + diff --git a/SIL.BuildTasks/Archive/Archive.cs b/SIL.BuildTasks/Archive/Archive.cs index 79bb4c0d..1b4cc353 100644 --- a/SIL.BuildTasks/Archive/Archive.cs +++ b/SIL.BuildTasks/Archive/Archive.cs @@ -1,17 +1,16 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Text; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks.Archive { - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class Archive : Task { [Required] diff --git a/SIL.BuildTasks/CpuArchitecture.cs b/SIL.BuildTasks/CpuArchitecture.cs index a82ba875..b9a4b2b1 100644 --- a/SIL.BuildTasks/CpuArchitecture.cs +++ b/SIL.BuildTasks/CpuArchitecture.cs @@ -1,8 +1,8 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -11,7 +11,7 @@ namespace SIL.BuildTasks /// /// Return the CPU architecture of the current system. /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] + [PublicAPI] public class CpuArchitecture : Task { public override bool Execute() diff --git a/SIL.BuildTasks/DownloadFile.cs b/SIL.BuildTasks/DownloadFile.cs index b899206f..9802650b 100644 --- a/SIL.BuildTasks/DownloadFile.cs +++ b/SIL.BuildTasks/DownloadFile.cs @@ -1,9 +1,9 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -16,9 +16,7 @@ namespace SIL.BuildTasks /// may be sent in clear. /// Adapted from http://stackoverflow.com/questions/1089452/how-can-i-use-msbuild-to-download-a-file /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class DownloadFile : Task { /// @@ -45,9 +43,9 @@ public class DownloadFile : Task public override bool Execute() { - // This doesn't seem to work reliably..can return true even when only network cable is unplugged. - // Left in in case it works in some cases. But the main way of dealing with disconnect is the - // same algorithm in the WebException handler. + // This doesn't seem to work reliably. It can return true even when only network cable + // is unplugged. Left it in just in case it works in some cases. But the main way of + // dealing with disconnect is the same algorithm in the WebException handler. if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { if (File.Exists(LocalFilename)) @@ -60,8 +58,7 @@ public override bool Execute() return false; // Presumably can't continue } - bool success; - var read = DoDownloadFile(Address, LocalFilename, Username, Password, out success); + var read = DoDownloadFile(Address, LocalFilename, Username, Password, out var success); if (success) Log.LogMessage(MessageImportance.Low, "{0} bytes written", read); diff --git a/SIL.BuildTasks/FileUpdate.cs b/SIL.BuildTasks/FileUpdate.cs index e2fd4b32..4f8b45ce 100644 --- a/SIL.BuildTasks/FileUpdate.cs +++ b/SIL.BuildTasks/FileUpdate.cs @@ -1,13 +1,15 @@ -// Copyright (c) 2023 SIL Global +// Copyright (c) 2023-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Diagnostics; using System.Text.RegularExpressions; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks { + [PublicAPI] public class FileUpdate : Task { private string _dateFormat; diff --git a/SIL.BuildTasks/MakePot/MakePot.cs b/SIL.BuildTasks/MakePot/MakePot.cs index a91a0241..b6238f5e 100644 --- a/SIL.BuildTasks/MakePot/MakePot.cs +++ b/SIL.BuildTasks/MakePot/MakePot.cs @@ -1,18 +1,17 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Text.RegularExpressions; using System.Xml; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks.MakePot { - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class MakePot: Task { private readonly Dictionary> _entries = new Dictionary>(); @@ -182,7 +181,7 @@ internal void ProcessSrcFile(string filePath) } var comments = "#: " + filePath; - //catch the second parameter from calls like this: + // Catch the second parameter from calls like this: // StringCataGet("~Note", "The label for the field showing a note."); if (!string.IsNullOrEmpty(match.Groups["note"].Value)) @@ -214,16 +213,16 @@ private static void WriteEntry(string key, IEnumerable comments, TextWri public static string EscapeString(string s) { - var result = s.Replace("\\", "\\\\"); // This must be first + var result = s.Replace(@"\", @"\\"); // This must be first result = result.Replace("\"", "\\\""); return result; } public static string UnescapeString(string s) { - var result = s.Replace("\\'", "'"); - result = result.Replace("\\\"", "\""); - result = result.Replace("\\\\", "\\"); + var result = s.Replace(@"\'", "'"); + result = result.Replace(@"\""", "\""); + result = result.Replace(@"\\", @"\"); return result; } } diff --git a/SIL.BuildTasks/MakeWixForDirTree/MakeWixForDirTree.cs b/SIL.BuildTasks/MakeWixForDirTree/MakeWixForDirTree.cs index 65cc6ae2..e2cbfc53 100644 --- a/SIL.BuildTasks/MakeWixForDirTree/MakeWixForDirTree.cs +++ b/SIL.BuildTasks/MakeWixForDirTree/MakeWixForDirTree.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) /* * A custom task that walks a directory tree and creates a WiX fragment containing @@ -13,20 +13,18 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Xml; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks.MakeWixForDirTree { - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class MakeWixForDirTree : Task, ILogger { private const string FileNameOfGuidDatabase = ".guidsForInstaller.xml"; @@ -84,7 +82,7 @@ public string IgnoreRegExPattern } /// - /// Whether to just check that all the metadata is uptodate or not. If this is true then no file is output. + /// Whether to just check that all the metadata is up-to-date or not. If this is true then no file is output. /// public bool CheckOnly { get; set; } @@ -112,7 +110,7 @@ public override bool Execute() if (!string.IsNullOrEmpty(InstallerSourceDirectory)) InstallerSourceDirectory = Path.GetFullPath(InstallerSourceDirectory); - /* hatton removed this... it would leave deleted files referenced in the wxs file + /* Hatton removed this... it would leave deleted files referenced in the wxs file if (File.Exists(_outputFilePath)) { DateTime curFileDate = File.GetLastWriteTime(_outputFilePath); @@ -190,7 +188,7 @@ private static void InsertFileDeletionInstruction(XmlNode elemFrag) private void WriteDomToFile(XmlNode doc) { - // write the XML out onlystringles have been modified + // write the XML out only if modified if (CheckOnly || !_filesChanged) return; @@ -342,11 +340,11 @@ private void SetupDirectoryPermissions(XmlNode parent, string parentDirectoryId, private string GetSafeDirectoryId(string directoryPath, string parentDirectoryId) { var id = parentDirectoryId; - //bit of a hack... we don't want our id to have this prefix.dir form fo the top level, - //where it is going to be referenced by other wix files, that will just be expecting the id - //the msbuild target gave for the id of this directory + // This is a bit of a hack... we don't want our id to have this prefix.dir form for the + // top level, where it is going to be referenced by other WIX files; that will just be + // expecting the id the MSBuild target gave for the id of this directory. - //I don't have it quite right, though. See the test file, where you get + // I don't have it quite right, though. See the test file, where you get // kMaxLength) { - id = id.Substring(id.Length - kMaxLength, kMaxLength); //get the last chunk of it + id = id.Substring(id.Length - kMaxLength, kMaxLength); // Get the last chunk of it. } - if (!char.IsLetter(id[0]) && id[0] != '_')//probably not needed now that we're prepending the parent directory id, accept maybe at the root? + if (!char.IsLetter(id[0]) && id[0] != '_') // Probably not needed now that we're prepending the parent directory id, except maybe at the root? id = '_' + id; id = Regex.Replace(id, @"[^\p{Lu}\p{Ll}\p{Nd}._]", "_"); @@ -423,10 +421,10 @@ private void ProcessFile(XmlNode parent, string path, XmlDocument doc, IdToGuidD private static void AddPermissionElement(XmlDocument doc, XmlNode elementToAddPermissionTo) { - var persmission = doc.CreateElement("Permission", Xmlns); - persmission.SetAttribute("GenericAll", "yes"); - persmission.SetAttribute("User", "Everyone"); - elementToAddPermissionTo.AppendChild(persmission); + var permission = doc.CreateElement("Permission", Xmlns); + permission.SetAttribute("GenericAll", "yes"); + permission.SetAttribute("User", "Everyone"); + elementToAddPermissionTo.AppendChild(permission); } public void LogMessage(MessageImportance importance, string message) diff --git a/SIL.BuildTasks/NormalizeLocales.cs b/SIL.BuildTasks/NormalizeLocales.cs index 3c8210ee..1828d859 100644 --- a/SIL.BuildTasks/NormalizeLocales.cs +++ b/SIL.BuildTasks/NormalizeLocales.cs @@ -1,8 +1,9 @@ -// Copyright (c) 2020 SIL Global +// Copyright (c) 2020-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System.IO; using System.Linq; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -12,6 +13,7 @@ namespace SIL.BuildTasks /// Crowdin includes country codes either always or never. Country codes are required for Chinese, but mostly get in the way for other languages. /// This task removes country codes from all locales except Chinese. It expects to work with paths in the form of /%locale%/filename.%locale.extension /// + [PublicAPI] public class NormalizeLocales : Task { /// The directory whose subdirectories are locale names and contain localizations diff --git a/SIL.BuildTasks/SIL.BuildTasks.csproj b/SIL.BuildTasks/SIL.BuildTasks.csproj index b258aeb4..64235b9d 100644 --- a/SIL.BuildTasks/SIL.BuildTasks.csproj +++ b/SIL.BuildTasks/SIL.BuildTasks.csproj @@ -7,6 +7,9 @@ true + + All + diff --git a/SIL.BuildTasks/StampAssemblies/StampAssemblies.cs b/SIL.BuildTasks/StampAssemblies/StampAssemblies.cs index e09975e9..71f15d9a 100644 --- a/SIL.BuildTasks/StampAssemblies/StampAssemblies.cs +++ b/SIL.BuildTasks/StampAssemblies/StampAssemblies.cs @@ -1,17 +1,16 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Text.RegularExpressions; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks.StampAssemblies { - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class StampAssemblies : Task { private enum VersionFormat diff --git a/SIL.BuildTasks/SubString/Split.cs b/SIL.BuildTasks/SubString/Split.cs index ef7327a0..b9edb530 100644 --- a/SIL.BuildTasks/SubString/Split.cs +++ b/SIL.BuildTasks/SubString/Split.cs @@ -1,16 +1,13 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) -using System.Diagnostics.CodeAnalysis; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks.SubString { - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class Split : Task { public Split() @@ -21,7 +18,6 @@ public Split() MaxSplit = 999; ReturnValue = ""; - } [Required] diff --git a/SIL.BuildTasks/UnitTestTasks/NUnit.cs b/SIL.BuildTasks/UnitTestTasks/NUnit.cs index 44b029dc..cec4e0d3 100644 --- a/SIL.BuildTasks/UnitTestTasks/NUnit.cs +++ b/SIL.BuildTasks/UnitTestTasks/NUnit.cs @@ -1,13 +1,13 @@ -// Copyright (c) 2012-2020 SIL Global +// Copyright (c) 2012-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Microsoft.Win32; @@ -18,10 +18,7 @@ namespace SIL.BuildTasks.UnitTestTasks /// /// Run NUnit on a test assembly. /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "MemberCanBeProtected.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] + [PublicAPI] public class NUnit : TestTask { public NUnit() diff --git a/SIL.BuildTasks/UnitTestTasks/NUnit3.cs b/SIL.BuildTasks/UnitTestTasks/NUnit3.cs index 02f4eee5..5b205676 100644 --- a/SIL.BuildTasks/UnitTestTasks/NUnit3.cs +++ b/SIL.BuildTasks/UnitTestTasks/NUnit3.cs @@ -1,10 +1,10 @@ -// Copyright (c) 2016-2020 SIL Global +// Copyright (c) 2016-2025 SIL Global // This software is licensed under the MIT license (http://opensource.org/licenses/MIT) using System; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Text; +using JetBrains.Annotations; namespace SIL.BuildTasks.UnitTestTasks { @@ -12,9 +12,7 @@ namespace SIL.BuildTasks.UnitTestTasks /// /// Run NUnit3 on a test assembly. /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class NUnit3 : NUnit { private bool? _useNUnit3Xml; diff --git a/SIL.BuildTasks/UnitTestTasks/TestTask.cs b/SIL.BuildTasks/UnitTestTasks/TestTask.cs index 5e97040f..734c1525 100644 --- a/SIL.BuildTasks/UnitTestTasks/TestTask.cs +++ b/SIL.BuildTasks/UnitTestTasks/TestTask.cs @@ -1,12 +1,12 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Threading; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -20,11 +20,7 @@ namespace SIL.BuildTasks.UnitTestTasks /// timeouts. In fact, anything based on ToolTask (at least in Mono 10.4) didn't handle /// timeouts properly in my testing. This code does handle timeouts properly. /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "MemberCanBeProtected.Global")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] - [SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")] + [PublicAPI] public abstract class TestTask : Task { private StreamReader _stdError; @@ -83,7 +79,18 @@ protected TestTask() /// Contains the names of test suites that got a timeout or that crashed /// [Output] - public ITaskItem[] AbandondedSuites { get; protected set; } + [Obsolete("Use correctly spelled AbandonedSuites")] + public ITaskItem[] AbandondedSuites + { + get => AbandonedSuites; + protected set => AbandonedSuites = value; + } + + /// + /// Contains the names of test suites that got a timeout or that crashed + /// + [Output] + public ITaskItem[] AbandonedSuites { get; protected set; } public override bool Execute() { @@ -269,9 +276,7 @@ private void StreamReaderThread_Output() } if (Verbose) - { - Log.LogMessage(Importance, logContents); - } + Log.LogMessage(Importance, logContents); // ensure only one thread writes to the log at any time lock (LockObject) @@ -304,16 +309,17 @@ private void StreamReaderThread_Error() } // "The standard error stream is the default destination for error messages and other diagnostic warnings." - // By default log the message as it is most likely a warning. + // By default, log the message as it is most likely a warning. // If the stderr message includes error, crash or fail then log it as an error // and investigate. - // If looks like an error but includes induce or simulator then log as warning instead of error + // If it looks like an error but includes induce or simulator, then log as + // warning instead of error. // Change this if it is still too broad. - string[] toerror = { "error", "crash", "fail" }; - string[] noterror = { "induce", "simulator", "Gdk-CRITICAL **:", "Gtk-CRITICAL **:" }; + string[] toError = { "error", "crash", "fail" }; + string[] notError = { "induce", "simulator", "Gdk-CRITICAL **:", "Gtk-CRITICAL **:" }; - if (toerror.Any(err => logContents.IndexOf(err, StringComparison.OrdinalIgnoreCase) >= 0) && - !noterror.Any(err => logContents.IndexOf(err, StringComparison.OrdinalIgnoreCase) >= 0)) + if (toError.Any(err => logContents.IndexOf(err, StringComparison.OrdinalIgnoreCase) >= 0) && + !notError.Any(err => logContents.IndexOf(err, StringComparison.OrdinalIgnoreCase) >= 0)) { Log.LogError(logContents); } diff --git a/SIL.BuildTasks/UnixName.cs b/SIL.BuildTasks/UnixName.cs index de849845..917b45bb 100644 --- a/SIL.BuildTasks/UnixName.cs +++ b/SIL.BuildTasks/UnixName.cs @@ -1,10 +1,10 @@ -// Copyright (c) 2014-2018 SIL Global +// Copyright (c) 2014-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) // Parts based on code by MJ Hutchinson http://mjhutchinson.com/journal/2010/01/25/integrating_gtk_application_mac using System; -using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -35,9 +35,7 @@ namespace SIL.BuildTasks // // // - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedMember.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class UnixName : Task { public override bool Execute() diff --git a/SIL.BuildTasks/UpdateBuildTypeFile/UpdateBuildTypeFile.cs b/SIL.BuildTasks/UpdateBuildTypeFile/UpdateBuildTypeFile.cs index c0db70eb..c3aed0a5 100644 --- a/SIL.BuildTasks/UpdateBuildTypeFile/UpdateBuildTypeFile.cs +++ b/SIL.BuildTasks/UpdateBuildTypeFile/UpdateBuildTypeFile.cs @@ -1,20 +1,19 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.BuildTasks.UpdateBuildTypeFile { - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] + [PublicAPI] public class UpdateBuildTypeFile : Task { [Required] diff --git a/SIL.ReleaseTasks.Dogfood/SIL.ReleaseTasks.Dogfood.csproj b/SIL.ReleaseTasks.Dogfood/SIL.ReleaseTasks.Dogfood.csproj index bfc76c23..4b69cb23 100644 --- a/SIL.ReleaseTasks.Dogfood/SIL.ReleaseTasks.Dogfood.csproj +++ b/SIL.ReleaseTasks.Dogfood/SIL.ReleaseTasks.Dogfood.csproj @@ -14,6 +14,9 @@ + + All + diff --git a/SIL.ReleaseTasks/CreateChangelogEntry.cs b/SIL.ReleaseTasks/CreateChangelogEntry.cs index 5f884a3c..5b8cbecd 100644 --- a/SIL.ReleaseTasks/CreateChangelogEntry.cs +++ b/SIL.ReleaseTasks/CreateChangelogEntry.cs @@ -1,11 +1,11 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.IO; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -15,7 +15,7 @@ namespace SIL.ReleaseTasks /// /// Given a Changelog file, this task will add an entry to the debian changelog. /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] + [PublicAPI] public class CreateChangelogEntry: Task { [Required] @@ -39,7 +39,7 @@ public class CreateChangelogEntry: Task /// public string MaintainerInfo { get; set; } - [SuppressMessage("ReSharper", "AssignNullToNotNullAttribute")] + [PublicAPI] public override bool Execute() { var oldChangeLog = Path.ChangeExtension(DebianChangelog, ".old"); diff --git a/SIL.ReleaseTasks/CreateReleaseNotesHtml.cs b/SIL.ReleaseTasks/CreateReleaseNotesHtml.cs index 910bbf41..c6c84de2 100644 --- a/SIL.ReleaseTasks/CreateReleaseNotesHtml.cs +++ b/SIL.ReleaseTasks/CreateReleaseNotesHtml.cs @@ -2,10 +2,10 @@ // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Xml.Linq; using System.Xml.XPath; +using JetBrains.Annotations; using Markdig; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -21,7 +21,7 @@ namespace SIL.ReleaseTasks /// The developer-oriented and [Unreleased] beginning will be removed from a Keep a Changelog /// style changelog. /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] + [PublicAPI] public class CreateReleaseNotesHtml : Task { public const string kReleaseNotesClassName = "releasenotes"; diff --git a/SIL.ReleaseTasks/SIL.ReleaseTasks.csproj b/SIL.ReleaseTasks/SIL.ReleaseTasks.csproj index 1d6bcf77..bd4d3112 100644 --- a/SIL.ReleaseTasks/SIL.ReleaseTasks.csproj +++ b/SIL.ReleaseTasks/SIL.ReleaseTasks.csproj @@ -7,6 +7,9 @@ SIL.ReleaseTasks.md + + All + diff --git a/SIL.ReleaseTasks/SetReleaseNotesProperty.cs b/SIL.ReleaseTasks/SetReleaseNotesProperty.cs index 5c89bc0a..ec38d20c 100644 --- a/SIL.ReleaseTasks/SetReleaseNotesProperty.cs +++ b/SIL.ReleaseTasks/SetReleaseNotesProperty.cs @@ -1,18 +1,16 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) -using System; -using System.Diagnostics.CodeAnalysis; using System.IO; -using System.Linq; using System.Text; using System.Text.RegularExpressions; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace SIL.ReleaseTasks { - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] + [PublicAPI] public class SetReleaseNotesProperty : Task { [Required] @@ -220,7 +218,7 @@ private string ExtractPreviousVersionFromChangelog(string currentLevel) // if we have something like // ## [Unreleased] // ## [1.5] - // we're currently at version 1.5 but we want to return the previous version. + // We're currently at version 1.5, but we want to return the previous version. // Skip this heading _currentIndex = i; continue; @@ -235,7 +233,7 @@ private string ExtractPreviousVersionFromChangelog(string currentLevel) private bool SkipHeader(int index) { - //exclude unnecessary headers from changelog file + // Exclude unnecessary headers from changelog file. for (int i = index + 1; i < _markdownLines.Length; i++) { var line = _markdownLines[i]; diff --git a/SIL.ReleaseTasks/StampChangelogFileWithVersion.cs b/SIL.ReleaseTasks/StampChangelogFileWithVersion.cs index 74dcd6a2..29cb7238 100644 --- a/SIL.ReleaseTasks/StampChangelogFileWithVersion.cs +++ b/SIL.ReleaseTasks/StampChangelogFileWithVersion.cs @@ -1,10 +1,10 @@ -// Copyright (c) 2018 SIL Global +// Copyright (c) 2018-2025 SIL Global // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.CompilerServices; +using JetBrains.Annotations; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -18,7 +18,7 @@ namespace SIL.ReleaseTasks /// (Assumes that a temporary line is currently at the top: e.g. ## DEV_VERSION_NUMBER: DEV_RELEASE_DATE /// or that the file contains a `## [Unreleased]` line.) /// - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] + [PublicAPI] public class StampChangelogFileWithVersion : Task { [Required]