当前位置: 首页>>代码示例>>C#>>正文


C# SemanticVersion.IncrementVersion方法代码示例

本文整理汇总了C#中SemanticVersion.IncrementVersion方法的典型用法代码示例。如果您正苦于以下问题:C# SemanticVersion.IncrementVersion方法的具体用法?C# SemanticVersion.IncrementVersion怎么用?C# SemanticVersion.IncrementVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SemanticVersion的用法示例。


在下文中一共展示了SemanticVersion.IncrementVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IncrementForEachCommit

 private static SemanticVersion IncrementForEachCommit(GitVersionContext context, List<Commit> directCommits, SemanticVersion mainlineVersion)
 {
     foreach (var directCommit in directCommits)
     {
         var directCommitIncrement = IncrementStrategyFinder.GetIncrementForCommits(context, new[]
                                     {
                                         directCommit
                                     }) ?? VersionField.Patch;
         mainlineVersion = mainlineVersion.IncrementVersion(directCommitIncrement);
         Logger.WriteInfo(string.Format("Direct commit on master {0} incremented base versions {1}, now {2}", 
             directCommit.Sha, directCommitIncrement, mainlineVersion));
     }
     return mainlineVersion;
 }
开发者ID:qetza,项目名称:GitVersion,代码行数:14,代码来源:NextVersionCalculator.cs

示例2: AggregateMergeCommitIncrement

        SemanticVersion AggregateMergeCommitIncrement(GitVersionContext context, Commit commit, List<Commit> directCommits, SemanticVersion mainlineVersion)
        {
// Merge commit, process all merged commits as a batch
            var mergeCommit = commit;
            var mergedHead = GetMergedHead(mergeCommit);
            var findMergeBase = context.Repository.ObjectDatabase.FindMergeBase(mergeCommit.Parents.First(), mergedHead);
            var findMessageIncrement = FindMessageIncrement(context, mergeCommit, mergedHead, findMergeBase, directCommits);

            // If this collection is not empty there has been some direct commits against master
            // Treat each commit as it's own 'release', we need to do this before we increment the branch
            mainlineVersion = IncrementForEachCommit(context, directCommits, mainlineVersion);
            directCommits.Clear();

            // Finally increment for the branch
            mainlineVersion = mainlineVersion.IncrementVersion(findMessageIncrement);
            Logger.WriteInfo(string.Format("Merge commit {0} incremented base versions {1}, now {2}",
                mergeCommit.Sha, findMessageIncrement, mainlineVersion));
            return mainlineVersion;
        }
开发者ID:qetza,项目名称:GitVersion,代码行数:19,代码来源:NextVersionCalculator.cs


注:本文中的SemanticVersion.IncrementVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。