Skip to content
Merged
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
9 changes: 5 additions & 4 deletions .build/Build.CI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Nuke.Common;
using Nuke.Common.CI.GitHubActions;

using Rocket.Surgery.Nuke.ContinuousIntegration;
using Rocket.Surgery.Nuke.GithubActions;
using Rocket.Surgery.Nuke.Jobs;
Expand Down Expand Up @@ -87,7 +88,7 @@ public static RocketSurgeonGitHubActionsConfiguration CiIgnoreMiddleware(RocketS
.ProducesGithubActionsOutput("iSetAThing", "Some output value")
.Requires(() => ThisIsAInput)
.Executes(() => GitHubActions.Instance?.SetOutput("iSetAThing", "myValue"));
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
[Parameter]
public string ThisIsAInput { get; set; }

Expand Down Expand Up @@ -124,8 +125,8 @@ public static RocketSurgeonGitHubActionsConfiguration CiMiddleware(RocketSurgeon
.ExcludeRepositoryConfigurationFiles()
.Jobs.OfType<RocketSurgeonsGithubActionsJob>()
.First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase))
.UseDotNetSdks("8.0", "9.0")
// .ConfigureForGitVersion()
.UseDotNetSdks("8.0", "9.0", "10.0")
// .ConfigureForGitVersion()
.ConfigureStep<CheckoutStep>(step => step.FetchDepth = 0)
.PublishLogs<Pipeline>();

Expand All @@ -137,7 +138,7 @@ public static RocketSurgeonGitHubActionsConfiguration LintStagedMiddleware(Rocke
configuration
.Jobs.OfType<RocketSurgeonsGithubActionsJob>()
.First(z => z.Name.Equals("Build", StringComparison.OrdinalIgnoreCase))
.UseDotNetSdks("8.0", "9.0");
.UseDotNetSdks("8.0", "9.0", "10.0");

return configuration;
}
Expand Down
2 changes: 1 addition & 1 deletion .build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal partial class Pipeline : NukeBuild,
ICanClean,
IHaveCommonLintTargets,
IRemoveUnusedDependencies,
IHavePublicApis,
// IHavePublicApis,
IGenerateCodeCoverageReport,
IGenerateCodeCoverageSummary,
IGenerateCodeCoverageBadges,
Expand Down
4 changes: 2 additions & 2 deletions .build/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System.ComponentModel;

using Nuke.Common.Tooling;

#pragma warning disable CA1050, CA1724, CA2225

