Class VersioningExtension
java.lang.Object
com.cleanroommc.versioning.gradle.VersioningExtension
Configures the version label and exposes the computed version.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.provider.Property<String> The path prefix marking a development branch,developby default.abstract org.gradle.api.provider.Property<String> getLabel()The pre-release label commits are counted under.Additional pre-release identifiers, rendered as.<key>.<value>after the label in insertion order.abstract org.gradle.api.provider.Property<String> The branch a release tag has to be reachable from,masterby default.org.gradle.api.provider.Property<Stage> getStage()The release stage, read from Git tags.abstract org.gradle.api.provider.Property<String> The version assigned toproject.version.voidDeprecated, for removal: This API element is subject to removal in a future version.put the stage on the Git tag insteadvoidDeprecated, for removal: This API element is subject to removal in a future version.put the stage on the Git tag insteadtoString()
-
Constructor Details
-
VersioningExtension
@Inject public VersioningExtension(org.gradle.api.model.ObjectFactory objects) - Parameters:
objects- the injected object factory
-
-
Method Details
-
getReleaseBranch
The branch a release tag has to be reachable from,masterby default.- Returns:
- the release branch name
-
getDevelopmentPrefix
The path prefix marking a development branch,developby default. A branch named<prefix>/<major>.<minor>stays on that version and only advances the label.- Returns:
- the development branch prefix
-
getLabel
The pre-release label commits are counted under. Unset it isdevon the release branch and on a development branch, and the branch name elsewhere, sofeature/foocounts underfeature-foo.- Returns:
- the label
-
getMetadata
Additional pre-release identifiers, rendered as.<key>.<value>after the label in insertion order. Under GitHub Actions the run number is emitted asrunahead of these.- Returns:
- the metadata
-
getStage
The release stage, read from Git tags. A CI tag build uses its explicit suffix or inherits from the highest reachable staged version at or below its version. Other builds use the highest reachable staged version. Only staged versions in the same major version count. Without one it isStage.BETAbelow1.0.0andStage.RELEASEfrom there on. Setting it, or theversioning.stageGradle property, still overrides Git but is deprecated.- Returns:
- the stage
-
setStage
Deprecated, for removal: This API element is subject to removal in a future version.put the stage on the Git tag instead- Parameters:
value- the stage
-
setStage
Deprecated, for removal: This API element is subject to removal in a future version.put the stage on the Git tag insteadSets the stage from its name, case insensitively.- Parameters:
value- the stage name- Throws:
IllegalArgumentException- if the text names no stage
-
getVersion
The version assigned toproject.version. The plugin wires and locks this.- Returns:
- the computed version
-
toString
-