Skip to content

Commit 74bcce7

Browse files
committed
SemVer 2 support
1 parent 39153d3 commit 74bcce7

10 files changed

+16
-16
lines changed

AcceptanceTests/NoTagsInRepositorySpecification.RunSpecification.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":1,
44
"Patch":0,
55
"Suffix":"",
6-
"LongVersion":"0.1.0 Sha:'000000000000000000000000000000000000000'",
6+
"LongVersion":"0.1.0+Sha.000000000000000000000000000000000000000",
77
"NugetVersion":"0.1.0",
88
"ShortVersion":"0.1.0",
99
"BranchName":"master",

AcceptanceTests/NoTagsInRepositoryWithNextVersionTxtSpecification.RunSpecification.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":2,
44
"Patch":0,
55
"Suffix":"",
6-
"LongVersion":"0.2.0 Sha:'000000000000000000000000000000000000000'",
6+
"LongVersion":"0.2.0+Sha.000000000000000000000000000000000000000",
77
"NugetVersion":"0.2.0",
88
"ShortVersion":"0.2.0",
99
"BranchName":"master",

AcceptanceTests/TagFollowedByCommitsWithApplicableNextVersionTxtSpecification.ForOneCommit.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":1,
44
"Patch":0,
55
"Suffix":"",
6-
"LongVersion":"1.1.0 Sha:'000000000000000000000000000000000000000'",
6+
"LongVersion":"1.1.0+Sha.000000000000000000000000000000000000000",
77
"NugetVersion":"1.1.0",
88
"ShortVersion":"1.1.0",
99
"BranchName":"master",

AcceptanceTests/TagFollowedByCommitsWithApplicableNextVersionTxtSpecification.ForTenCommitsCommit.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":1,
44
"Patch":0,
55
"Suffix":"",
6-
"LongVersion":"1.1.0 Sha:'000000000000000000000000000000000000000'",
6+
"LongVersion":"1.1.0+Sha.000000000000000000000000000000000000000",
77
"NugetVersion":"1.1.0",
88
"ShortVersion":"1.1.0",
99
"BranchName":"master",

AcceptanceTests/TagFollowedByCommitsWithNoNextVersionTxtSpecification.RunSpecification.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":1,
44
"Patch":1,
55
"Suffix":"",
6-
"LongVersion":"0.1.1 Sha:'000000000000000000000000000000000000000'",
6+
"LongVersion":"0.1.1+Sha.000000000000000000000000000000000000000",
77
"NugetVersion":"0.1.1",
88
"ShortVersion":"0.1.1",
99
"BranchName":"master",

AcceptanceTests/TagFollowedByCommitsWithRedundantNextVersionTxtSpecification.WithOneCommit.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":0,
44
"Patch":4,
55
"Suffix":"",
6-
"LongVersion":"1.0.4 Sha:'000000000000000000000000000000000000000'",
6+
"LongVersion":"1.0.4+Sha.000000000000000000000000000000000000000",
77
"NugetVersion":"1.0.4",
88
"ShortVersion":"1.0.4",
99
"BranchName":"master",

AcceptanceTests/TagFollowedByCommitsWithRedundantNextVersionTxtSpecification.WithTenCommit.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":0,
44
"Patch":4,
55
"Suffix":"",
6-
"LongVersion":"1.0.4 Sha:'000000000000000000000000000000000000000'",
6+
"LongVersion":"1.0.4+Sha.000000000000000000000000000000000000000",
77
"NugetVersion":"1.0.4",
88
"ShortVersion":"1.0.4",
99
"BranchName":"master",

GitVersion/OutputVariables/VersionBuilders/InformationalVersionBuilder.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ public static string ToLongString(this VersionAndBranch versionAndBranch)
1313
if (versionAndBranch.BranchType == BranchType.Feature)
1414
{
1515
var shortSha = versionAndBranch.Sha.Substring(0, 8);
16-
return string.Format("{0}-unstable.feature-{1} Branch:'{2}' Sha:'{3}'", versionPrefix, shortSha, versionAndBranch.BranchName, versionAndBranch.Sha);
16+
return string.Format("{0}-unstable.feature-{1}+Branch.{2}.Sha.{3}", versionPrefix, shortSha, versionAndBranch.BranchName, versionAndBranch.Sha);
1717
}
1818

1919
if (versionAndBranch.BranchType == BranchType.PullRequest)
2020
{
21-
return string.Format("{0}-unstable.pull-request-{1} Branch:'{2}' Sha:'{3}'", versionPrefix, GetPreRelease(version.PreReleasePartTwo, releaseInformation), versionAndBranch.BranchName, versionAndBranch.Sha);
21+
return string.Format("{0}-unstable.pull-request-{1}+Branch.{2}.Sha.{3}", versionPrefix, GetPreRelease(version.PreReleasePartTwo, releaseInformation), versionAndBranch.BranchName, versionAndBranch.Sha);
2222
}
2323

