Skip to content

Commit 2d5f9ff

Browse files
committed
remove concept of releasedate from the core
1 parent 5135afc commit 2d5f9ff

27 files changed

+19
-214
lines changed

GitVersionCore.Tests/InformationalVersionBuilderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void ValidateInformationalVersionBuilder(BranchType branchType, string br
2525
Minor = minor,
2626
Patch = patch,
2727
PreReleaseTag = tag,
28-
BuildMetaData = new SemanticVersionBuildMetaData(suffix, branchName, new ReleaseDate(),sha,DateTimeOffset.MinValue),
28+
BuildMetaData = new SemanticVersionBuildMetaData(suffix, branchName,sha,DateTimeOffset.MinValue),
2929
};
3030
var informationalVersion = semanticVersion.ToString("i");
3131

GitVersionCore.Tests/JsonVersionBuilderTests.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ public void Json()
1515
Minor = 2,
1616
Patch = 3,
1717
PreReleaseTag = "unstable4",
18-
BuildMetaData = new SemanticVersionBuildMetaData(5, "feature1",
19-
new ReleaseDate
20-
{
21-
OriginalCommitSha = "originalCommitSha",
22-
OriginalDate = DateTimeOffset.Parse("2014-03-01 00:00:01Z"),
23-
}, "commitSha",DateTimeOffset.Parse("2014-03-06 23:59:59Z"))
18+
BuildMetaData = new SemanticVersionBuildMetaData(5, "feature1", "commitSha",DateTimeOffset.Parse("2014-03-06 23:59:59Z"))
2419
};
2520
var variables = VariableProvider.GetVariablesFor(semanticVersion);
2621
var json = JsonOutputFormatter.ToJson(variables);

GitVersionCore.Tests/VariableProviderTests.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ public void DevelopBranchFormatsSemVerForCiFeed()
1818
BuildMetaData = "5.Branch.develop"
1919
};
2020

21-
semVer.BuildMetaData.ReleaseDate = new ReleaseDate
22-
{
23-
OriginalCommitSha = "originalCommitSha",
24-
OriginalDate = DateTimeOffset.Parse("2014-03-01 00:00:01Z"),
25-
};
2621
semVer.BuildMetaData.Sha = "commitSha";
2722
semVer.BuildMetaData.CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z");
2823

GitVersionCore/GitFlow/BranchFinders/DevelopBasedVersionFinderBase.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ protected SemanticVersion FindVersion(
2121
var versionFromMaster = versionOnMasterFinder.Execute(context, context.CurrentCommit.Committer.When);
2222

2323
var numberOfCommitsOnBranchSinceCommit = NumberOfCommitsOnBranchSinceCommit(context, ancestor);
24-
var releaseDate = ReleaseDateFinder.Execute(context.Repository, context.CurrentCommit, 0);
2524
var preReleaseTag = context.CurrentBranch.Name
2625
.TrimStart(branchType.ToString() + '-')
2726
.TrimStart(branchType.ToString() + '/');
@@ -33,7 +32,7 @@ protected SemanticVersion FindVersion(
3332
PreReleaseTag = preReleaseTag,
3433
BuildMetaData = new SemanticVersionBuildMetaData(
3534
numberOfCommitsOnBranchSinceCommit,
36-
context.CurrentBranch.Name, releaseDate, context.CurrentCommit.Sha, context.CurrentCommit.When())
35+
context.CurrentBranch.Name, context.CurrentCommit.Sha, context.CurrentCommit.When())
3736
};
3837

3938
semanticVersion.OverrideVersionManuallyIfNeeded(context.Repository);

GitVersionCore/GitFlow/BranchFinders/DevelopVersionFinder.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ public SemanticVersion FindVersion(GitVersionContext context)
2121
var c = context.Repository.Commits.QueryBy(f);
2222
var numberOfCommitsSinceRelease = c.Count();
2323

24-
var releaseDate = ReleaseDateFinder.Execute(context.Repository, tip, 0);
2524
var semanticVersion = new SemanticVersion
2625
{
2726
Major = versionFromMaster.Major,
2827
Minor = versionFromMaster.Minor + 1,
2928
Patch = 0,
3029
PreReleaseTag = "unstable" + numberOfCommitsSinceRelease,
31-
BuildMetaData = new SemanticVersionBuildMetaData(numberOfCommitsSinceRelease, context.CurrentBranch.Name, releaseDate,tip.Sha,tip.When()),
30+
BuildMetaData = new SemanticVersionBuildMetaData(numberOfCommitsSinceRelease, context.CurrentBranch.Name,tip.Sha,tip.When()),
3231
};
3332

3433
semanticVersion.OverrideVersionManuallyIfNeeded(context.Repository);

GitVersionCore/GitFlow/BranchFinders/MasterVersionFinder.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public SemanticVersion FindVersion(IRepository repository, Commit tip)
1111
ShortVersion shortVersion;
1212
if (ShortVersionParser.TryParse(tag.Name, out shortVersion))
1313
{
14-
return BuildVersion(repository, tip, shortVersion);
14+
return BuildVersion(tip, shortVersion);
1515
}
1616
}
1717

@@ -20,7 +20,7 @@ public SemanticVersion FindVersion(IRepository repository, Commit tip)
2020
ShortVersion versionFromTip;
2121
if (MergeMessageParser.TryParse(tip, out versionFromTip))
2222
{
23-
semanticVersion = BuildVersion(repository, tip, versionFromTip);
23+
semanticVersion = BuildVersion(tip, versionFromTip);
2424
}
2525

