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.dartfiles. Returns the number of files removed. WhendryRunis true, only reports; does not delete. -
findStaleGeneratedFiles(
) → List< File> -
Returns
*.g.dartfiles whose companion source file no longer declares them via apart '*.g.dart';directive — i.e. stale leftovers. -
listGeneratedFiles(
) → List< File> -
Returns every
*.g.dartfile under projectPath, excluding build/ and hidden directories. Returns all*.g.dartfiles 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 needbuild_runner. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited