com.github.zafarkhaja.semver.Version.incrementMinorVersion()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中com.github.zafarkhaja.semver.Version.incrementMinorVersion()方法的一些代码示例,展示了Version.incrementMinorVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.incrementMinorVersion()方法的具体详情如下:
包路径:com.github.zafarkhaja.semver.Version
类名称:Version
方法名:incrementMinorVersion

Version.incrementMinorVersion介绍

[英]Increments the minor version.
[中]增加次要版本。

代码示例

代码示例来源:origin: gradle.plugin.br.com.sabium/gradle-bump

public String nextSnapshotVersion(final String tag, final String tagPattern) {
  Version v;
  if (tag.matches(tagPattern)) {
    final Pattern pattern = Pattern.compile(tagPattern);
    final Matcher m = pattern.matcher(tag);
    m.matches();
    v = Version.valueOf(m.group(1)).incrementMinorVersion();
    return v.toString();
  }
  return StringUtils.EMPTY;
}

代码示例来源:origin: org.ajoberstar.reckon/reckon-core

/**
 * Increments this version using the given scope to get a new normal version.
 * 
 * @param scope the scope to increment the version by
 * @return incremented version, with only the normal component
 */
public Version incrementNormal(Scope scope) {
 switch (scope) {
  case MAJOR:
   return new Version(version.incrementMajorVersion());
  case MINOR:
   return new Version(version.incrementMinorVersion());
  case PATCH:
   return new Version(version.incrementPatchVersion());
  default:
   throw new AssertionError("Invalid scope: " + scope);
 }
}

代码示例来源:origin: zafarkhaja/jsemver

if (!tokens.positiveLookahead(DOT)) {
  Version lower = versionFor(major, minor);
  Version upper = major > 0 ? lower.incrementMajorVersion() : lower.incrementMinorVersion();
  return gte(lower).and(lt(upper));
  return gte.and(lt(version.incrementMajorVersion()));
} else if (minor > 0) {
  return gte.and(lt(version.incrementMinorVersion()));
} else if (patch > 0) {
  return gte.and(lt(version.incrementPatchVersion()));

代码示例来源:origin: com.github.zafarkhaja/java-semver

if (!tokens.positiveLookahead(DOT)) {
  Version lower = versionFor(major, minor);
  Version upper = major > 0 ? lower.incrementMajorVersion() : lower.incrementMinorVersion();
  return gte(lower).and(lt(upper));
  return gte.and(lt(version.incrementMajorVersion()));
} else if (minor > 0) {
  return gte.and(lt(version.incrementMinorVersion()));
} else if (patch > 0) {
  return gte.and(lt(version.incrementPatchVersion()));

相关文章