Skip to content

Versioning and Releases

TheMeinerLP edited this page Aug 1, 2026 · 2 revisions

How Falco's version number is set, how Release Please updates it, and how snapshot builds derive a version from it.

The one line Release Please rewrites

The version lives in exactly one place, build.gradle.kts at the repository root:

version = "0.3.0" // x-release-please-version

The two published library modules (and the BOM that pins them, see Build Setup) always release together, so the version is declared once here and inherited by every subproject through subprojects { version = rootProject.version }. Release Please rewrites this single line on release; nothing else in the build carries a version number. release-please-config.json lists build.gradle.kts as an extra-files entry of type generic, and Release Please's generic updater locates the line to rewrite by searching for the exact marker comment // x-release-please-version. That comment is not documentation — it is the anchor the release automation depends on. If it is ever removed or reworded, Release Please silently stops finding the line, the build keeps compiling and testing green, and no release ever updates the version again.

Deriving a snapshot version

if (providers.gradleProperty("snapshot").isPresent) {
    val parts = version.toString().substringBefore('-').split('.')
    require(parts.size == 3) { "cannot derive a snapshot from version '$version'" }
    version = "${parts[0]}.${parts[1]}.${parts[2].toInt() + 1}-SNAPSHOT"
}

Every push to main that does not cut a release publishes the current state as a snapshot (./gradlew publish -Psnapshot), and the derivation happens in the build script rather than on the command line. The reason is assignment order: a -Pversion=… passed on the command line would be silently overwritten by the plain version = "0.3.0" assignment above it, which runs later than the property is read. Instead, the script reads the already-released version and bumps its patch number by one, appending -SNAPSHOT. That keeps Release Please's single marked line the only place a version number is ever written by hand — the snapshot logic only reads it.

The published artefact's repository is chosen from whether SNAPSHOT appears in the resulting version string; see Publishing for how that routes between the releases and snapshots Reposilite endpoints.

Falco


Start here

The measured record

Why it is built this way

  • Rationale — the index for the five rationale pages
  • Research — the index for the five investigations
  • Research: Fluent API — the investigation behind the builders; a record, not a reference

Working on the build

Clone this wiki locally