2424

2525
if (versionAndBranch.BranchType == BranchType.Master)
2626
{
27-
return string.Format("{0} Sha:'{1}'", versionPrefix, versionAndBranch.Sha);
27+
return string.Format("{0}+Sha.{1}", versionPrefix, versionAndBranch.Sha);
2828
}
2929

3030

3131
//else Hotfix, Develop or Release
3232
if (releaseInformation.Stability == Stability.Final)
3333
{
34-
return string.Format("{0} Sha:'{1}'", versionPrefix, versionAndBranch.Sha);
34+
return string.Format("{0}+Sha.{1}", versionPrefix, versionAndBranch.Sha);
3535
}
3636
if (releaseInformation.Stability == Stability.ReleaseCandidate)
3737
{
38-
return string.Format("{0}-rc{1} Branch:'{2}' Sha:'{3}'", versionPrefix, GetPreRelease(version.PreReleasePartTwo, releaseInformation), versionAndBranch.BranchName, versionAndBranch.Sha);
38+
return string.Format("{0}-rc{1}+Branch.{2}.Sha.{3}", versionPrefix, GetPreRelease(version.PreReleasePartTwo, releaseInformation), versionAndBranch.BranchName, versionAndBranch.Sha);
3939
}
40-
return string.Format("{0}-{1}{2} Branch:'{3}' Sha:'{4}'", versionPrefix,releaseInformation.Stability.ToString().ToLowerInvariant(), GetPreRelease(version.PreReleasePartTwo, releaseInformation), versionAndBranch.BranchName, versionAndBranch.Sha);
40+
return string.Format("{0}-{1}{2}+Branch.{3}.Sha.{4}", versionPrefix,releaseInformation.Stability.ToString().ToLowerInvariant(), GetPreRelease(version.PreReleasePartTwo, releaseInformation), versionAndBranch.BranchName, versionAndBranch.Sha);
4141
}
4242

4343
static string GetPreRelease(int? preReleasePartTwo, ReleaseInformation releaseInformation)

Tests/AssemblyInfoBuilderTests.VerifyCreatedCode.approved.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using System.Reflection;
44

55
[assembly: AssemblyVersion("1.2.3")]
66
[assembly: AssemblyFileVersion("1.2.3")]
7-
[assembly: AssemblyInformationalVersion("1.2.3-unstable.feature-a682956d Branch:'feature1' Sha:'a682956dc1a2752aa24597a0f5cd939f93614509'")]
7+
[assembly: AssemblyInformationalVersion("1.2.3-unstable.feature-a682956d+Branch.feature1.Sha.a682956dc1a2752aa24597a0f5cd939f93614509")]
88
[assembly: NugetVersion("1.2.3-Feature-feature1-a682956dc1a2752aa24597a0f5cd939f93614509")]
99
[assembly: ReleaseDate("2014-03-01", "2014-03-06")]
1010

@@ -37,7 +37,7 @@ static class GitVersionInformation
3737
{
3838
public static string AssemblyVersion = "1.2.3";
3939
public static string AssemblyFileVersion = "1.2.3";
40-
public static string AssemblyInformationalVersion = "1.2.3-unstable.feature-a682956d Branch:'feature1' Sha:'a682956dc1a2752aa24597a0f5cd939f93614509'";
40+
public static string AssemblyInformationalVersion = "1.2.3-unstable.feature-a682956d+Branch.feature1.Sha.a682956dc1a2752aa24597a0f5cd939f93614509";
4141
public static string NugetVersion = "1.2.3-Feature-feature1-a682956dc1a2752aa24597a0f5cd939f93614509";
4242
public static string SemVer = "1.2.3-Feature-feature1-a682956dc1a2752aa24597a0f5cd939f93614509";
4343
}

Tests/JsonVersionBuilderTests.Json.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Minor":2,
44
"Patch":3,
55
"Suffix":"a682956d",
6-
"LongVersion":"1.2.3-unstable.feature-a682956d Branch:'feature1' Sha:'a682956dc1a2752aa24597a0f5cd939f93614509'",
6+
"LongVersion":"1.2.3-unstable.feature-a682956d+Branch.feature1.Sha.a682956dc1a2752aa24597a0f5cd939f93614509",
77
"NugetVersion":"1.2.3-Feature-feature1-a682956dc1a2752aa24597a0f5cd939f93614509",
88
"ShortVersion":"1.2.3-unstable.feature-a682956d",
99
"BranchName":"feature1",

0 commit comments

Comments
 (0)