ProjectVersionFile class abstract

The version field of a project file: read it, and write a new one with the rest of the file as it was.

One per format that has a version: pubspec.yaml, package.json, pyproject.toml, Cargo.toml, pom.xml, build.sbt. Go modules and C / C++ make or CMake projects state no version in their project file.

Constructors

ProjectVersionFile()

Properties

fileName → String
The file, relative to the project folder.
no setter
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
read(String text) → String?
The version in text, or null when the file states none.
toString() → String
A string representation of this object.
inherited
write(String text, String version) → String
text with its version replaced by version; text unchanged when it states none.

Operators

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

Static Methods

of(String projectDir) → ProjectVersionFile?
The version file of the project in projectDir, by the first project file present in the order Dart, Node, Python, Rust, Java; null when it has none of them.