BuiltinVariables class

Values that distribution.yaml can reference without declaring them.

These cover the two things almost every release pipeline needs and that are otherwise awkward to express: the current git state and the version declared in pubspec.yaml. For example, deriving the build number from the commit count no longer needs a wrapper script:

builder:
  android:
    build-name: "${{PUBSPEC_VERSION_NAME}}"
    build-number: "${{GIT_COMMIT_COUNT}}"

Every value is resolved lazily and memoised: a configuration that never mentions GIT_SHA never spawns git. User defined variables and real environment variables both take precedence, so any of these can be overridden - which also makes them easy to pin in tests.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

changelogOptions ChangelogOptions?
Settings the changelog: section supplies to ${{CHANGELOG}}.
getter/setter pair
changelogPolisher Future<String> Function(String notes)?
Rewrites the rendered notes, when changelog: ai: asked for it.
getter/setter pair
names Set<String>
The set of names this class can provide.
no setter
projectRoot String
Best-effort path to the project root, used for diagnostics.
no setter

Static Methods

contains(String name) bool
Whether name is a built-in variable.
reset() → void
Clears the memoised values. Intended for tests.
resolve(String name) Future<String?>
Resolves name, returning null when it is not a built-in or when it cannot be determined (for example GIT_TAG outside a tagged repository).
resolveAll() Future<Map<String, String>>
Resolves every built-in, skipping the ones that are unavailable.