[TypeConverter(typeof(TypeConverter<Configuration>))]
public class Configuration : Enumeration
{
public static implicit operator string(Configuration configuration) => configuration.Value;
public static readonly Configuration Debug = new() { Value = nameof(Debug) };
public static readonly Configuration Release = new() { Value = nameof(Release) };

public static implicit operator string(Configuration configuration) => configuration.Value;
}
14 changes: 7 additions & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"isRoot": true,
"tools": {
"gitversion.tool": {
"version": "6.3.0",
"version": "6.4.0",
"commands": ["dotnet-gitversion"],
"rollForward": false
},
"dotnet-reportgenerator-globaltool": {
"version": "5.4.8",
"version": "5.4.12",
"commands": ["reportgenerator"],
"rollForward": false
},
Expand All @@ -23,17 +23,17 @@
"rollForward": false
},
"jetbrains.resharper.globaltools": {
"version": "2024.3.8",
"version": "2025.2.1",
"commands": ["jb"],
"rollForward": false
},
"jetbrains.dotcover.commandlinetools": {
"version": "2024.3.8",
"commands": ["dotnet-dotCover"],
"version": "2025.2.1",
"commands": ["dotCover"],
"rollForward": false
},
"jetbrains.dottrace.globaltools": {
"version": "2024.3.8",
"version": "2025.2.1",
"commands": ["dottrace"],
"rollForward": false
},
Expand All @@ -58,7 +58,7 @@
"rollForward": false
},
"gitreleasemanager.tool": {
"version": "0.18.0",
"version": "0.20.0",
"commands": ["dotnet-gitreleasemanager"],
"rollForward": false
}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ jobs:
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: '9.0.x'
- name: 🔨 Use .NET Core 10.0 SDK
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: '10.0.x'
- name: 🚒 dotnet workload restore
continue-on-error: true
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: 📲 Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v3.2.1
with:
versionSpec: '0.18.0'
versionSpec: '0.20.0'
- name: Get Repo and Owner
id: repository
if: ${{ !github.event.release.prerelease && steps.gitversion.outputs.preReleaseTag == '' }}
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: 🔨 Use .NET Core 10.0 SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: 🚒 dotnet workload restore
continue-on-error: true
run: |
Expand All @@ -82,14 +86,6 @@ jobs:
id: lintFiles
run: |
dotnet .build/bin/Debug/.build.dll --target LintFiles --skip Restore --ThisIsAOtherVariable "${{ vars.THIS_IS_A_VARIABLE }}" --ThisIsAnotherVariable "${{ vars.THIS_IS_ANOTHER_VARIABLE }}" --THIS_IS_A_VARIABLE "${{ vars.THIS_IS_A_VARIABLE }}" --ThisIsAEnv "${{ env.THIS_IS_A_ENV || 'test' }}" --ThisIsASecret "${{ secrets.THIS_IS_A_SECRET }}" --GitHubToken "${{ secrets.GITHUB_TOKEN }}"
- name: Lint Public Api Analyzers
id: lintPublicApiAnalyzers
run: |
dotnet .build/bin/Debug/.build.dll --target LintPublicApiAnalyzers --ThisIsAOtherVariable "${{ vars.THIS_IS_A_VARIABLE }}" --ThisIsAnotherVariable "${{ vars.THIS_IS_ANOTHER_VARIABLE }}" --THIS_IS_A_VARIABLE "${{ vars.THIS_IS_A_VARIABLE }}" --ThisIsAEnv "${{ env.THIS_IS_A_ENV || 'test' }}" --ThisIsASecret "${{ secrets.THIS_IS_A_SECRET }}" --GitHubToken "${{ secrets.GITHUB_TOKEN }}"
- name: Move Unshipped to Shipped
id: moveUnshippedToShipped
run: |
dotnet .build/bin/Debug/.build.dll --target MoveUnshippedToShipped --skip LintPublicApiAnalyzers --ThisIsAOtherVariable "${{ vars.THIS_IS_A_VARIABLE }}" --ThisIsAnotherVariable "${{ vars.THIS_IS_ANOTHER_VARIABLE }}" --THIS_IS_A_VARIABLE "${{ vars.THIS_IS_A_VARIABLE }}" --ThisIsAEnv "${{ env.THIS_IS_A_ENV || 'test' }}" --ThisIsASecret "${{ secrets.THIS_IS_A_SECRET }}" --GitHubToken "${{ secrets.GITHUB_TOKEN }}"
- name: Remove Unused Dependencies
id: removeUnusedDependencies
run: |
Expand Down
3 changes: 0 additions & 3 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,12 @@
"Lint",
"LintFiles",
"LintGitAdd",
"LintPublicApiAnalyzers",
"MoveUnshippedToShipped",
"Pack",
"PostLint",
"Prettier",
"RegenerateBuildConfigurations",
"RemoveUnusedDependencies",
"Restore",
"ShipPublicApis",
"Test",
"WithOutputs"
]
Expand Down
42 changes: 21 additions & 21 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@
<GlobalPackageReference Include="Rocket.Surgery.MSBuild.GitVersion" Version="1.3.0-beta.2" />
<GlobalPackageReference Include="Rocket.Surgery.MSBuild.SourceLink" Version="1.3.0-beta.2" />
<GlobalPackageReference Include="Rocket.Surgery.MyAssembly" Version="1.3.0-beta.2" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="4.14.0" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="4.14.0" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.13.1" />
<GlobalPackageReference Include="Roslynator.Formatting.Analyzers" Version="4.13.1" />
<GlobalPackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="4.13.1" />
<GlobalPackageReference Include="Roslynator.CodeFixes" Version="4.13.1" />
<GlobalPackageReference Include="Roslynator.Refactorings" Version="4.13.1" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.14.0" />
<GlobalPackageReference Include="Roslynator.Formatting.Analyzers" Version="4.14.0" />
<GlobalPackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="4.14.0" />
<GlobalPackageReference Include="Roslynator.CodeFixes" Version="4.14.0" />
<GlobalPackageReference Include="Roslynator.Refactorings" Version="4.14.0" />
<GlobalPackageReference Include="FakeItEasy.Analyzer.CSharp" Version="6.1.1" />
<GlobalPackageReference Include="xunit.analyzers" Version="1.22.0" />
<GlobalPackageReference Include="xunit.analyzers" Version="1.24.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="JetBrains.ExternalAnnotations" Version="10.2.162" />
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageVersion Include="JetBrains.ExternalAnnotations" Version="10.2.163" />
<PackageVersion Include="JetBrains.Annotations" Version="2025.2.2" />
<PackageVersion Include="JetBrains.dotCover.CommandLineTools" Version="2024.3.8" />
<PackageVersion Include="JetBrains.ReSharper.GlobalTools" Version="2024.3.8" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
<PackageVersion Include="Microsoft.Build" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.9.1" />
<PackageVersion Include="Microsoft.Build" Version="17.14.8" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.14.8" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.14.8" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.14.8" />
<PackageVersion Include="LibGit2Sharp" Version="0.31.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.6" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.8" />

