GeneratedFileManager class

Tracks and cleans up stale *.g.dart files left over from previous build_runner runs after source files have been renamed or deleted.

Constructors

GeneratedFileManager(String projectPath)
Creates a GeneratedFileManager for the project at projectPath.

Properties

hashCode int
The hash code for this object.
no setterinherited
projectPath String
Absolute path to the project root.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cleanStaleFiles({bool dryRun = false}) int
Deletes stale *.g.dart files. Returns the number of files removed. When dryRun is true, only reports; does not delete.
findStaleGeneratedFiles() List<File>
Returns *.g.dart files whose companion source file no longer declares them via a part '*.g.dart'; directive — i.e. stale leftovers.
listGeneratedFiles() List<File>
Returns every *.g.dart file under projectPath, excluding build/ and hidden directories. Returns all *.g.dart files under projectPath, excluding build and tool dirs.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pendingBuildRunnerFiles(List<String> modifiedFilePaths) List<String>
Given a list of source files that were rewritten, returns those that now contain a part '*.g.dart'; directive and therefore need build_runner.
toString() String
A string representation of this object.
inherited

Operators

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