ek9_query_package_version

Answers with version (the 'defines package' literal) and the line it is on for one .ek9 file; null with an error when the file declares no package.

Category: Enquiry · Compare: mvn help:evaluate -Dexpression=project.version

When to use it

'What is the package version' is one call with file:'package.ek9'. The lightest read of the user's version literal, and the baseline to capture before ek9_increment_version or ek9_set_version.

When not to use it

Details

Version format is major.minor.patch[-feature]-build. Read from the source as soon as it parses - no prior ek9_compile, no subprocess. version is null (never an explanation string) when the file has no package block or does not parse; the error block says which.

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.

Recorded calls

Real calls, recorded against small projects and checked on every build - a changed answer fails it.

Query returns version

Request

{
  "file" : "<workspace-root>/package.ek9"
}

Response

{
  "file" : "package.ek9",
  "line" : 5,
  "meta" : {
    "serverMs" : "<timing>"
  },
  "module" : "com.example.pkg",
  "status" : "ok",
  "summary" : "version 1.0.0-0",
  "version" : "1.0.0-0"
}

See also