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.

Category: Execution · Compare: mvn versions:set with classifier

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

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

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 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