diff --git a/.editorconfig b/.editorconfig
index f199d80f9e..709cd532da 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -170,6 +170,9 @@ dotnet_diagnostic.rcs1037.severity = error
# RCS1036: Remove redundant empty line.
dotnet_diagnostic.rcs1036.severity = error
+dotnet_diagnostic.S2325.severity = none
+dotnet_diagnostic.S4136.severity = none
+
xml_space_before_self_closing = true
resharper_arrange_object_creation_when_type_not_evident_highlighting = none
diff --git a/.github/workflows/_unit_tests.yml b/.github/workflows/_unit_tests.yml
index 502f1d507e..286445f3bf 100644
--- a/.github/workflows/_unit_tests.yml
+++ b/.github/workflows/_unit_tests.yml
@@ -42,6 +42,6 @@ jobs:
-
name: Test Summary
uses: test-summary/action@v2.4
- if: ${{ always() && matrix.dotnet_version == '9.0' }}
+ if: ${{ always() && matrix.dotnet_version == '10.0' }}
with:
paths: artifacts/test-results/*.results.xml
diff --git a/build/.run/Artifacts DotnetTool Test.run.xml b/build/.run/Artifacts DotnetTool Test.run.xml
index ffb49db890..ac637febb2 100644
--- a/build/.run/Artifacts DotnetTool Test.run.xml
+++ b/build/.run/Artifacts DotnetTool Test.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Artifacts Executable Test.run.xml b/build/.run/Artifacts Executable Test.run.xml
index 85538064f0..6e783555c6 100644
--- a/build/.run/Artifacts Executable Test.run.xml
+++ b/build/.run/Artifacts Executable Test.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Artifacts MsBuildCore Test.run.xml b/build/.run/Artifacts MsBuildCore Test.run.xml
index 8478f08108..9c99fb04c5 100644
--- a/build/.run/Artifacts MsBuildCore Test.run.xml
+++ b/build/.run/Artifacts MsBuildCore Test.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Artifacts MsBuildFull Test.run.xml b/build/.run/Artifacts MsBuildFull Test.run.xml
index 537874156c..b7f3868d0f 100644
--- a/build/.run/Artifacts MsBuildFull Test.run.xml
+++ b/build/.run/Artifacts MsBuildFull Test.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Artifacts Native Test.run.xml b/build/.run/Artifacts Native Test.run.xml
index b7ea118f83..db24e6631a 100644
--- a/build/.run/Artifacts Native Test.run.xml
+++ b/build/.run/Artifacts Native Test.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Artifacts Prepare.run.xml b/build/.run/Artifacts Prepare.run.xml
index 43c9e42042..2ca9aae938 100644
--- a/build/.run/Artifacts Prepare.run.xml
+++ b/build/.run/Artifacts Prepare.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Artifacts Test.run.xml b/build/.run/Artifacts Test.run.xml
index b9807ea4a4..74ba913fd5 100644
--- a/build/.run/Artifacts Test.run.xml
+++ b/build/.run/Artifacts Test.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Build Docs.run.xml b/build/.run/Build Docs.run.xml
index 43431e74bb..06a7e06e57 100644
--- a/build/.run/Build Docs.run.xml
+++ b/build/.run/Build Docs.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Build Prepare.run.xml b/build/.run/Build Prepare.run.xml
index 2e820c42fe..11b58ba567 100644
--- a/build/.run/Build Prepare.run.xml
+++ b/build/.run/Build Prepare.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Build.run.xml b/build/.run/Build.run.xml
index e178484aae..0dc4e8dcaf 100644
--- a/build/.run/Build.run.xml
+++ b/build/.run/Build.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Clean.run.xml b/build/.run/Clean.run.xml
index d1c8841cc2..a868440dcb 100644
--- a/build/.run/Clean.run.xml
+++ b/build/.run/Clean.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Code Format.run.xml b/build/.run/Code Format.run.xml
index 560927676b..1766cb3588 100644
--- a/build/.run/Code Format.run.xml
+++ b/build/.run/Code Format.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Default Artifacts.run.xml b/build/.run/Default Artifacts.run.xml
index fe2a2c7a99..e4d3a3d141 100644
--- a/build/.run/Default Artifacts.run.xml
+++ b/build/.run/Default Artifacts.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Default Build.run.xml b/build/.run/Default Build.run.xml
index 6abaa465f3..e57f500364 100644
--- a/build/.run/Default Build.run.xml
+++ b/build/.run/Default Build.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Default Config.run.xml b/build/.run/Default Config.run.xml
index 1d2cb9fab3..110139461a 100644
--- a/build/.run/Default Config.run.xml
+++ b/build/.run/Default Config.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Default Docker.run.xml b/build/.run/Default Docker.run.xml
index 461aaa85bc..679c299eaf 100644
--- a/build/.run/Default Docker.run.xml
+++ b/build/.run/Default Docker.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Default Docs.run.xml b/build/.run/Default Docs.run.xml
index b4ea267b7b..c4e4f37498 100644
--- a/build/.run/Default Docs.run.xml
+++ b/build/.run/Default Docs.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Default Publish.run.xml b/build/.run/Default Publish.run.xml
index 03f349b259..0312d93626 100644
--- a/build/.run/Default Publish.run.xml
+++ b/build/.run/Default Publish.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Docker Build.run.xml b/build/.run/Docker Build.run.xml
index b2da1eadd5..dddb517c18 100644
--- a/build/.run/Docker Build.run.xml
+++ b/build/.run/Docker Build.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Docker Manifest.run.xml b/build/.run/Docker Manifest.run.xml
index deb625e045..7bac96983b 100644
--- a/build/.run/Docker Manifest.run.xml
+++ b/build/.run/Docker Manifest.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Docker Publish.run.xml b/build/.run/Docker Publish.run.xml
index 25a5f9d7a7..3bea5a43de 100644
--- a/build/.run/Docker Publish.run.xml
+++ b/build/.run/Docker Publish.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/Docker Test.run.xml b/build/.run/Docker Test.run.xml
index f7664d6759..d821ef967d 100644
--- a/build/.run/Docker Test.run.xml
+++ b/build/.run/Docker Test.run.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/build/.run/DockerHub Readme Publish.run.xml b/build/.run/DockerHub Readme Publish.run.xml
index 4ac6c97d64..dcae856c01 100644
--- a/build/.run/DockerHub Readme Publish.run.xml
+++ b/build/.run/DockerHub Readme Publish.run.xml
@@ -17,9 +17,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Generate Schemas.run.xml b/build/.run/Generate Schemas.run.xml
index e009ddc54a..cacf21449e 100644
--- a/build/.run/Generate Schemas.run.xml
+++ b/build/.run/Generate Schemas.run.xml
@@ -7,18 +7,20 @@
-
+
+
+
+
-
+
-
\ No newline at end of file
diff --git a/build/.run/Package Archive.run.xml b/build/.run/Package Archive.run.xml
index fa6cca1b56..bea73dddb4 100644
--- a/build/.run/Package Archive.run.xml
+++ b/build/.run/Package Archive.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Package Chocolatey.run.xml b/build/.run/Package Chocolatey.run.xml
index 88b86ef25c..85c6b81350 100644
--- a/build/.run/Package Chocolatey.run.xml
+++ b/build/.run/Package Chocolatey.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Package Nuget.run.xml b/build/.run/Package Nuget.run.xml
index 841a3a4fc8..b53ba74eb4 100644
--- a/build/.run/Package Nuget.run.xml
+++ b/build/.run/Package Nuget.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Package Prepare.run.xml b/build/.run/Package Prepare.run.xml
index 9c72d75e52..37df46f54a 100644
--- a/build/.run/Package Prepare.run.xml
+++ b/build/.run/Package Prepare.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Package.run.xml b/build/.run/Package.run.xml
index ecb147deb9..28628d18e8 100644
--- a/build/.run/Package.run.xml
+++ b/build/.run/Package.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Preview Docs.run.xml b/build/.run/Preview Docs.run.xml
index d0bd79cb9e..ddd3ea3588 100644
--- a/build/.run/Preview Docs.run.xml
+++ b/build/.run/Preview Docs.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Publish Chocolatey.run.xml b/build/.run/Publish Chocolatey.run.xml
index 1dae103da1..0dc1784c12 100644
--- a/build/.run/Publish Chocolatey.run.xml
+++ b/build/.run/Publish Chocolatey.run.xml
@@ -16,9 +16,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Publish Docs.run.xml b/build/.run/Publish Docs.run.xml
index 22ceca648b..520df9453c 100644
--- a/build/.run/Publish Docs.run.xml
+++ b/build/.run/Publish Docs.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Publish Nuget.run.xml b/build/.run/Publish Nuget.run.xml
index 1e1bb97cb2..60c309b33f 100644
--- a/build/.run/Publish Nuget.run.xml
+++ b/build/.run/Publish Nuget.run.xml
@@ -16,9 +16,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Publish Release.run.xml b/build/.run/Publish Release.run.xml
index a6b1e66b5a..683971553a 100644
--- a/build/.run/Publish Release.run.xml
+++ b/build/.run/Publish Release.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/PublishCoverage.run.xml b/build/.run/PublishCoverage.run.xml
index 1b2c752e41..e9b2e989db 100644
--- a/build/.run/PublishCoverage.run.xml
+++ b/build/.run/PublishCoverage.run.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/build/.run/SetMatrix.run.xml b/build/.run/SetMatrix.run.xml
index 2ee4920e9a..b493f9b517 100644
--- a/build/.run/SetMatrix.run.xml
+++ b/build/.run/SetMatrix.run.xml
@@ -12,9 +12,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/Test.run.xml b/build/.run/Test.run.xml
index 2a2db6d92e..189aad3587 100644
--- a/build/.run/Test.run.xml
+++ b/build/.run/Test.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/UnitTest (8.0).run.xml b/build/.run/UnitTest (8.0).run.xml
index 2c39db1e1c..dfeefaa35d 100644
--- a/build/.run/UnitTest (8.0).run.xml
+++ b/build/.run/UnitTest (8.0).run.xml
@@ -1,20 +1,26 @@
-
+
-
+
-
+
+
+
+
+
+
+
-
+
-
+
\ No newline at end of file
diff --git a/build/.run/UnitTest (9.0).run.xml b/build/.run/UnitTest (9.0).run.xml
index e9702af0a9..9b6dbafd7b 100644
--- a/build/.run/UnitTest (9.0).run.xml
+++ b/build/.run/UnitTest (9.0).run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/.run/UnitTest (Lts Latest).run.xml b/build/.run/UnitTest (Lts Latest).run.xml
new file mode 100644
index 0000000000..d10fff56d7
--- /dev/null
+++ b/build/.run/UnitTest (Lts Latest).run.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build/.run/Validate Version.run.xml b/build/.run/Validate Version.run.xml
index 527061c25e..fc7fc77ccd 100644
--- a/build/.run/Validate Version.run.xml
+++ b/build/.run/Validate Version.run.xml
@@ -15,9 +15,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/build/Directory.Build.props b/build/Directory.Build.props
index 9b2f07e792..717a7004bf 100644
--- a/build/Directory.Build.props
+++ b/build/Directory.Build.props
@@ -1,7 +1,7 @@
Exe
- net9.0
+ net10.0
$(MSBuildProjectDirectory)
..\..\run\
false
diff --git a/build/common/Utilities/Constants.cs b/build/common/Utilities/Constants.cs
index 49eac5f818..2a6ad5f6ff 100644
--- a/build/common/Utilities/Constants.cs
+++ b/build/common/Utilities/Constants.cs
@@ -6,8 +6,8 @@ public static class Constants
public const string RepoOwner = "GitTools";
public const string Repository = "GitVersion";
- public const string DotnetLtsLatest = "8.0";
- public static readonly string[] DotnetVersions = [DotnetLtsLatest, "9.0"];
+ public const string DotnetLtsLatest = "10.0";
+ public static readonly string[] DotnetVersions = [DotnetLtsLatest, "9.0", "8.0"];
public const string DefaultBranch = "main";
public const string DefaultConfiguration = "Release";
@@ -30,7 +30,7 @@ public static class Constants
public const string FedoraLatest = "fedora.42";
public const string UbuntuLatest = "ubuntu.24.04";
- public const string DockerDistroLatest = DebianLatest;
+ public const string DockerDistroLatest = UbuntuLatest;
public static readonly string[] DockerDistros =
[
diff --git a/docs/input/docs/usage/msbuild.md b/docs/input/docs/usage/msbuild.md
index 5cacea82fd..b183cdf278 100644
--- a/docs/input/docs/usage/msbuild.md
+++ b/docs/input/docs/usage/msbuild.md
@@ -239,7 +239,7 @@ If you want to override the target framework that GitVersion uses to determine t
```xml
...
- net8.0
+ net10.0
...
```
diff --git a/new-cli/.run/Calculate.run.xml b/new-cli/.run/Calculate.run.xml
index 018cb7f4fc..49ed2806d4 100644
--- a/new-cli/.run/Calculate.run.xml
+++ b/new-cli/.run/Calculate.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Config Help.run.xml b/new-cli/.run/Config Help.run.xml
index 4e0be82dd7..c1364f1f17 100644
--- a/new-cli/.run/Config Help.run.xml
+++ b/new-cli/.run/Config Help.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Config Init.run.xml b/new-cli/.run/Config Init.run.xml
index f188a379c1..d23d840cf4 100644
--- a/new-cli/.run/Config Init.run.xml
+++ b/new-cli/.run/Config Init.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Config Show.run.xml b/new-cli/.run/Config Show.run.xml
index 72e1fdcd29..2f42e2fb96 100644
--- a/new-cli/.run/Config Show.run.xml
+++ b/new-cli/.run/Config Show.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Help.run.xml b/new-cli/.run/Help.run.xml
index 1baa8e5ef1..0e04d9b19b 100644
--- a/new-cli/.run/Help.run.xml
+++ b/new-cli/.run/Help.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Normalize.run.xml b/new-cli/.run/Normalize.run.xml
index f77ee611de..409877c7bd 100644
--- a/new-cli/.run/Normalize.run.xml
+++ b/new-cli/.run/Normalize.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Output AssemblyInfo.run.xml b/new-cli/.run/Output AssemblyInfo.run.xml
index 514f75ccfe..9c0fec9e66 100644
--- a/new-cli/.run/Output AssemblyInfo.run.xml
+++ b/new-cli/.run/Output AssemblyInfo.run.xml
@@ -1,6 +1,6 @@
-
+
@@ -12,9 +12,9 @@
-
+
-
\ No newline at end of file
+
diff --git a/new-cli/.run/Output Help.run.xml b/new-cli/.run/Output Help.run.xml
index eb86159ea7..88eee97bf0 100644
--- a/new-cli/.run/Output Help.run.xml
+++ b/new-cli/.run/Output Help.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Output Project.run.xml b/new-cli/.run/Output Project.run.xml
index 23976608fd..eaa5556d42 100644
--- a/new-cli/.run/Output Project.run.xml
+++ b/new-cli/.run/Output Project.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/Output Wix.run.xml b/new-cli/.run/Output Wix.run.xml
index 7c35b9079a..b1deb9978b 100644
--- a/new-cli/.run/Output Wix.run.xml
+++ b/new-cli/.run/Output Wix.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/.run/TestCommand.run.xml b/new-cli/.run/TestCommand.run.xml
index 6d8c05c0fb..1b005c19e9 100644
--- a/new-cli/.run/TestCommand.run.xml
+++ b/new-cli/.run/TestCommand.run.xml
@@ -1,23 +1,21 @@
-
+
-
-
+
-
-
-
-
+
+
+
diff --git a/new-cli/.run/Tester.run.xml b/new-cli/.run/Tester.run.xml
index d59e277cea..8c1cfab800 100644
--- a/new-cli/.run/Tester.run.xml
+++ b/new-cli/.run/Tester.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
-
+
+
+
+
-
-
+
+
diff --git a/new-cli/.run/Version.run.xml b/new-cli/.run/Version.run.xml
index 1c5607e906..9db7b44afd 100644
--- a/new-cli/.run/Version.run.xml
+++ b/new-cli/.run/Version.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
-
-
+
+
+
diff --git a/new-cli/Directory.Build.props b/new-cli/Directory.Build.props
index 986cfabbd7..acf633afc1 100644
--- a/new-cli/Directory.Build.props
+++ b/new-cli/Directory.Build.props
@@ -1,12 +1,12 @@
- net9.0
+ net10.0
GitVersion
latest
enable
enable
- 8625;2254;IDE0005
+ $(NoWarn);CS8625;CS2254;IDE0005
en
true
diff --git a/new-cli/GitVersion.Cli.Generator.Tests/Extensions.cs b/new-cli/GitVersion.Cli.Generator.Tests/Extensions.cs
new file mode 100644
index 0000000000..cbab2336a9
--- /dev/null
+++ b/new-cli/GitVersion.Cli.Generator.Tests/Extensions.cs
@@ -0,0 +1,12 @@
+using Microsoft.CodeAnalysis.Testing;
+
+namespace GitVersion.Cli.Generator.Tests;
+
+public static class Extensions
+{
+ extension(ReferenceAssemblies)
+ {
+ public static ReferenceAssemblies Net10 =>
+ new("net10.0", new PackageIdentity("Microsoft.NETCore.App.Ref", "10.0.0"), Path.Combine("ref", "net10.0"));
+ }
+}
diff --git a/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj b/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj
index 13dd134bbf..9478d94c71 100644
--- a/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj
+++ b/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj
@@ -1,6 +1,17 @@
+
+ true
+ true
+
+
+ true
+
+ Exe
GitVersion.Cli.Generator.Tests
false
@@ -10,7 +21,6 @@
-
diff --git a/new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs b/new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs
index 6e3775e48d..389466ebbe 100644
--- a/new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs
+++ b/new-cli/GitVersion.Cli.Generator.Tests/SystemCommandlineGeneratorTests.cs
@@ -252,7 +252,7 @@ public async Task ValidateGeneratedCommandImplementation()
(generatorType,"RootCommandImpl.g.cs", ExpectedRootCommandImplText),
(generatorType,"CliAppImpl.g.cs", ExpectedCliAppImplText),
},
- ReferenceAssemblies = ReferenceAssemblies.Net.Net90,
+ ReferenceAssemblies = ReferenceAssemblies.Net10,
AdditionalReferences =
{
MetadataReference.CreateFromFile(typeof(ILogger).Assembly.Location),
diff --git a/new-cli/GitVersion.Cli.Generator/RoslynExtensions.cs b/new-cli/GitVersion.Cli.Generator/RoslynExtensions.cs
index fe83125599..d4eef6817e 100644
--- a/new-cli/GitVersion.Cli.Generator/RoslynExtensions.cs
+++ b/new-cli/GitVersion.Cli.Generator/RoslynExtensions.cs
@@ -2,30 +2,36 @@ namespace GitVersion;
public static class RoslynExtensions
{
- private static IEnumerable GetBaseTypesAndThis(this ITypeSymbol type)
+ extension(ITypeSymbol type)
{
- var current = type;
- while (current != null)
+ private IEnumerable GetBaseTypesAndThis()
{
- yield return current;
- current = current.BaseType;
+ var current = type;
+ while (current != null)
+ {
+ yield return current;
+ current = current.BaseType;
+ }
}
- }
- public static IEnumerable GetBaseTypes(this ITypeSymbol type)
- {
- var current = type.BaseType;
- while (current != null)
+ public IEnumerable GetBaseTypes()
{
- yield return current;
- current = current.BaseType;
+ var current = type.BaseType;
+ while (current != null)
+ {
+ yield return current;
+ current = current.BaseType;
+ }
}
- }
- public static IEnumerable GetAllMembers(this ITypeSymbol type) where T : ISymbol
- => type.GetBaseTypesAndThis().SelectMany(n => n.GetMembers().OfType());
+ public IEnumerable GetAllMembers() where T : ISymbol
+ => type.GetBaseTypesAndThis().SelectMany(n => n.GetMembers().OfType());
+ }
- public static AttributeData? GetAttributeData(this ISymbol namedType, string fullName)
- => namedType.GetAttributes()
- .SingleOrDefault(a => a.AttributeClass?.OriginalDefinition.ToDisplayString() == fullName);
+ extension(ISymbol namedType)
+ {
+ public AttributeData? GetAttributeData(string fullName)
+ => namedType.GetAttributes()
+ .SingleOrDefault(a => a.AttributeClass?.OriginalDefinition.ToDisplayString() == fullName);
+ }
}
diff --git a/new-cli/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs b/new-cli/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs
index e7e5ac36a9..0b9bfdf52a 100644
--- a/new-cli/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs
+++ b/new-cli/GitVersion.Core/Extensions/ServiceCollectionExtensions.cs
@@ -6,18 +6,21 @@ namespace GitVersion.Extensions;
public static class ServiceCollectionExtensions
{
- public static IServiceCollection RegisterModules(this IServiceCollection services, IEnumerable gitVersionModules)
- => gitVersionModules.Aggregate(services, (current, gitVersionModule) => gitVersionModule.RegisterTypes(current));
-
- public static IServiceCollection RegisterLogging(this IServiceCollection services)
+ extension(IServiceCollection services)
{
- services.AddLogging(builder =>
+ public IServiceCollection RegisterModules(IEnumerable gitVersionModules)
+ => gitVersionModules.Aggregate(services, (current, gitVersionModule) => gitVersionModule.RegisterTypes(current));
+
+ public IServiceCollection RegisterLogging()
{
- var logger = CreateLogger();
- builder.AddSerilog(logger, dispose: true);
- });
+ services.AddLogging(builder =>
+ {
+ var logger = CreateLogger();
+ builder.AddSerilog(logger, dispose: true);
+ });
- return services;
+ return services;
+ }
}
private static Serilog.Core.Logger CreateLogger()
diff --git a/qodana.yaml b/qodana.yaml
index 3385aa8609..0628d209ff 100644
--- a/qodana.yaml
+++ b/qodana.yaml
@@ -112,7 +112,7 @@ exclude:
#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
bootstrap: curl -fsSL https://dot.net/v1/dotnet-install.sh | bash -s -- --jsonfile /data/project/global.json -i /usr/share/dotnet && dotnet build src/GitVersion.slnx
dotnet:
- frameworks: net8.0;net9.0
+ frameworks: net8.0;net9.0;net10.0
solution: src/GitVersion.slnx
#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
diff --git a/src/.run/cli (help).run.xml b/src/.run/cli (help).run.xml
index 38d1df084c..a8457356e3 100644
--- a/src/.run/cli (help).run.xml
+++ b/src/.run/cli (help).run.xml
@@ -1,18 +1,21 @@
-
+
-
+
-
+
+
+
+
-
+
-
+
diff --git a/src/.run/cli (showconfig).run.xml b/src/.run/cli (showconfig).run.xml
index ef335cde5a..3201347d14 100644
--- a/src/.run/cli (showconfig).run.xml
+++ b/src/.run/cli (showconfig).run.xml
@@ -1,18 +1,21 @@
-
+
-
+
-
+
+
+
+
-
+
-
+
diff --git a/src/.run/cli (version).run.xml b/src/.run/cli (version).run.xml
index 023092b8a6..9afb33fcc3 100644
--- a/src/.run/cli (version).run.xml
+++ b/src/.run/cli (version).run.xml
@@ -1,18 +1,21 @@
-
+
-
+
+
+
+
-
+
-
+
diff --git a/src/.run/cli.run.xml b/src/.run/cli.run.xml
index 5721110b54..150a725934 100644
--- a/src/.run/cli.run.xml
+++ b/src/.run/cli.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
-
+
+
+
+
-
+
diff --git a/src/.run/schema.run.xml b/src/.run/schema.run.xml
index 263e4061bb..ef06b18565 100644
--- a/src/.run/schema.run.xml
+++ b/src/.run/schema.run.xml
@@ -1,18 +1,21 @@
-
+
-
+
-
+
+
+
+
-
+
-
+
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 1249fad91a..504f1ea51b 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -1,6 +1,6 @@
- net8.0;net9.0
+ net8.0;net9.0;net10.0
$([System.DateTime]::Today.Year)
GitTools and Contributors
@@ -19,6 +19,7 @@
git
$(NoWarn);NU1701;1591,8618,SYSLIB10;EnableGenerateDocumentationFile
+ $(NoWarn);CS8604;CS8620
$(WarningsAsErrors);RS0016;RS0017;RS0022;RS0024;RS0025;RS0026;RS0027
embedded
diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
index 307f97342f..fa3709448c 100644
--- a/src/Directory.Packages.props
+++ b/src/Directory.Packages.props
@@ -6,6 +6,7 @@
+
@@ -39,6 +40,7 @@
+
diff --git a/src/GitVersion.App/ArgumentParserExtensions.cs b/src/GitVersion.App/ArgumentParserExtensions.cs
index 852773f941..073983b420 100644
--- a/src/GitVersion.App/ArgumentParserExtensions.cs
+++ b/src/GitVersion.App/ArgumentParserExtensions.cs
@@ -8,75 +8,80 @@ internal static class ArgumentParserExtensions
private static readonly string[] TrueValues = ["1", "true"];
private static readonly string[] FalseValues = ["0", "false"];
- public static bool IsTrue(this string? value) => TrueValues.Contains(value, StringComparer.OrdinalIgnoreCase);
-
- public static bool IsFalse(this string? value) => FalseValues.Contains(value, StringComparer.OrdinalIgnoreCase);
-
- public static bool IsValidPath(this string? path)
+ extension(string? value)
{
- if (path == null)
- return false;
+ public bool IsTrue() => TrueValues.Contains(value, StringComparer.OrdinalIgnoreCase);
+ public bool IsFalse() => FalseValues.Contains(value, StringComparer.OrdinalIgnoreCase);
- try
- {
- _ = FileSystemHelper.Path.GetFullPath(path);
- }
- catch
+ public bool IsValidPath()
{
- path = FileSystemHelper.Path.Combine(SysEnv.CurrentDirectory, path);
+ if (value == null)
+ return false;
try
{
- _ = FileSystemHelper.Path.GetFullPath(path);
+ _ = FileSystemHelper.Path.GetFullPath(value);
}
catch
{
- return false;
+ value = FileSystemHelper.Path.Combine(SysEnv.CurrentDirectory, value);
+
+ try
+ {
+ _ = FileSystemHelper.Path.GetFullPath(value);
+ }
+ catch (Exception)
+ {
+ return false;
+ }
}
- }
- return FileSystemHelper.Directory.Exists(path);
- }
-
- public static bool IsSwitchArgument(this string? value)
- {
- var patternRegex = RegexPatterns.Common.SwitchArgumentRegex();
- return value != null
- && (value.StartsWith('-') || value.StartsWith('/'))
- && !patternRegex.Match(value).Success;
- //Exclude msbuild & project parameters in form /blah:, which should be parsed as values, not switch names.
- }
-
- public static bool IsSwitch(this string? value, string switchName)
- {
- if (value == null)
- return false;
+ return FileSystemHelper.Directory.Exists(value);
+ }
- if (value.StartsWith('-'))
+ public bool IsSwitchArgument()
{
- value = value[1..];
+ var patternRegex = RegexPatterns.Common.SwitchArgumentRegex();
+ return value != null
+ && (value.StartsWith('-') || value.StartsWith('/'))
+ && !patternRegex.Match(value).Success;
+ //Exclude msbuild & project parameters in form /blah:, which should be parsed as values, not switch names.
}
- if (value.StartsWith('/'))
+ public bool IsSwitch(string switchName)
{
- value = value[1..];
- }
+ if (value == null)
+ return false;
- return string.Equals(switchName, value, StringComparison.OrdinalIgnoreCase);
- }
+ if (value.StartsWith('-'))
+ {
+ value = value[1..];
+ }
+
+ if (value.StartsWith('/'))
+ {
+ value = value[1..];
+ }
- public static bool IsHelp(this string singleArgument) => (singleArgument == "?") || singleArgument.IsSwitch("h") || singleArgument.IsSwitch("help") || singleArgument.IsSwitch("?");
+ return string.Equals(switchName, value, StringComparison.OrdinalIgnoreCase);
+ }
+ }
- public static bool ArgumentRequiresValue(this string argument, int argumentIndex)
+ extension(string singleArgument)
{
- var booleanArguments = new[] { "updateassemblyinfo", "ensureassemblyinfo", "nofetch", "nonormalize", "nocache", "allowshallow" };
+ public bool IsHelp() => (singleArgument == "?") || singleArgument.IsSwitch("h") || singleArgument.IsSwitch("help") || singleArgument.IsSwitch("?");
- var argumentMightRequireValue = !booleanArguments.Contains(argument[1..], StringComparer.OrdinalIgnoreCase);
+ public bool ArgumentRequiresValue(int argumentIndex)
+ {
+ var booleanArguments = new[] { "updateassemblyinfo", "ensureassemblyinfo", "nofetch", "nonormalize", "nocache", "allowshallow" };
- // If this is the first argument that might be a target path, the argument starts with slash, and we're on an OS that supports paths with slashes, the argument does not require a value.
- if (argumentMightRequireValue && argumentIndex == 0 && argument.StartsWith('/') && FileSystemHelper.Path.DirectorySeparatorChar == '/' && argument.IsValidPath())
- return false;
+ var argumentMightRequireValue = !booleanArguments.Contains(singleArgument[1..], StringComparer.OrdinalIgnoreCase);
- return argumentMightRequireValue;
+ // If this is the first argument that might be a target path, the argument starts with slash, and we're on an OS that supports paths with slashes, the argument does not require a value.
+ if (argumentMightRequireValue && argumentIndex == 0 && singleArgument.StartsWith('/') && FileSystemHelper.Path.DirectorySeparatorChar == '/' && singleArgument.IsValidPath())
+ return false;
+
+ return argumentMightRequireValue;
+ }
}
}
diff --git a/src/GitVersion.App/FileSystemGlobbing/MatcherExtensions.cs b/src/GitVersion.App/FileSystemGlobbing/MatcherExtensions.cs
index fa568b712b..1d8db805f4 100644
--- a/src/GitVersion.App/FileSystemGlobbing/MatcherExtensions.cs
+++ b/src/GitVersion.App/FileSystemGlobbing/MatcherExtensions.cs
@@ -5,71 +5,66 @@ namespace GitVersion.FileSystemGlobbing;
internal static class MatcherExtensions
{
- public static PatternMatchingResult Execute(
- this Matcher matcher,
- IFileSystem fileSystem,
- string directoryPath
- )
+ extension(Matcher matcher)
{
- ArgumentNullException.ThrowIfNull(matcher);
- ArgumentNullException.ThrowIfNull(fileSystem);
+ public PatternMatchingResult Execute(IFileSystem fileSystem,
+ string directoryPath
+ )
+ {
+ ArgumentNullException.ThrowIfNull(matcher);
+ ArgumentNullException.ThrowIfNull(fileSystem);
- return Execute(matcher, fileSystem, fileSystem.DirectoryInfo.New(directoryPath));
- }
+ return Execute(matcher, fileSystem, fileSystem.DirectoryInfo.New(directoryPath));
+ }
- private static PatternMatchingResult Execute(
- this Matcher matcher,
- IFileSystem fileSystem,
- IDirectoryInfo directoryInfo
- )
- {
- ArgumentNullException.ThrowIfNull(matcher);
- ArgumentNullException.ThrowIfNull(fileSystem);
- ArgumentNullException.ThrowIfNull(directoryInfo);
+ private PatternMatchingResult Execute(IFileSystem fileSystem,
+ IDirectoryInfo directoryInfo
+ )
+ {
+ ArgumentNullException.ThrowIfNull(matcher);
+ ArgumentNullException.ThrowIfNull(fileSystem);
+ ArgumentNullException.ThrowIfNull(directoryInfo);
- return matcher.Execute(new DirectoryInfoGlobbingWrapper(fileSystem, directoryInfo));
- }
+ return matcher.Execute(new DirectoryInfoGlobbingWrapper(fileSystem, directoryInfo));
+ }
- public static IEnumerable GetResultsInFullPath(
- this Matcher matcher,
- IFileSystem fileSystem,
- string directoryPath
- )
- {
- ArgumentNullException.ThrowIfNull(matcher);
- ArgumentNullException.ThrowIfNull(fileSystem);
+ public IEnumerable GetResultsInFullPath(IFileSystem fileSystem,
+ string directoryPath
+ )
+ {
+ ArgumentNullException.ThrowIfNull(matcher);
+ ArgumentNullException.ThrowIfNull(fileSystem);
- return GetResultsInFullPath(
- matcher,
- fileSystem,
- fileSystem.DirectoryInfo.New(directoryPath)
- );
- }
+ return GetResultsInFullPath(
+ matcher,
+ fileSystem,
+ fileSystem.DirectoryInfo.New(directoryPath)
+ );
+ }
- private static IEnumerable GetResultsInFullPath(
- this Matcher matcher,
- IFileSystem fileSystem,
- IDirectoryInfo directoryInfo
- )
- {
- ArgumentNullException.ThrowIfNull(matcher);
- ArgumentNullException.ThrowIfNull(fileSystem);
- ArgumentNullException.ThrowIfNull(directoryInfo);
+ private IEnumerable GetResultsInFullPath(IFileSystem fileSystem,
+ IDirectoryInfo directoryInfo
+ )
+ {
+ ArgumentNullException.ThrowIfNull(matcher);
+ ArgumentNullException.ThrowIfNull(fileSystem);
+ ArgumentNullException.ThrowIfNull(directoryInfo);
- var matches = Execute(matcher, fileSystem, directoryInfo);
+ var matches = Execute(matcher, fileSystem, directoryInfo);
- if (!matches.HasMatches)
- {
- return EmptyStringsEnumerable;
- }
+ if (!matches.HasMatches)
+ {
+ return EmptyStringsEnumerable;
+ }
- var fsPath = fileSystem.Path;
- var directoryFullName = directoryInfo.FullName;
+ var fsPath = fileSystem.Path;
+ var directoryFullName = directoryInfo.FullName;
- return matches.Files.Select(GetFullPath);
+ return matches.Files.Select(GetFullPath);
- string GetFullPath(FilePatternMatch match) =>
- fsPath.GetFullPath(fsPath.Combine(directoryFullName, match.Path));
+ string GetFullPath(FilePatternMatch match) =>
+ fsPath.GetFullPath(fsPath.Combine(directoryFullName, match.Path));
+ }
}
private static readonly IEnumerable EmptyStringsEnumerable = [];
diff --git a/src/GitVersion.Configuration.Tests/Configuration/Extensions.cs b/src/GitVersion.Configuration.Tests/Configuration/Extensions.cs
index dafc7c5ce0..e8c971a253 100644
--- a/src/GitVersion.Configuration.Tests/Configuration/Extensions.cs
+++ b/src/GitVersion.Configuration.Tests/Configuration/Extensions.cs
@@ -6,22 +6,25 @@ namespace GitVersion.Configuration.Tests.Configuration;
public static class Extensions
{
- public static IDisposable SetupConfigFile(this IFileSystem fileSystem, string? path = null, string fileName = ConfigurationFileLocator.DefaultFileName, string text = "")
+ extension(IFileSystem fileSystem)
{
- if (path.IsNullOrEmpty())
+ public IDisposable SetupConfigFile(string? path = null, string fileName = ConfigurationFileLocator.DefaultFileName, string text = "")
{
- path = FileSystemHelper.Path.GetRepositoryTempPath();
- }
+ if (path.IsNullOrEmpty())
+ {
+ path = FileSystemHelper.Path.GetRepositoryTempPath();
+ }
- var fullPath = FileSystemHelper.Path.Combine(path, fileName);
- var directory = FileSystemHelper.Path.GetDirectoryName(fullPath);
- if (!fileSystem.Directory.Exists(directory))
- {
- fileSystem.Directory.CreateDirectory(directory);
- }
+ var fullPath = FileSystemHelper.Path.Combine(path, fileName);
+ var directory = FileSystemHelper.Path.GetDirectoryName(fullPath);
+ if (!fileSystem.Directory.Exists(directory))
+ {
+ fileSystem.Directory.CreateDirectory(directory);
+ }
- fileSystem.File.WriteAllText(fullPath, text);
+ fileSystem.File.WriteAllText(fullPath, text);
- return Disposable.Create(fullPath, () => fileSystem.File.Delete(fullPath));
+ return Disposable.Create(fullPath, () => fileSystem.File.Delete(fullPath));
+ }
}
}
diff --git a/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs
index 74043662a3..dff0409f9c 100644
--- a/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs
+++ b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs
@@ -55,129 +55,147 @@ public static IBranch CreateMockBranch(string name, params ICommit[] commits)
return branch;
}
- public static void DiscoverRepository(this IServiceProvider sp)
+ extension(IServiceProvider sp)
{
- var gitRepository = sp.GetRequiredService();
- var gitRepositoryInfo = sp.GetRequiredService();
- gitRepository.DiscoverRepository(gitRepositoryInfo.GitRootPath);
+ public void DiscoverRepository()
+ {
+ var gitRepository = sp.GetRequiredService();
+ var gitRepositoryInfo = sp.GetRequiredService();
+ gitRepository.DiscoverRepository(gitRepositoryInfo.GitRootPath);
+ }
}
- public static IBranch FindBranch(this IGitRepository repository, string branchName)
- => repository.Branches.FirstOrDefault(branch => branch.Name.WithoutOrigin == branchName)
- ?? throw new GitVersionException($"Branch {branchName} not found");
+ extension(IGitRepository repository)
+ {
+ public IBranch FindBranch(string branchName)
+ => repository.Branches.FirstOrDefault(branch => branch.Name.WithoutOrigin == branchName)
+ ?? throw new GitVersionException($"Branch {branchName} not found");
- public static void DumpGraph(this IGitRepository repository, Action? writer = null, int? maxCommits = null)
- => DumpGraph(repository.Path, writer, maxCommits);
+ public void DumpGraph(Action? writer = null, int? maxCommits = null)
+ => DumpGraph(repository.Path, writer, maxCommits);
+ }
- public static void DumpGraph(this IRepository repository, Action? writer = null, int? maxCommits = null)
- => DumpGraph(repository.ToGitRepository().Path, writer, maxCommits);
+ extension(IRepository repository)
+ {
+ public void DumpGraph(Action? writer = null, int? maxCommits = null)
+ => DumpGraph(repository.ToGitRepository().Path, writer, maxCommits);
+ }
- public static void RenameRemote(this RemoteCollection remotes, string oldName, string newName)
+ extension(RemoteCollection remotes)
{
- if (oldName.IsEquivalentTo(newName)) return;
- if (remotes.Any(remote => remote.Name == newName))
- {
- throw new InvalidOperationException($"A remote with the name '{newName}' already exists.");
- }
- if (!remotes.Any(remote => remote.Name == oldName))
+ public void RenameRemote(string oldName, string newName)
{
- throw new InvalidOperationException($"A remote with the name '{oldName}' does not exist.");
+ if (oldName.IsEquivalentTo(newName)) return;
+ if (remotes.Any(remote => remote.Name == newName))
+ {
+ throw new InvalidOperationException($"A remote with the name '{newName}' already exists.");
+ }
+ if (remotes.All(remote => remote.Name != oldName))
+ {
+ throw new InvalidOperationException($"A remote with the name '{oldName}' does not exist.");
+ }
+ remotes.Add(newName, remotes[oldName].Url);
+ remotes.Remove(oldName);
}
- remotes.Add(newName, remotes[oldName].Url);
- remotes.Remove(oldName);
}
- public static GitVersionVariables GetVersion(this RepositoryFixtureBase fixture, IGitVersionConfiguration? configuration = null,
- IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null)
+ extension(RepositoryFixtureBase fixture)
{
- repository ??= fixture.Repository;
- configuration ??= GitFlowConfigurationBuilder.New.Build();
-
- var overrideConfiguration = new Dictionary
diff --git a/src/GitVersion.MsBuild/Helpers/AssemblyInfoFileHelper.cs b/src/GitVersion.MsBuild/Helpers/AssemblyInfoFileHelper.cs
index 5f96caead6..d177c6fee0 100644
--- a/src/GitVersion.MsBuild/Helpers/AssemblyInfoFileHelper.cs
+++ b/src/GitVersion.MsBuild/Helpers/AssemblyInfoFileHelper.cs
@@ -68,22 +68,25 @@ private static IEnumerable GetInvalidFiles(IFileSystem fileSystem, IEnum
.Where(compileFile => compileFile.Contains("AssemblyInfo"))
.Where(filePath => FileContainsVersionAttribute(fileSystem, filePath, projectFile));
- public static FileWriteInfo GetFileWriteInfo(this string? intermediateOutputPath, string language, string projectFile, string outputFileName)
+ extension(string? intermediateOutputPath)
{
- var fileExtension = GetFileExtension(language);
- string workingDirectory, fileName;
-
- if (intermediateOutputPath == null)
- {
- fileName = $"{outputFileName}_{FileSystemHelper.Path.GetFileNameWithoutExtension(projectFile)}_{FileSystemHelper.Path.GetRandomFileName()}.g.{fileExtension}";
- workingDirectory = TempPath;
- }
- else
+ public FileWriteInfo GetFileWriteInfo(string language, string projectFile, string outputFileName)
{
- fileName = $"{outputFileName}.g.{fileExtension}";
- workingDirectory = intermediateOutputPath;
+ var fileExtension = GetFileExtension(language);
+ string workingDirectory, fileName;
+
+ if (intermediateOutputPath == null)
+ {
+ fileName = $"{outputFileName}_{FileSystemHelper.Path.GetFileNameWithoutExtension(projectFile)}_{FileSystemHelper.Path.GetRandomFileName()}.g.{fileExtension}";
+ workingDirectory = TempPath;
+ }
+ else
+ {
+ fileName = $"{outputFileName}.g.{fileExtension}";
+ workingDirectory = intermediateOutputPath;
+ }
+
+ return new FileWriteInfo(workingDirectory, fileName, fileExtension);
}
-
- return new FileWriteInfo(workingDirectory, fileName, fileExtension);
}
}
diff --git a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets
index 680bf52a1a..b8f08113ea 100644
--- a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets
+++ b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets
@@ -11,7 +11,8 @@
net8.0
net9.0
-
+ net10.0
+
net8.0
dotnet --roll-forward Major "$([MSBuild]::EnsureTrailingSlash($(MSBuildThisFileDirectory)$(GitVersionTargetFramework)))gitversion.dll"
$([MSBuild]::EnsureTrailingSlash($(MSBuildThisFileDirectory)$(GitVersionTargetFramework)))GitVersion.MsBuild.dll
diff --git a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs
index aac07abadb..4f6a1fc3db 100644
--- a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs
+++ b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs
@@ -15,7 +15,7 @@ namespace GitVersion.Core.Tests;
[Parallelizable(ParallelScope.None)]
public class ProjectFileUpdaterTests : TestBase
{
- private const string TargetFramework = "net8.0";
+ private const string TargetFramework = "net10.0";
private IVariableProvider variableProvider;
private ILog log;
private IFileSystem fileSystem;
@@ -271,7 +271,7 @@ public void UpdateProjectFileAddsVersionToFile(string sdk, string projectName)
var xml = $"""
- net8.0
+ net10.0
""";
diff --git a/src/GitVersion.Schema/Extensions.cs b/src/GitVersion.Schema/Extensions.cs
index dac09a46c1..3768782454 100644
--- a/src/GitVersion.Schema/Extensions.cs
+++ b/src/GitVersion.Schema/Extensions.cs
@@ -6,14 +6,17 @@ namespace GitVersion.Schema;
internal static class Extensions
{
- public static void WriteToFile(this JsonSchema jsonSchema, string outputFileName)
+ extension(JsonSchema jsonSchema)
{
- var jsonDocument = jsonSchema.ToJsonDocument();
+ public void WriteToFile(string outputFileName)
+ {
+ var jsonDocument = jsonSchema.ToJsonDocument();
- using var fs = File.Create(outputFileName);
- using var writer = new Utf8JsonWriter(fs, new() { Indented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping });
- jsonDocument.WriteTo(writer);
- writer.Flush();
- fs.Flush();
+ using var fs = File.Create(outputFileName);
+ using var writer = new Utf8JsonWriter(fs, new() { Indented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping });
+ jsonDocument.WriteTo(writer);
+ writer.Flush();
+ fs.Flush();
+ }
}
}
diff --git a/src/GitVersion.Testing/Extensions/GitTestExtensions.cs b/src/GitVersion.Testing/Extensions/GitTestExtensions.cs
index 711d032fac..8a1c617627 100644
--- a/src/GitVersion.Testing/Extensions/GitTestExtensions.cs
+++ b/src/GitVersion.Testing/Extensions/GitTestExtensions.cs
@@ -8,64 +8,66 @@ public static class GitTestExtensions
{
private static int _pad = 1;
- public static Commit MakeACommit(this IRepository repository, string? commitMessage = null) => CreateFileAndCommit(repository, Guid.NewGuid().ToString(), commitMessage);
-
- public static void MergeNoFF(this IRepository repository, string branch) => MergeNoFF(repository, branch, Generate.SignatureNow());
-
- public static void MergeNoFF(this IRepository repository, string branch, Signature sig) => repository.Merge(repository.Branches[branch], sig, new MergeOptions
+ extension(IRepository repository)
{
- FastForwardStrategy = FastForwardStrategy.NoFastForward
- });
+ public Commit MakeACommit(string? commitMessage = null) => CreateFileAndCommit(repository, Guid.NewGuid().ToString(), commitMessage);
+ public void MergeNoFF(string branch) => MergeNoFF(repository, branch, Generate.SignatureNow());
- public static Commit[] MakeCommits(this IRepository repository, int numCommitsToMake)
- => [.. Enumerable.Range(1, numCommitsToMake).Select(_ => repository.MakeACommit())];
-
- private static Commit CreateFileAndCommit(this IRepository repository, string relativeFileName, string? commitMessage = null)
- {
- var randomFile = FileSystemHelper.Path.Combine(repository.Info.WorkingDirectory, relativeFileName);
- if (FileSystemHelper.File.Exists(randomFile))
+ public void MergeNoFF(string branch, Signature sig) => repository.Merge(repository.Branches[branch], sig, new MergeOptions
{
- FileSystemHelper.File.Delete(randomFile);
- }
+ FastForwardStrategy = FastForwardStrategy.NoFastForward
+ });
- var totalWidth = 36 + (_pad++ % 10);
- var contents = Guid.NewGuid().ToString().PadRight(totalWidth, '.');
- FileSystemHelper.File.WriteAllText(randomFile, contents);
+ public Commit[] MakeCommits(int numCommitsToMake)
+ => [.. Enumerable.Range(1, numCommitsToMake).Select(_ => repository.MakeACommit())];
- Commands.Stage(repository, randomFile);
+ private Commit CreateFileAndCommit(string relativeFileName, string? commitMessage = null)
+ {
+ var randomFile = FileSystemHelper.Path.Combine(repository.Info.WorkingDirectory, relativeFileName);
+ if (FileSystemHelper.File.Exists(randomFile))
+ {
+ FileSystemHelper.File.Delete(randomFile);
+ }
- return repository.Commit(commitMessage ?? $"Test Commit for file '{relativeFileName}'",
- Generate.SignatureNow(), Generate.SignatureNow());
- }
+ var totalWidth = 36 + (_pad++ % 10);
+ var contents = Guid.NewGuid().ToString().PadRight(totalWidth, '.');
+ FileSystemHelper.File.WriteAllText(randomFile, contents);
- public static Tag MakeATaggedCommit(this IRepository repository, string tag)
- {
- var commit = repository.MakeACommit();
- var existingTag = repository.Tags.SingleOrDefault(t => t.FriendlyName == tag);
- return existingTag ?? repository.Tags.Add(tag, commit);
- }
+ Commands.Stage(repository, randomFile);
- public static Commit CreatePullRequestRef(this IRepository repository, string from, string to, int prNumber = 2, bool normalise = false, bool allowFastForwardMerge = false)
- {
- Commands.Checkout(repository, repository.Branches[to].Tip);
- if (allowFastForwardMerge)
- {
- repository.Merge(repository.Branches[from], Generate.SignatureNow());
+ return repository.Commit(commitMessage ?? $"Test Commit for file '{relativeFileName}'",
+ Generate.SignatureNow(), Generate.SignatureNow());
}
- else
+
+ public Tag MakeATaggedCommit(string tag)
{
- repository.MergeNoFF(from);
+ var commit = repository.MakeACommit();
+ var existingTag = repository.Tags.SingleOrDefault(t => t.FriendlyName == tag);
+ return existingTag ?? repository.Tags.Add(tag, commit);
}
- var commit = repository.Head.Tip;
- repository.Refs.Add("refs/pull/" + prNumber + "/merge", commit.Id);
- Commands.Checkout(repository, to);
- if (normalise)
+
+ public Commit CreatePullRequestRef(string from, string to, int prNumber = 2, bool normalise = false, bool allowFastForwardMerge = false)
{
- // Turn the ref into a real branch
- Commands.Checkout(repository, repository.Branches.Add("pull/" + prNumber + "/merge", commit));
- }
+ Commands.Checkout(repository, repository.Branches[to].Tip);
+ if (allowFastForwardMerge)
+ {
+ repository.Merge(repository.Branches[from], Generate.SignatureNow());
+ }
+ else
+ {
+ repository.MergeNoFF(from);
+ }
+ var commit = repository.Head.Tip;
+ repository.Refs.Add("refs/pull/" + prNumber + "/merge", commit.Id);
+ Commands.Checkout(repository, to);
+ if (normalise)
+ {
+ // Turn the ref into a real branch
+ Commands.Checkout(repository, repository.Branches.Add("pull/" + prNumber + "/merge", commit));
+ }
- return commit;
+ return commit;
+ }
}
public static void ExecuteGitCmd(string gitCmd, string workingDirectory, Action? writer = null)
diff --git a/src/GitVersion.Testing/Extensions/StringExtensions.cs b/src/GitVersion.Testing/Extensions/StringExtensions.cs
index 1f4c15fae7..ed9bee0345 100644
--- a/src/GitVersion.Testing/Extensions/StringExtensions.cs
+++ b/src/GitVersion.Testing/Extensions/StringExtensions.cs
@@ -2,15 +2,18 @@ namespace GitVersion.Testing.Extensions;
public static class StringExtensions
{
- public static IEnumerable SplitIntoLines(this string str, int maxLineLength)
+ extension(string str)
{
- if (string.IsNullOrEmpty(str)) yield break;
-
- foreach (var line in SplitByNewlines(str))
+ public IEnumerable SplitIntoLines(int maxLineLength)
{
- foreach (var wrapped in WrapWithWordBoundaries(line, maxLineLength))
+ if (string.IsNullOrEmpty(str)) yield break;
+
+ foreach (var line in SplitByNewlines(str))
{
- yield return wrapped;
+ foreach (var wrapped in WrapWithWordBoundaries(line, maxLineLength))
+ {
+ yield return wrapped;
+ }
}
}
}
@@ -30,7 +33,7 @@ private static IEnumerable WrapWithWordBoundaries(string line, int maxLe
while (index < line.Length)
{
var wrapAt = GetWrapIndex(line, index, maxLength);
- yield return line.Substring(index, wrapAt - index).TrimEnd();
+ yield return line[index..wrapAt].TrimEnd();
index = wrapAt;
}
}
diff --git a/src/GitVersion.Testing/Helpers/StringBuilderExtensions.cs b/src/GitVersion.Testing/Helpers/StringBuilderExtensions.cs
index 2893be4336..71dcec96e7 100644
--- a/src/GitVersion.Testing/Helpers/StringBuilderExtensions.cs
+++ b/src/GitVersion.Testing/Helpers/StringBuilderExtensions.cs
@@ -4,12 +4,14 @@ namespace GitVersion.Testing.Internal;
internal static class StringBuilderExtensions
{
- public static void AppendLineFormat(this StringBuilder stringBuilder,
- [StringSyntax(StringSyntaxAttribute.CompositeFormat)]
- string format,
- params object?[] args)
+ extension(StringBuilder stringBuilder)
{
- stringBuilder.AppendFormat(format, args);
- stringBuilder.AppendLine();
+ public void AppendLineFormat([StringSyntax(StringSyntaxAttribute.CompositeFormat)]
+ string format,
+ params object?[] args)
+ {
+ stringBuilder.AppendFormat(format, args);
+ stringBuilder.AppendLine();
+ }
}
}
diff --git a/tests/scripts/test-msbuild-task.sh b/tests/scripts/test-msbuild-task.sh
index b75db70371..12c0a030b5 100644
--- a/tests/scripts/test-msbuild-task.sh
+++ b/tests/scripts/test-msbuild-task.sh
@@ -1,5 +1,5 @@
#!/usr/bin/sh
-# sh /scripts/test-msbuild-task.sh --version 6.0.0 --nugetPath /nuget --repoPath /repo/tests/integration --targetframework net8.0
+# sh /scripts/test-msbuild-task.sh --version 6.0.0 --nugetPath /nuget --repoPath /repo/tests/integration --targetframework net10.0
while test "$#" -gt 0
do
case $1 in