<PackageVersion Include="Buildalyzer" Version="7.1.0" />
<PackageVersion Include="GitVersion.Tool" Version="6.3.0" />
Expand All @@ -42,18 +42,18 @@
<PackageVersion Include="ReportGenerator" Version="5.4.8" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="9.0.2" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="System.Collections.Immutable" Version="9.0.6" />
<PackageVersion Include="System.Collections.Immutable" Version="9.0.8" />
<!-- <PackageVersion Include="System.Interactive" Version="6.0.1" />-->
<PackageVersion Include="System.Interactive.Async" Version="6.0.3" />
<PackageVersion Include="Bogus" Version="35.6.3" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.13.0" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="17.14.1" />
<PackageVersion Include="FakeItEasy" Version="8.3.0" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Rocket.Surgery.Extensions.Testing.FakeItEasy" Version="9.0.5" />
<PackageVersion Include="Rocket.Surgery.Extensions.Testing.XUnit" Version="9.0.5" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
</ItemGroup>
<Import
Project="$(MSBuildThisFileDirectory)/Directory.Packages.support.props"
Expand Down
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"sdk": {
"rollForward": "latestMinor",
"version": "9.0.301"
"allowPrerelease": true,
"version": "10.0.100-preview.7.25380.108"
}
}
Binary file added src/Nuke/.DS_Store
Binary file not shown.
49 changes: 16 additions & 33 deletions src/Nuke/Arguments.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text;

using Nuke.Common.Tooling;

namespace Rocket.Surgery.Nuke;
Expand Down Expand Up @@ -47,16 +48,13 @@

argumentFormat = argumentFormat.Replace("{value}", "{0}");

string Format(T value)
{
return value.ToString().DoubleQuoteIfNeeded(separator, disallowed, Space);
}
string Format(T value) => value.ToString().DoubleQuoteIfNeeded(separator, disallowed, Space);

Check warning on line 51 in src/Nuke/Arguments.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

AddInternal(
argumentFormat,
separator.HasValue
? [FormatMultiple(list, Format, separator.Value, quoteMultiple)]
: list.Select(Format).ToArray()
: [.. list.Select(Format)]
);

