SemVer Tools
CJTaskrunner assists with versioning through built-in directives.
@version name value declares a top-level component version and creates
$VERSION_NAME, uppercasing the name and converting hyphens to underscores.
@version cli 0.1.0
@version lsp 0.0.1-alpha.1
Version names must contain only ASCII letters, digits, hyphens, and underscores.
Each declaration creates an override environment entry named VERSION_<NAME>,
where the name is uppercased and hyphens are converted to underscores.
Version values must be SemVer 2.x MAJOR.MINOR.PATCH values with an optional
prerelease suffix. Build metadata is not supported.
@version is only valid as a top-level header in cjtasks.
Use @patch, @minor, @major, @pre, or @release inside tasks to change a version.
Examples:
@version cli 0.1.0creates$VERSION_CLIwith value0.1.0.@version language-server 0.0.1creates$VERSION_LANGUAGE_SERVERwith value0.0.1.@version app 1.2.3-beta.1creates$VERSION_APPwith value1.2.3-beta.1.@patch appincrements$VERSION_APPby one patch version.@pre app alphasets the version prerelease toalpha.@pre app alpha.sets the prerelease toalpha.0, or increments the trailing number when the current prerelease is alreadyalpha.N.
Duplicate version variables are errors.
Other rules
Each version can be bumped at most once per invocation. Bump state is shared
with normal sequential @task calls. Tasks reached through @await are
isolated and cannot use version bump directives.
Overlay files may use version conditionals and may call a base task that
performs a bump, but they may not contain @version or version bump directives.
A bump always updates cjtasks on disk.
Version conditionals
There is a dedicated set of conditional directives for versioning:
@if-bumped
@if-patch
@if-minor
@if-major
@if-pre
@if-release