2626
if (semanticVersion == null || semanticVersion.IsEmpty())
@@ -31,15 +31,14 @@ public SemanticVersion FindVersion(IRepository repository, Commit tip)
3131
return semanticVersion;
3232
}
3333

34-
SemanticVersion BuildVersion(IRepository repository, Commit tip, ShortVersion shortVersion)
34+
SemanticVersion BuildVersion(Commit tip, ShortVersion shortVersion)
3535
{
36-
var releaseDate = ReleaseDateFinder.Execute(repository, tip, shortVersion.Patch);
3736
return new SemanticVersion
3837
{
3938
Major = shortVersion.Major,
4039
Minor = shortVersion.Minor,
4140
Patch = shortVersion.Patch,
42-
BuildMetaData = new SemanticVersionBuildMetaData(null, "master", releaseDate,tip.Sha,tip.When())
41+
BuildMetaData = new SemanticVersionBuildMetaData(null, "master",tip.Sha,tip.When())
4342
};
4443
}
4544
}

GitVersionCore/GitFlow/BranchFinders/OptionallyTaggedBranchVersionFinderBase.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,14 @@ protected SemanticVersion FindVersion(
3030

3131
var tagVersion = RetrieveMostRecentOptionalTagVersion(context.Repository, version, context.CurrentBranch.Commits.Take(nbHotfixCommits + 1));
3232

33-
var releaseDate = ReleaseDateFinder.Execute(context.Repository, context.CurrentCommit, version.Patch);
3433
var semanticVersion = new SemanticVersion
3534
{
3635
Major = version.Major,
3736
Minor = version.Minor,
3837
Patch = version.Patch,
3938
PreReleaseTag = version.PreReleaseTag,
4039
BuildMetaData = new SemanticVersionBuildMetaData(
41-
nbHotfixCommits, context.CurrentBranch.Name, releaseDate, context.CurrentCommit.Sha, context.CurrentCommit.When())
40+
nbHotfixCommits, context.CurrentBranch.Name, context.CurrentCommit.Sha, context.CurrentCommit.When())
4241
};
4342

4443
if (tagVersion != null)

GitVersionCore/GitFlow/BranchFinders/SupportVersionFinder.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public SemanticVersion FindVersion(IRepository repository, Commit tip)
1111
ShortVersion shortVersion;
1212
if (ShortVersionParser.TryParse(tag.Name, out shortVersion))
1313
{
14-
return BuildVersion(repository, tip, shortVersion);
14+
return BuildVersion(tip, shortVersion);
1515
}
1616
}
1717

@@ -20,7 +20,7 @@ public SemanticVersion FindVersion(IRepository repository, Commit tip)
2020
ShortVersion versionFromTip;
2121
if (MergeMessageParser.TryParse(tip, out versionFromTip))
2222
{
23-
semanticVersion = BuildVersion(repository, tip, versionFromTip);
23+
semanticVersion = BuildVersion(tip, versionFromTip);
2424
}
2525

2626
semanticVersion.OverrideVersionManuallyIfNeeded(repository);
@@ -33,15 +33,14 @@ public SemanticVersion FindVersion(IRepository repository, Commit tip)
3333
return semanticVersion;
3434
}
3535

36-
SemanticVersion BuildVersion(IRepository repository, Commit tip, ShortVersion shortVersion)
36+
SemanticVersion BuildVersion(Commit tip, ShortVersion shortVersion)
3737
{
38-
var releaseDate = ReleaseDateFinder.Execute(repository, tip, shortVersion.Patch);
3938
return new SemanticVersion
4039
{
4140
Major = shortVersion.Major,
4241
Minor = shortVersion.Minor,
4342
Patch = shortVersion.Patch,
44-
BuildMetaData = new SemanticVersionBuildMetaData(null, "support", releaseDate, tip.Sha,tip.When())
43+
BuildMetaData = new SemanticVersionBuildMetaData(null, "support", tip.Sha,tip.When())
4544
};
4645
}
4746
}

GitVersionCore/GitHubFlow/BuildNumberCalculator.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ public SemanticVersion GetBuildNumber(GitVersionContext context)
2323
var commitsSinceLastRelease = NumberOfCommitsOnBranchSinceCommit(context, commit);
2424
var semanticVersion = nextSemverCalculator.NextVersion();
2525

26-
var releaseDate = ReleaseDateFinder.Execute(context.Repository, context.CurrentCommit, semanticVersion.Patch);
27-
2826
// TODO Need a way of setting this in a cross cutting way
29-
semanticVersion.BuildMetaData = new SemanticVersionBuildMetaData(commitsSinceLastRelease, context.CurrentBranch.Name, releaseDate, context.CurrentCommit.Sha, context.CurrentCommit.When());
27+
semanticVersion.BuildMetaData = new SemanticVersionBuildMetaData(commitsSinceLastRelease, context.CurrentBranch.Name, context.CurrentCommit.Sha, context.CurrentCommit.When());
3028
if (context.CurrentBranch.IsPullRequest())
3129
{
3230
EnsurePullBranchShareACommonAncestorWithMaster(gitRepo, gitRepo.Head);

GitVersionCore/GitVersionCore.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@
103103
<Compile Include="OutputVariables\CiFeedFormatter.cs" />
104104
<Compile Include="OutputVariables\VariableProvider.cs" />
105105
<Compile Include="AssemblyInfo.cs" />
106-
<Compile Include="ReleaseDate.cs" />
107-
<Compile Include="ReleaseDateFinder.cs" />
108106
<Compile Include="RepositoryLoader.cs" />
109107
<Compile Include="SearchPath.cs" />
110108
<Compile Include="SemanticVersion.cs" />

0 commit comments

Comments
 (0)