return this;
Expand All @@ -77,25 +75,19 @@
var keyValueSeparator = itemFormat.Replace("{key}", "").Replace("{value}", "");
Assert.True(keyValueSeparator.Length == 1);

string Format(object value)
{
return value.ToString().DoubleQuoteIfNeeded(separator, keyValueSeparator.Single(), disallowed, Space);
}
string Format(object value) => value.ToString().DoubleQuoteIfNeeded(separator, keyValueSeparator.Single(), disallowed, Space);

string FormatPair(KeyValuePair<TKey, TValue> pair)
{
return itemFormat
.Replace("{key}", Format(pair!.Key))
.Replace("{value}", Format(pair!.Value));
}
string FormatPair(KeyValuePair<TKey, TValue> pair) => itemFormat
.Replace("{key}", Format(pair!.Key))

Check warning on line 81 in src/Nuke/Arguments.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'string Format(object value)'.
.Replace("{value}", Format(pair!.Value));

Check warning on line 82 in src/Nuke/Arguments.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'string Format(object value)'.

var pairs = dictionary.Where(x => x.Value is { }).ToList();

AddInternal(
argumentFormat,
separator.HasValue
? [FormatMultiple(pairs, FormatPair, separator.Value, quoteMultiple)]
: pairs.Select(FormatPair).ToArray()
: [.. pairs.Select(FormatPair)]
);

return this;
Expand All @@ -116,25 +108,19 @@
var listSeparator = itemFormat.Replace("{key}", "").Replace("{value}", "");
Assert.True(listSeparator.Length == 1);

string Format(object value)
{
return value?.ToString().DoubleQuoteIfNeeded(separator, listSeparator.Single(), disallowed, Space);
}
string Format(object value) => value?.ToString().DoubleQuoteIfNeeded(separator, listSeparator.Single(), disallowed, Space);

Check warning on line 111 in src/Nuke/Arguments.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference return.

string FormatLookup(TKey key, string values)
{
return itemFormat
.Replace("{key}", Format(key!))
.Replace("{value}", values);
}
string FormatLookup(TKey key, string values) => itemFormat
.Replace("{key}", Format(key!))
.Replace("{value}", values);

foreach (var list in lookup)
{
AddInternal(
argumentFormat,
separator.HasValue
? [FormatLookup(list.Key, FormatMultiple(list, x => Format(x!), separator.NotNull().Value, quoteMultiple))]

Check warning on line 122 in src/Nuke/Arguments.cs

View workflow job for this annotation

GitHub Actions / build

Nullable value type may be null.
: list.Select(x => FormatLookup(list.Key, Format(x!))).ToArray()
: [.. list.Select(x => FormatLookup(list.Key, Format(x!)))]
);
}

Expand Down Expand Up @@ -187,12 +173,9 @@

private string Render(bool forOutput)
{
string Format(string argument)
{
return !_secrets.Contains(argument) || !forOutput
? argument
: Redacted;
}
string Format(string argument) => !_secrets.Contains(argument) || !forOutput
? argument
: Redacted;

var builder = new StringBuilder();
foreach (var argumentPair in _arguments)
Expand Down
12 changes: 6 additions & 6 deletions src/Nuke/Azp/AzurePipelinesParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ namespace Rocket.Surgery.Nuke.Azp;
/// </summary>
public class AzurePipelinesParameter : ConfigurationEntity
{
/// <inheritdoc />
public override void Write(CustomFileWriter writer)
{
using var a = writer.WriteBlock($"{Name}: '{Default}'");
}

// ReSharper disable once NullableWarningSuppressionIsUsed
/// <summary>
/// The parameter name
Expand All @@ -19,10 +25,4 @@ public class AzurePipelinesParameter : ConfigurationEntity
/// The default name
/// </summary>
public string Default { get; set; } = null!;

/// <inheritdoc />
public override void Write(CustomFileWriter writer)
{
using var a = writer.WriteBlock($"{Name}: '{Default}'");
}
}
Loading
Loading