Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/adopt-dotnet-10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"SolarWinds.Changesets": Minor
---

Adopt .NET 10 with multi-targeting. The tool and tests now target net8.0 and net10.0, the SDK and CI use .NET 10, and the test suite runs against both runtimes.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.406
dotnet-version: |
8.0.x
10.0.x

- name: Restore dependencies
run: dotnet restore --packages ./packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
<!--https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props-->

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<!-- Default for .NET8.0, please update together with TargetFramework version -->
<LangVersion>12.0</LangVersion>
<LangVersion Condition="'$(TargetFramework)' == 'net8.0'">12.0</LangVersion>
<LangVersion Condition="'$(TargetFramework)' == 'net10.0'">14.0</LangVersion>
Comment on lines +6 to +7
</PropertyGroup>

<PropertyGroup>
Expand All @@ -25,8 +24,8 @@
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<!-- Default for .NET8.0, please update together with TargetFramework version -->
<AnalysisLevel>8</AnalysisLevel>
<AnalysisLevel Condition="'$(TargetFramework)' == 'net8.0'">8</AnalysisLevel>
<AnalysisLevel Condition="'$(TargetFramework)' == 'net10.0'">10</AnalysisLevel>
Comment on lines +27 to +28
<AnalysisMode>all</AnalysisMode>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.406",
"version": "10.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Commands.Add;
/// <summary>
/// Defines a contract for locating project file names within a specified directory.
/// </summary>
public interface IProjectFileNamesLocator
internal interface IProjectFileNamesLocator
{
/// <summary>
/// Retrieves project file names located in the specified directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SolarWinds.Changesets.Commands.Publish.Services;

/// <inheritdoc />
public sealed class DotnetService : IDotnetService
internal sealed class DotnetService : IDotnetService
{
private readonly IProcessExecutor _processExecutor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SolarWinds.Changesets.Commands.Publish.Services;

/// <inheritdoc />
public sealed class GitService : IGitService
internal sealed class GitService : IGitService
{
private readonly IProcessExecutor _processExecutor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SolarWinds.Changesets.Commands.Publish.Services;
/// <summary>
/// Provides functionality to interact with the .NET CLI for operations such as packing and publishing NuGet packages.
/// </summary>
public interface IDotnetService
internal interface IDotnetService
{
/// <summary>
/// Packs a .NET project into a NuGet package.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SolarWinds.Changesets.Commands.Publish.Services;
/// <summary>
/// Provides Git-related services, such as retrieving file differences.
/// </summary>
public interface IGitService
internal interface IGitService
{
/// <summary>
/// Retrieves a list of file names that have changed in the specified source path.
Expand Down
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/BumpType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared;
/// <summary>
/// Specifies the type of version bump to apply.
/// </summary>
public enum BumpType
internal enum BumpType
{
/// <summary>
/// No version bump.
Expand Down
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/ChangesetConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared;
/// <summary>
/// Changeset config.
/// </summary>
public sealed class ChangesetConfig
internal sealed class ChangesetConfig
{
/// <summary>
/// Specify the relative path from the changeset command's execution folder to the location of the projects.
Expand Down
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/ChangesetFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ namespace SolarWinds.Changesets.Shared;
/// <param name="ChangedModuleNames">Changed module names.</param>
/// <param name="BumpType">Bump type.</param>
/// <param name="Description">Description.</param>
public sealed record ChangesetFile(ICollection<string> ChangedModuleNames, BumpType BumpType, string Description);
internal sealed record ChangesetFile(ICollection<string> ChangedModuleNames, BumpType BumpType, string Description);
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared;
/// <summary>
/// Provides application-wide constant values of file names and file path.
/// </summary>
public static class Constants
internal static class Constants
{
/// <summary>
/// The file name of the changelog file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared;
/// <summary>
/// Defines methods for accessing and managing changesets.
/// </summary>
public interface IChangesetsRepository
internal interface IChangesetsRepository
{
/// <summary>
/// Creates changeset file in the changeset working directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </remarks>
public interface IConfigurationService
internal interface IConfigurationService
{

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/IProcessExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared;
/// <summary>
/// Executes external processes and captures their output and exit code.
/// </summary>
public interface IProcessExecutor
internal interface IProcessExecutor
{
/// <summary>
/// Executes a process with the specified executable, arguments, and working directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared;
/// <summary>
/// Represents errors that occur during the initialization phase.
/// </summary>
public sealed class InitializationException : Exception
internal sealed class InitializationException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="InitializationException"/> class
Expand Down
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/ProcessExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace SolarWinds.Changesets.Shared;

/// <inheritdoc />
public class ProcessExecutor : IProcessExecutor
internal class ProcessExecutor : IProcessExecutor
{
/// <inheritdoc />
public async Task<ProcessOutput> Execute(string executable, string arguments, string workingDirectoryPath)
Expand Down
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/ProcessOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ namespace SolarWinds.Changesets.Shared;
/// </summary>
/// <param name="Output">The list of output lines from the process.</param>
/// <param name="ExitCode">The exit code of the process.</param>
public record ProcessOutput(ICollection<string> Output, int ExitCode);
internal record ProcessOutput(ICollection<string> Output, int ExitCode);
2 changes: 1 addition & 1 deletion src/SolarWinds.Changesets/Shared/ResultCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace SolarWinds.Changesets.Shared;
/// <summary>
/// Defines command result codes with documentation.
/// </summary>
public static class ResultCodes
internal static class ResultCodes
Comment thread
JohnCampionJr marked this conversation as resolved.
{
#region Success Codes

Expand Down
2 changes: 2 additions & 0 deletions src/SolarWinds.Changesets/SolarWinds.Changesets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets -->
<PropertyGroup Label="NuGet Package Setup">
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<PackageID>SolarWinds.Changesets</PackageID>
<Title>.NET Changesets</Title>
<ToolCommandName>changeset</ToolCommandName>
Expand Down Expand Up @@ -41,6 +42,7 @@

<ItemGroup>
<InternalsVisibleTo Include="SolarWinds.Changesets.Tests" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '-';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}