diff --git a/.changeset/adopt-dotnet-10.md b/.changeset/adopt-dotnet-10.md new file mode 100644 index 0000000..d72e657 --- /dev/null +++ b/.changeset/adopt-dotnet-10.md @@ -0,0 +1,5 @@ +--- +"SolarWinds.Changesets": Minor +--- + +Adopt .NET 10 with multi-targeting. The tool and tests now target `net8.0`, `net9.0` and `net10.0`, the SDK and CI use .NET 10. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f724d3f..860222e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.406 + dotnet-version: 10.0.x - name: Restore dependencies run: dotnet restore --packages ./packages diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9b059ba..f38fd12 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -33,7 +33,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.406 + dotnet-version: 10.0.x - name: Initialize CodeQL uses: github/codeql-action/init@v3 diff --git a/Directory.Build.props b/Directory.Build.props index 3cea168..66bc774 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,9 +3,8 @@ - net8.0 - - 12.0 + net8.0;net9.0;net10.0 + 14.0 @@ -25,8 +24,7 @@ true false true - - 8 + 10 all true diff --git a/global.json b/global.json index 952b4c4..512142d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.406", + "version": "10.0.100", "rollForward": "latestFeature" } } diff --git a/src/SolarWinds.Changesets/Commands/Add/IProjectFileNamesLocator.cs b/src/SolarWinds.Changesets/Commands/Add/IProjectFileNamesLocator.cs index 05140d3..3462df8 100644 --- a/src/SolarWinds.Changesets/Commands/Add/IProjectFileNamesLocator.cs +++ b/src/SolarWinds.Changesets/Commands/Add/IProjectFileNamesLocator.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Commands.Add; /// /// Defines a contract for locating project file names within a specified directory. /// -public interface IProjectFileNamesLocator +internal interface IProjectFileNamesLocator { /// /// Retrieves project file names located in the specified directory. diff --git a/src/SolarWinds.Changesets/Commands/Publish/Services/DotnetService.cs b/src/SolarWinds.Changesets/Commands/Publish/Services/DotnetService.cs index 3a318e2..b81fab8 100644 --- a/src/SolarWinds.Changesets/Commands/Publish/Services/DotnetService.cs +++ b/src/SolarWinds.Changesets/Commands/Publish/Services/DotnetService.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Commands.Publish.Services; /// -public sealed class DotnetService : IDotnetService +internal sealed class DotnetService : IDotnetService { private readonly IProcessExecutor _processExecutor; diff --git a/src/SolarWinds.Changesets/Commands/Publish/Services/GitService.cs b/src/SolarWinds.Changesets/Commands/Publish/Services/GitService.cs index afb837e..7030e70 100644 --- a/src/SolarWinds.Changesets/Commands/Publish/Services/GitService.cs +++ b/src/SolarWinds.Changesets/Commands/Publish/Services/GitService.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Commands.Publish.Services; /// -public sealed class GitService : IGitService +internal sealed class GitService : IGitService { private readonly IProcessExecutor _processExecutor; diff --git a/src/SolarWinds.Changesets/Commands/Publish/Services/IDotnetService.cs b/src/SolarWinds.Changesets/Commands/Publish/Services/IDotnetService.cs index 4d5e495..c7bda24 100644 --- a/src/SolarWinds.Changesets/Commands/Publish/Services/IDotnetService.cs +++ b/src/SolarWinds.Changesets/Commands/Publish/Services/IDotnetService.cs @@ -5,7 +5,7 @@ namespace SolarWinds.Changesets.Commands.Publish.Services; /// /// Provides functionality to interact with the .NET CLI for operations such as packing and publishing NuGet packages. /// -public interface IDotnetService +internal interface IDotnetService { /// /// Packs a .NET project into a NuGet package. diff --git a/src/SolarWinds.Changesets/Commands/Publish/Services/IGitService.cs b/src/SolarWinds.Changesets/Commands/Publish/Services/IGitService.cs index 1b3e79a..9527b00 100644 --- a/src/SolarWinds.Changesets/Commands/Publish/Services/IGitService.cs +++ b/src/SolarWinds.Changesets/Commands/Publish/Services/IGitService.cs @@ -5,7 +5,7 @@ namespace SolarWinds.Changesets.Commands.Publish.Services; /// /// Provides Git-related services, such as retrieving file differences. /// -public interface IGitService +internal interface IGitService { /// /// Retrieves a list of file names that have changed in the specified source path. diff --git a/src/SolarWinds.Changesets/Shared/BumpType.cs b/src/SolarWinds.Changesets/Shared/BumpType.cs index 92d795e..73fa3fd 100644 --- a/src/SolarWinds.Changesets/Shared/BumpType.cs +++ b/src/SolarWinds.Changesets/Shared/BumpType.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// /// Specifies the type of version bump to apply. /// -public enum BumpType +internal enum BumpType { /// /// No version bump. diff --git a/src/SolarWinds.Changesets/Shared/ChangesetConfig.cs b/src/SolarWinds.Changesets/Shared/ChangesetConfig.cs index 944bb8f..f23e72d 100644 --- a/src/SolarWinds.Changesets/Shared/ChangesetConfig.cs +++ b/src/SolarWinds.Changesets/Shared/ChangesetConfig.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// /// Changeset config. /// -public sealed class ChangesetConfig +internal sealed class ChangesetConfig { /// /// Specify the relative path from the changeset command's execution folder to the location of the projects. diff --git a/src/SolarWinds.Changesets/Shared/ChangesetFile.cs b/src/SolarWinds.Changesets/Shared/ChangesetFile.cs index ad45086..1236d07 100644 --- a/src/SolarWinds.Changesets/Shared/ChangesetFile.cs +++ b/src/SolarWinds.Changesets/Shared/ChangesetFile.cs @@ -6,4 +6,4 @@ namespace SolarWinds.Changesets.Shared; /// Changed module names. /// Bump type. /// Description. -public sealed record ChangesetFile(ICollection ChangedModuleNames, BumpType BumpType, string Description); +internal sealed record ChangesetFile(ICollection ChangedModuleNames, BumpType BumpType, string Description); diff --git a/src/SolarWinds.Changesets/Shared/Constants.cs b/src/SolarWinds.Changesets/Shared/Constants.cs index ff78376..0b6c48d 100644 --- a/src/SolarWinds.Changesets/Shared/Constants.cs +++ b/src/SolarWinds.Changesets/Shared/Constants.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// /// Provides application-wide constant values of file names and file path. /// -public static class Constants +internal static class Constants { /// /// The file name of the changelog file. diff --git a/src/SolarWinds.Changesets/Shared/IChangesetsRepository.cs b/src/SolarWinds.Changesets/Shared/IChangesetsRepository.cs index f2f4d69..a50e49b 100644 --- a/src/SolarWinds.Changesets/Shared/IChangesetsRepository.cs +++ b/src/SolarWinds.Changesets/Shared/IChangesetsRepository.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// /// Defines methods for accessing and managing changesets. /// -public interface IChangesetsRepository +internal interface IChangesetsRepository { /// /// Creates changeset file in the changeset working directory. diff --git a/src/SolarWinds.Changesets/Shared/IConfigurationService.cs b/src/SolarWinds.Changesets/Shared/IConfigurationService.cs index 9d627d4..9708e11 100644 --- a/src/SolarWinds.Changesets/Shared/IConfigurationService.cs +++ b/src/SolarWinds.Changesets/Shared/IConfigurationService.cs @@ -7,7 +7,7 @@ namespace SolarWinds.Changesets.Shared; /// This service allows creating a default configuration file and retrieving an existing configuration file. /// It uses JSON serialization and deserialization to handle the configuration data. /// -public interface IConfigurationService +internal interface IConfigurationService { /// diff --git a/src/SolarWinds.Changesets/Shared/IProcessExecutor.cs b/src/SolarWinds.Changesets/Shared/IProcessExecutor.cs index caf8188..e23aab4 100644 --- a/src/SolarWinds.Changesets/Shared/IProcessExecutor.cs +++ b/src/SolarWinds.Changesets/Shared/IProcessExecutor.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// /// Executes external processes and captures their output and exit code. /// -public interface IProcessExecutor +internal interface IProcessExecutor { /// /// Executes a process with the specified executable, arguments, and working directory. diff --git a/src/SolarWinds.Changesets/Shared/InitializationException.cs b/src/SolarWinds.Changesets/Shared/InitializationException.cs index c6270fd..3048300 100644 --- a/src/SolarWinds.Changesets/Shared/InitializationException.cs +++ b/src/SolarWinds.Changesets/Shared/InitializationException.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// /// Represents errors that occur during the initialization phase. /// -public sealed class InitializationException : Exception +internal sealed class InitializationException : Exception { /// /// Initializes a new instance of the class diff --git a/src/SolarWinds.Changesets/Shared/ProcessExecutor.cs b/src/SolarWinds.Changesets/Shared/ProcessExecutor.cs index bd1ed31..86b68cb 100644 --- a/src/SolarWinds.Changesets/Shared/ProcessExecutor.cs +++ b/src/SolarWinds.Changesets/Shared/ProcessExecutor.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// -public class ProcessExecutor : IProcessExecutor +internal class ProcessExecutor : IProcessExecutor { /// public async Task Execute(string executable, string arguments, string workingDirectoryPath) diff --git a/src/SolarWinds.Changesets/Shared/ProcessOutput.cs b/src/SolarWinds.Changesets/Shared/ProcessOutput.cs index 70b3242..bf3bb03 100644 --- a/src/SolarWinds.Changesets/Shared/ProcessOutput.cs +++ b/src/SolarWinds.Changesets/Shared/ProcessOutput.cs @@ -5,4 +5,4 @@ namespace SolarWinds.Changesets.Shared; /// /// The list of output lines from the process. /// The exit code of the process. -public record ProcessOutput(ICollection Output, int ExitCode); +internal record ProcessOutput(ICollection Output, int ExitCode); diff --git a/src/SolarWinds.Changesets/Shared/ResultCodes.cs b/src/SolarWinds.Changesets/Shared/ResultCodes.cs index 7608d5d..92b50a7 100644 --- a/src/SolarWinds.Changesets/Shared/ResultCodes.cs +++ b/src/SolarWinds.Changesets/Shared/ResultCodes.cs @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared; /// /// Defines command result codes with documentation. /// -public static class ResultCodes +internal static class ResultCodes { #region Success Codes diff --git a/src/SolarWinds.Changesets/SolarWinds.Changesets.csproj b/src/SolarWinds.Changesets/SolarWinds.Changesets.csproj index 1a47387..64cb23d 100644 --- a/src/SolarWinds.Changesets/SolarWinds.Changesets.csproj +++ b/src/SolarWinds.Changesets/SolarWinds.Changesets.csproj @@ -41,6 +41,7 @@ + diff --git a/tests/SolarWinds.Changesets.Tests/ProcessExecutorTests.cs b/tests/SolarWinds.Changesets.Tests/ProcessExecutorTests.cs index 8dc65fe..280e6ab 100644 --- a/tests/SolarWinds.Changesets.Tests/ProcessExecutorTests.cs +++ b/tests/SolarWinds.Changesets.Tests/ProcessExecutorTests.cs @@ -21,7 +21,7 @@ public void SetUp() _executable = "cmd"; _argumentsTemplate = '/'; } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { _executable = "/bin/bash"; _argumentsTemplate = '-'; diff --git a/tests/SolarWinds.Changesets.Tests/Version/CsProjectsRepositoryTests.cs b/tests/SolarWinds.Changesets.Tests/Version/CsProjectsRepositoryTests.cs index 54eb16a..36486c7 100644 --- a/tests/SolarWinds.Changesets.Tests/Version/CsProjectsRepositoryTests.cs +++ b/tests/SolarWinds.Changesets.Tests/Version/CsProjectsRepositoryTests.cs @@ -125,6 +125,6 @@ private static string ComputeFileHash(string path) using FileStream stream = File.OpenRead(path); byte[] hashBytes = sha256.ComputeHash(stream); - return BitConverter.ToString(hashBytes).Replace("-", "", StringComparison.Ordinal).ToUpperInvariant(); + return Convert.ToHexString(hashBytes); } }