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.

Category: Execution · Compare: mvn versions:set / npm version <new>

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

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

ArgumentTypeRequiredWhat it is
filestringyesThe .ek9 file holding the 'defines package' block, workspace-relative (typically 'package.ek9'); an absolute path inside the workspace is accepted.
verbositystring: full | summary | noneResponse size. The default answers with status, summary, version, previousVersion, written and line; 'full' adds the CLI's argv, exitCode, elapsedMs and timedOut.
versionstringyesThe 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