public NextSemverCalculator( NextVersionTxtFileFinder nextVersionTxtFileFinder, LastTaggedReleaseFinder lastTaggedReleaseFinder, GitVersionContext context) { this.nextVersionTxtFileFinder = nextVersionTxtFileFinder; this.lastTaggedReleaseFinder = lastTaggedReleaseFinder; mergedBranchesWithVersionFinder = new MergedBranchesWithVersionFinder(context); unknownBranchFinder = new OtherBranchVersionFinder(); this.context = context; }
public static void OverrideVersionManuallyIfNeeded(this SemanticVersion version, IRepository repository) { var nextVersionTxtFileFinder = new NextVersionTxtFileFinder(repository.GetRepositoryDirectory()); var manualNextVersion = nextVersionTxtFileFinder.GetNextVersion(); if (!manualNextVersion.IsEmpty()) { if (manualNextVersion > version) { version.Major = manualNextVersion.Major; version.Minor = manualNextVersion.Minor; version.Patch = manualNextVersion.Patch; } } }
public static void OverrideVersionManuallyIfNeeded(this SemanticVersion version, IRepository repository, Config configuration) { var nextVersionTxtFileFinder = new NextVersionTxtFileFinder(repository.GetRepositoryDirectory(), configuration); SemanticVersion manualNextVersion ; if (nextVersionTxtFileFinder.TryGetNextVersion(out manualNextVersion)) { if (manualNextVersion > version) { version.Major = manualNextVersion.Major; version.Minor = manualNextVersion.Minor; version.Patch = manualNextVersion.Patch; } } }
public static void OverrideVersionManuallyIfNeeded(this SemanticVersion version, IRepository repository, Config configuration) { var nextVersionTxtFileFinder = new NextVersionTxtFileFinder(repository.GetRepositoryDirectory(), configuration); SemanticVersion manualNextVersion; if (nextVersionTxtFileFinder.TryGetNextVersion(out manualNextVersion)) { if (manualNextVersion > version) { version.Major = manualNextVersion.Major; version.Minor = manualNextVersion.Minor; version.Patch = manualNextVersion.Patch; } } }