ek9_set_version
Answers with the new version and previousVersion after setting the 'defines package' version literal to an explicit MAJOR.MINOR.PATCH (build restarts at 0), plus written and line.
When to use it
'Set the package version to 2.0.0' is one call with file:'package.ek9' and version:'2.0.0'. An explicit base version rather than a bump: first GA, a breaking release, a mis-bump reset.
When not to use it
- Bumping the current version by one component - use
ek9_increment_version. - A feature-tagged version (X.Y.Z-feature) - use
ek9_set_feature_version. - Reading the current version without changing it - use
ek9_query_package_version.
Details
Wraps ek9 -SV. The build component restarts at 0 (2.0.0 becomes 'version <- 2.0.0-0') and an existing feature tag is replaced by whatever the literal carries. There is deliberately no 'must be greater than current' guard - setting an older version is how a mis-bump is corrected. The literal is validated before the fork; the file's version line is read before and after the rewrite 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 new MAJOR.MINOR.PATCH literal, e.g. '1.2.3' - no build suffix (the build restarts at 0). |
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
Set version apply
Request
{
"file" : "<workspace-root>/package.ek9",
"version" : "2.5.7"
}
Response
{
"file" : "package.ek9",
"line" : 5,
"meta" : {
"serverMs" : "<timing>"
},
"previousVersion" : "1.0.0-0",
"status" : "ok",
"summary" : "version 1.0.0-0 -> 2.5.7-0",
"version" : "2.5.7-0",
"written" : true
}
See also
- Show me in the IDE: The package block