Class VersionCalculator
java.lang.Object
io.github.joke.conventionalversion.calc.VersionCalculator
Turns gathered repository facts into a version, predicting what release-please will publish.
Pure: given the same RepositoryState and VersionPolicy it always returns the
same VersionResult, with no clock, no filesystem and no process involved.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SemanticVersionapplyBump(Bump bump, SemanticVersion base, VersionPolicy policy) calculate(RepositoryState state, VersionPolicy policy) protected Bumpprotected BumpeffectiveBump(Bump bump, SemanticVersion base, VersionPolicy policy) protected Optional<SemanticVersion> findOverride(List<ConventionalCommit> commits) The most recent override wins, which with an oldest-first range is the last one.protected Optional<SemanticVersion> On a release commit the recorded version is the truth and nothing is derived - not the bump, and not aRelease-As:override earlier in history.protected SemanticVersionnextVersion(@Nullable SemanticVersion recorded, VersionPolicy policy, Optional<SemanticVersion> override, Bump bump) protected List<ConventionalCommit> protected BumppreMajorBump(Bump bump, VersionPolicy policy) protected VersionResultreleasedResult(SemanticVersion released, String sha) protected VersionResultsnapshotResult(RepositoryState state, VersionPolicy policy)
-
Constructor Details
-
VersionCalculator
-
-
Method Details
-
calculate
-
findReleasedVersion
On a release commit the recorded version is the truth and nothing is derived - not the bump, and not aRelease-As:override earlier in history. -
releasedResult
-
snapshotResult
@VisibleForTesting protected VersionResult snapshotResult(RepositoryState state, VersionPolicy policy) -
parseAll
-
findOverride
@VisibleForTesting protected Optional<SemanticVersion> findOverride(List<ConventionalCommit> commits) The most recent override wins, which with an oldest-first range is the last one. -
nextVersion
@VisibleForTesting protected SemanticVersion nextVersion(@Nullable SemanticVersion recorded, VersionPolicy policy, Optional<SemanticVersion> override, Bump bump) -
applyBump
@VisibleForTesting protected SemanticVersion applyBump(Bump bump, SemanticVersion base, VersionPolicy policy) -
effectiveBump
@VisibleForTesting protected Bump effectiveBump(Bump bump, SemanticVersion base, VersionPolicy policy) -
preMajorBump
-
downgrade
-