Versioning & release management
Audience: contributors and maintainers. How Book’s version is derived, how it flows into the CLI, and how a release is made.
Book uses shipkit-auto-version. Git tags are the single source of truth for the project version. There is no version number to update by hand, no bump commit, and no version file to maintain.
How the version is derived
The shipkit-auto-version Gradle plugin is applied once at the root project
(build.gradle.kts), and every subproject (including :jvm:cli) inherits
project.version from it.
Its configuration lives in version.properties at the repository root:
version=0.9.*
tagPrefix=
| Property | Meaning |
|---|---|
|
The version spec (supports wildcards). The plugin resolves the version from the highest git tag matching this spec. |
|
Optional tag prefix. Empty in Book. Tags are bare semver ( |
Resolution rules:
-
A tag matching the spec exists on the current commit (e.g.
0.9.3): the version is exactly that tag. -
No matching tag, or the commit comes after the tag: the plugin computes the next release version from the spec (
0.9.*gives a0.9.0base, since bump=0) and appends build metadata identifying the commit. -
No tags at all: the plugin falls back to the spec’s base version (
0.9.0).
Check the resolved version any time:
./gradlew :jvm:cli:properties -q | grep "^version"
version.properties is a spec, not the version itself. Changing 0.9. to 0.10.
moves development to the next minor series. Never edit it to bump a release; tag instead.
How the CLI gets its version
BookArgCommand logs the version at startup, and the build generates that value.
There is no hard-coded version constant in the source.
-
The
generateAppVersiontask injvm/cli/build.gradle.ktswritesus/nineworlds/book/cli/di/AppVersion.ktintojvm/cli/build/generated/version/, containing the resolvedproject.version. -
The generated directory is registered as a source set directory, and
KotlinCompiletasks depend ongenerateAppVersion, so the file is regenerated before compilation. -
AppVersion.VERSIONis aconst val, so the compiler inlines the value into the bytecode, including the shadow jar.
The jar name and the CLI’s startup banner always carry the version shipkit derived
from the tags. Tag 0.9.5 produces cli-0.9.5.jar printing
Book starting (version=0.9.5, …). Do not edit files under build/generated/;
the build regenerates them.
Making a release
The whole release flow:
git tag 0.9.3 # bare semver, matching the spec in version.properties
git push origin 0.9.3
A tag push to GitLab runs the release pipeline. The tag is the version, and no version file needs to be updated beforehand.
Release conventions:
-
Tags are bare semver (
0.9.3), matching theversionspec inversion.properties. Do not use avprefix unless you also settagPrefix=vinversion.properties. -
Tag the commit you want to release on the default branch after it is green. Never re-point or move an existing tag.
-
To move to the next minor series, flip the spec in
version.properties(e.g.0.9.โ0.10.) in the commit after the release, so subsequent development resolves to the next version.
Where the version appears elsewhere
| Location | How it gets the version |
|---|---|
Gradle builds / published artifacts |
|
|
Build-generated |
|
|
CI release job ( |
The pushed tag itself. The pipeline reads the version from the tag, not from any file |
Further reading
-
Publishing configuration (GitLab Maven registry, Sonatype/Central): Maven Publishing.
-
The ADR that decided this mechanism:
prompts/plans/adr/ADR-20261111-shipkit-auto-version-maven-publishing.md.