Class VersionPlugin

java.lang.Object
io.github.duckasteroid.gradle.versioning.VersionPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public class VersionPlugin extends Object implements org.gradle.api.Plugin<org.gradle.api.Project>
Computes project.version from git history plus Conventional Commits - a small semantic-release commit-analyzer port (VersionResolver/CommitAnalyzer). Has no dependency on the java plugin at all, so it works standalone on any Gradle project, not just Java ones - apply the release-flow plugin alongside this one directly if you don't need a Java toolchain/POM/publishing conventions plugin too.

Still applies and configures axion-release - it supplies the raw per-module tag-prefix scheme (scmVersion.tag) and is what runs verbatim when -Prelease.forceVersion is set (see apply(org.gradle.api.Project)). axion-release's own default version computation - nearest tag, -SNAPSHOT if not exactly on it - doesn't know anything about why a release is being made, so every commit bumps the version the same way regardless of whether it was a bug fix or a breaking API change. Tying the bump to Conventional Commits means the version number itself carries real information about the size of the change, computed automatically.

Exposes project.ext.tagPrefix/modulePath (this project's own tag scheme) for the release-flow plugin to reuse rather than recompute, and the commitAnalyzer { } extension (CommitAnalyzerExtension) for customizing which commit types map to which version bump.

  • Constructor Details

    • VersionPlugin

      public VersionPlugin()
  • Method Details

    • apply

      public void apply(org.gradle.api.Project project)
      Specified by:
      apply in interface org.gradle.api.Plugin<org.gradle.api.Project>