Skip to content

Commit b2387e6

Browse files
authored
Merge pull request #4316 from arturcic/main
cleanup code targeting < net8.0
2 parents cddb689 + 7eb9399 commit b2387e6

12 files changed

+90
-154
lines changed

src/GitVersion.Core/Polyfills/StringSyntaxAttribute.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010

11-
#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6
12-
namespace System.Diagnostics.CodeAnalysis
13-
{
14-
[global::System.AttributeUsage(
15-
global::System.AttributeTargets.Assembly |
16-
global::System.AttributeTargets.Class |
17-
global::System.AttributeTargets.Struct |
18-
global::System.AttributeTargets.Constructor |
19-
global::System.AttributeTargets.Method |
20-
global::System.AttributeTargets.Property |
21-
global::System.AttributeTargets.Event,
22-
Inherited = false, AllowMultiple = false)]
23-
internal sealed class ExcludeFromCodeCoverageAttribute : global::System.Attribute { }
24-
}
25-
#endif
26-
2711
[global::System.Runtime.CompilerServices.CompilerGenerated]
2812
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
2913
static class GitVersionInformation

src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldProperlyOutputNamespaceDeclaration.approved.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010

11-
#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6
12-
namespace System.Diagnostics.CodeAnalysis
13-
{
14-
[global::System.AttributeUsage(
15-
global::System.AttributeTargets.Assembly |
16-
global::System.AttributeTargets.Class |
17-
global::System.AttributeTargets.Struct |
18-
global::System.AttributeTargets.Constructor |
19-
global::System.AttributeTargets.Method |
20-
global::System.AttributeTargets.Property |
21-
global::System.AttributeTargets.Event,
22-
Inherited = false, AllowMultiple = false)]
23-
internal sealed class ExcludeFromCodeCoverageAttribute : global::System.Attribute { }
24-
}
25-
#endif
26-
2711
namespace My.Custom.Namespace
2812
{
2913
[global::System.Runtime.CompilerServices.CompilerGenerated]

src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010

11-
#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6
12-
namespace System.Diagnostics.CodeAnalysis
13-
14-
[<Sealed>]
15-
[<global.System.AttributeUsage(
16-
global.System.AttributeTargets.Assembly |||
17-
global.System.AttributeTargets.Class |||
18-
global.System.AttributeTargets.Struct |||
19-
global.System.AttributeTargets.Constructor |||
20-
global.System.AttributeTargets.Method |||
21-
global.System.AttributeTargets.Property |||
22-
global.System.AttributeTargets.Event,
23-
Inherited = false, AllowMultiple = false)>]
24-
type ExcludeFromCodeCoverageAttribute() = inherit global.System.Attribute()
25-
#endif
26-
2711
namespace global
2812

2913
[<AbstractClass; Sealed>]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
// GitVersion
5+
//
6+
// Changes to this file may cause incorrect behavior and will be lost if
7+
// the code is regenerated.
8+
// </auto-generated>
9+
//------------------------------------------------------------------------------
10+
11+
namespace My.Custom.Namespace
12+
13+
[<AbstractClass; Sealed>]
14+
[<global.System.Runtime.CompilerServices.CompilerGenerated>]
15+
[<global.System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage>]
16+
type GitVersionInformation =
17+
static member AssemblySemFileVer = "1.2.3.0"
18+
static member AssemblySemVer = "1.2.3.0"
19+
static member BranchName = "feature1"
20+
static member BuildMetaData = "5"
21+
static member CommitDate = "2014-03-06"
22+
static member CommitsSinceVersionSource = "5"
23+
static member EscapedBranchName = "feature1"
24+
static member FullBuildMetaData = "5.Branch.feature1.Sha.commitSha"
25+
static member FullSemVer = "1.2.3-unstable.4+5"
26+
static member InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha"
27+
static member Major = "1"
28+
static member MajorMinorPatch = "1.2.3"
29+
static member Minor = "2"
30+
static member Patch = "3"
31+
static member PreReleaseLabel = "unstable"
32+
static member PreReleaseLabelWithDash = "-unstable"
33+
static member PreReleaseNumber = "4"
34+
static member PreReleaseTag = "unstable.4"
35+
static member PreReleaseTagWithDash = "-unstable.4"
36+
static member SemVer = "1.2.3-unstable.4"
37+
static member Sha = "commitSha"
38+
static member ShortSha = "commitShortSha"
39+
static member UncommittedChanges = "0"
40+
static member VersionSourceSha = "versionSourceSha"
41+
static member WeightedPreReleaseNumber = "4"

src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@
88
' </auto-generated>
99
'------------------------------------------------------------------------------
1010

11-
#If NET20 OrElse NET35 OrElse NETCOREAPP1_0 OrElse NETCOREAPP1_1 OrElse NETSTANDARD1_0 OrElse NETSTANDARD1_1 OrElse NETSTANDARD1_2 OrElse NETSTANDARD1_3 OrElse NETSTANDARD1_4 OrElse NETSTANDARD1_5 OrElse NETSTANDARD1_6 Then
12-
Namespace Global.System.Diagnostics.CodeAnalysis
13-
<Global.System.AttributeUsage(
14-
Global.System.AttributeTargets.Assembly Or
15-
Global.System.AttributeTargets.Class Or
16-
Global.System.AttributeTargets.Struct Or
17-
Global.System.AttributeTargets.Constructor Or
18-
Global.System.AttributeTargets.Method Or
19-
Global.System.AttributeTargets.Property Or
20-
Global.System.AttributeTargets.Event, Inherited:=False, AllowMultiple:=False)>
21-
Friend NotInheritable Class ExcludeFromCodeCoverageAttribute
22-
Inherits Global.System.Attribute
23-
End Class
24-
End Namespace
25-
#End If
26-
2711
Namespace Global
2812

2913
<Global.System.Runtime.CompilerServices.CompilerGenerated()>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
'------------------------------------------------------------------------------
2+
' <auto-generated>
3+
' This code was generated by a tool.
4+
' GitVersion
5+
'
6+
' Changes to this file may cause incorrect behavior and will be lost if
7+
' the code is regenerated.
8+
' </auto-generated>
9+
'------------------------------------------------------------------------------
10+
11+
Namespace My.Custom.Namespace
12+
13+
<Global.System.Runtime.CompilerServices.CompilerGenerated()>
14+
<Global.System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage()>
15+
NotInheritable Class GitVersionInformation
16+
Private Sub New()
17+
End Sub
18+
Public Shared AssemblySemFileVer As String = "1.2.3.0"
19+
Public Shared AssemblySemVer As String = "1.2.3.0"
20+
Public Shared BranchName As String = "feature1"
21+
Public Shared BuildMetaData As String = "5"
22+
Public Shared CommitDate As String = "2014-03-06"
23+
Public Shared CommitsSinceVersionSource As String = "5"
24+
Public Shared EscapedBranchName As String = "feature1"
25+
Public Shared FullBuildMetaData As String = "5.Branch.feature1.Sha.commitSha"
26+
Public Shared FullSemVer As String = "1.2.3-unstable.4+5"
27+
Public Shared InformationalVersion As String = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha"
28+
Public Shared Major As String = "1"
29+
Public Shared MajorMinorPatch As String = "1.2.3"
30+
Public Shared Minor As String = "2"
31+
Public Shared Patch As String = "3"
32+
Public Shared PreReleaseLabel As String = "unstable"
33+
Public Shared PreReleaseLabelWithDash As String = "-unstable"
34+
Public Shared PreReleaseNumber As String = "4"
35+
Public Shared PreReleaseTag As String = "unstable.4"
36+
Public Shared PreReleaseTagWithDash As String = "-unstable.4"
37+
Public Shared SemVer As String = "1.2.3-unstable.4"
38+
Public Shared Sha As String = "commitSha"
39+
Public Shared ShortSha As String = "commitShortSha"
40+
Public Shared UncommittedChanges As String = "0"
41+
Public Shared VersionSourceSha As String = "versionSourceSha"
42+
Public Shared WeightedPreReleaseNumber As String = "4"
43+
End Class
44+
45+
End Namespace

src/GitVersion.Output.Tests/Output/GitVersionInfoGeneratorTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ public void ShouldCreateFile(string fileExtension)
5353
/// <summary>
5454
/// Regression test for issue #4196 (https://github.com/GitTools/GitVersion/issues/4196)
5555
/// </summary>
56-
[TestCase]
57-
public void ShouldProperlyOutputNamespaceDeclaration()
56+
[TestCase("cs")]
57+
[TestCase("fs")]
58+
[TestCase("vb")]
59+
public void ShouldProperlyOutputNamespaceDeclaration(string fileExtension)
5860
{
59-
const string fileExtension = "cs";
6061
const string targetNamespace = "My.Custom.Namespace";
6162

6263
var directory = PathHelper.Combine(PathHelper.GetTempPath(), "GitVersionInfoGeneratorTests", Guid.NewGuid().ToString());

src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,6 @@
77
// the code is regenerated.
88
// </auto-generated>
99
//------------------------------------------------------------------------------
10-
11-
#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6
12-
namespace System.Diagnostics.CodeAnalysis
13-
{{
14-
[global::System.AttributeUsage(
15-
global::System.AttributeTargets.Assembly |
16-
global::System.AttributeTargets.Class |
17-
global::System.AttributeTargets.Struct |
18-
global::System.AttributeTargets.Constructor |
19-
global::System.AttributeTargets.Method |
20-
global::System.AttributeTargets.Property |
21-
global::System.AttributeTargets.Event,
22-
Inherited = false, AllowMultiple = false)]
23-
internal sealed class ExcludeFromCodeCoverageAttribute : global::System.Attribute {{ }}
24-
}}
25-
#endif
2610
{1}{2}
2711
{4}[global::System.Runtime.CompilerServices.CompilerGenerated]
2812
{4}[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]

src/GitVersion.Output/GitVersionInfo/Templates/GitVersionInformation.fs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@
88
// </auto-generated>
99
//------------------------------------------------------------------------------
1010

11-
#if NET20 || NET35 || NETCOREAPP1_0 || NETCOREAPP1_1 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5 || NETSTANDARD1_6
12-
namespace System.Diagnostics.CodeAnalysis
13-
14-
[<Sealed>]
15-
[<global.System.AttributeUsage(
16-
global.System.AttributeTargets.Assembly |||
17-
global.System.AttributeTargets.Class |||
18-
global.System.AttributeTargets.Struct |||
19-
global.System.AttributeTargets.Constructor |||
20-
global.System.AttributeTargets.Method |||
21-
global.System.AttributeTargets.Property |||
22-
global.System.AttributeTargets.Event,
23-
Inherited = false, AllowMultiple = false)>]
24-
type ExcludeFromCodeCoverageAttribute() = inherit global.System.Attribute()
25-
#endif
26-
2711
namespace {1}
2812

2913
[<AbstractClass; Sealed>]

0 commit comments

Comments
 (0)