ek9_set_feature_version
Answers with the new version and previousVersion after setting the 'defines package' version literal to MAJOR.MINOR.PATCH-feature (build restarts at 0), plus written and line.
When to use it
'Publish under a feature-tagged version' is one call with file:'package.ek9' and version:'1.0.0-hotfix' (or just 'hotfix'). A bare tag is prefixed with the file's current MAJOR.MINOR.PATCH. Hotfix and release branches, vendor- or customer-specific variants.
When not to use it
- A plain version with no feature tag - use
ek9_set_version. - Bumping the current version by one component (feature-tagged or not) - use
ek9_increment_version. - Reading the current version without changing it - use
ek9_query_package_version.
Details
Wraps ek9 -SF. A feature tag is letters then letters/digits (no '-' inside it: 'rc1' and 'customerA' are tags, 'feature-branch' is not). The build component restarts at 0 and later CI snapshots bump it with ek9_increment_version component:'build'. Switches the version FORMAT from plain to feature-tagged; ek9_set_version switches it back. The literal is validated before the fork; the file's version line is read before and after so version, previousVersion, written and line are facts from the file.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
file | string | yes | The .ek9 file holding the 'defines package' block, workspace-relative (typically 'package.ek9'); an absolute path inside the workspace is accepted. |
verbosity | string: full | summary | none | Response size. The default answers with status, summary, version, previousVersion, written and line; 'full' adds the CLI's argv, exitCode, elapsedMs and timedOut. | |
version | string | yes | The MAJOR.MINOR.PATCH-FEATURE literal, e.g. '1.0.0-alpha' or '2.1.0-rc1'; a bare tag such as 'alpha' is prefixed with the file's current MAJOR.MINOR.PATCH. The tag is letters then letters/digits. |
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
Set feature version apply
Request
{
"file" : "<workspace-root>/package.ek9",
"version" : "1.0.0-alpha"
}
Response
{
"file" : "package.ek9",
"line" : 5,
"meta" : {
"serverMs" : "<timing>"
},
"previousVersion" : "1.0.0-0",
"status" : "ok",
"summary" : "version 1.0.0-0 -> 1.0.0-alpha-0",
"version" : "1.0.0-alpha-0",
"written" : true
}
Set feature version bare tag
Request
{
"file" : "<workspace-root>/package.ek9",
"version" : "beta"
}
Response
{
"file" : "package.ek9",
"line" : 5,
"meta" : {
"serverMs" : "<timing>"
},
"note" : "Resolved 'beta' -> '1.0.0-beta'",
"previousVersion" : "1.0.0-0",
"status" : "ok",
"summary" : "version 1.0.0-0 -> 1.0.0-beta-0",
"version" : "1.0.0-beta-0",
"written" : true
}
See also
- Show me in the IDE: The package block
- Part of the feature_branch_start workflow: Set feature-branch version + add new dependencies + resolve + verify.