RefSource class

A git branch, tag or commit built instead of the working copy (build --ref stable), so a release can be built from another branch without switching the project away from the one being worked on.

The ref's committed files are staged in a folder of their own, with the project's local-only files added: everything git ignores, such as client .env/.secrets files, keystores and Firebase configs, which exist only in the working copy. Build outputs and generated code are left out; the build regenerates them for the ref. Workspaces sync from the staged folder instead of the project.

Properties

commit → String
The full commit hash.
final
hashCode → int
The hash code for this object.
no setterinherited
label → String
no setter
notes → List<String>
What the user should know about how ref was resolved.
final
ref → String
As given: stable.
final
resolvedRef → String
What is built: ref, or its remote branch (origin/stable) when the local branch is behind it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shortCommit → String
no setter
tree → Directory
The staged files the workspaces sync from.
final

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 Methods

copiesLocalFile(String rel) → bool
Whether a git-ignored file of the working copy goes into the build.
isGenerated(String rel) → bool
Generated code: never copied from the working copy (it belongs to the working copy's branch), and kept in the workspace between builds so build_runner only regenerates what changed.
poolName(String ref) → String
Folder name for the workspaces that build this ref, so each ref keeps its own build caches.
prepare({required String projectDir, required String ref, required Directory stagingRoot, bool fetch = true}) → Future<RefSource>
Resolves ref in projectDir's repository and stages its files under stagingRoot. Fetches first (unless fetch is false), so a branch is built as it is on the remote.