Class VersioningExtension

java.lang.Object
com.cleanroommc.versioning.gradle.VersioningExtension

public abstract class VersioningExtension extends Object
Configures the version label and exposes the computed version.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VersioningExtension(org.gradle.api.model.ObjectFactory objects)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<String>
    The path prefix marking a development branch, develop by default.
    abstract org.gradle.api.provider.Property<String>
    The pre-release label commits are counted under.
    abstract org.gradle.api.provider.MapProperty<String,String>
    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, master by default.
    org.gradle.api.provider.Property<Stage>
    The release stage, read from Git tags.
    abstract org.gradle.api.provider.Property<String>
    The version assigned to project.version.
    void
    setStage(Stage value)
    Deprecated, for removal: This API element is subject to removal in a future version.
    put the stage on the Git tag instead
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    put the stage on the Git tag instead
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VersioningExtension

      @Inject public VersioningExtension(org.gradle.api.model.ObjectFactory objects)
      Parameters:
      objects - the injected object factory
  • Method Details

    • getReleaseBranch

      public abstract org.gradle.api.provider.Property<String> getReleaseBranch()
      The branch a release tag has to be reachable from, master by default.
      Returns:
      the release branch name
    • getDevelopmentPrefix

      public abstract org.gradle.api.provider.Property<String> getDevelopmentPrefix()
      The path prefix marking a development branch, develop by default. A branch named <prefix>/<major>.<minor> stays on that version and only advances the label.
      Returns:
      the development branch prefix
    • getLabel

      public abstract org.gradle.api.provider.Property<String> getLabel()
      The pre-release label commits are counted under. Unset it is dev on the release branch and on a development branch, and the branch name elsewhere, so feature/foo counts under feature-foo.
      Returns:
      the label
    • getMetadata

      public abstract org.gradle.api.provider.MapProperty<String,String> getMetadata()
      Additional pre-release identifiers, rendered as .<key>.<value> after the label in insertion order. Under GitHub Actions the run number is emitted as run ahead of these.
      Returns:
      the metadata
    • getStage

      public org.gradle.api.provider.Property<Stage> 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 is Stage.BETA below 1.0.0 and Stage.RELEASE from there on. Setting it, or the versioning.stage Gradle property, still overrides Git but is deprecated.
      Returns:
      the stage
    • setStage

      @Deprecated(since="3.3.0", forRemoval=true) public void setStage(Stage value)
      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(since="3.3.0", forRemoval=true) public void setStage(String value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      put the stage on the Git tag instead
      Sets the stage from its name, case insensitively.
      Parameters:
      value - the stage name
      Throws:
      IllegalArgumentException - if the text names no stage
    • getVersion

      public abstract org.gradle.api.provider.Property<String> getVersion()
      The version assigned to project.version. The plugin wires and locks this.
      Returns:
      the computed version
    • toString

      public String toString()
      Overrides:
      toString in class Object