Class VersionSupport
java.lang.Object
network.ike.workspace.VersionSupport
Version manipulation for IKE workspace conventions.
Handles SNAPSHOT suffixes, branch-qualified versions, checkpoint
versions, and release version derivation. Extracted from
ReleaseSupport in ike-maven-plugin so these operations are
testable without Maven dependencies.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringbranchQualifiedVersion(String baseVersion, String branch) Derive a branch-qualified SNAPSHOT version.static StringderiveNextSnapshot(String releaseVersion) Derive the next SNAPSHOT version by incrementing the last numeric segment.static StringderiveReleaseVersion(String snapshotVersion) Derive the release version from a SNAPSHOT version.static StringextractNumericBase(String version) Extract the numeric base version, stripping any branch qualifier.static booleanisBranchQualified(String version) Check whether a version string is branch-qualified (has a non-numeric qualifier before -SNAPSHOT).static booleanisSnapshot(String version) Check whether a version string is a SNAPSHOT.static StringsafeBranchName(String branch) Transform a branch name into a safe directory/version qualifier.static StringstripSnapshot(String version) Strip-SNAPSHOTfrom a version string.
-
Method Details
-
stripSnapshot
-
deriveReleaseVersion
Derive the release version from a SNAPSHOT version. Equivalent tostripSnapshot(String).- Parameters:
snapshotVersion- version to strip- Returns:
- release version without -SNAPSHOT suffix
-
deriveNextSnapshot
-
safeBranchName
-
branchQualifiedVersion
Derive a branch-qualified SNAPSHOT version.Given base version
"1.2.0-SNAPSHOT"and branch"feature/my-work", returns"1.2.0-my-work-SNAPSHOT".If the branch is "main", returns the base version unchanged.
- Parameters:
baseVersion- the unqualified version (with or without -SNAPSHOT)branch- the git branch name- Returns:
- the branch-qualified SNAPSHOT version
-
extractNumericBase
-
isSnapshot
Check whether a version string is a SNAPSHOT.- Parameters:
version- version to check- Returns:
- true if version ends with -SNAPSHOT
-
isBranchQualified
Check whether a version string is branch-qualified (has a non-numeric qualifier before -SNAPSHOT).- Parameters:
version- version to check- Returns:
- true if version contains a branch qualifier
-