BuildContext class

Configuration and context values used during Build.execute.

Constructors

BuildContext(Uri rootLibraryFileUri, Uri buildDirectoryUri, Uri executableUri, String source, {Map<String, String>? environment, bool forTests = false})
BuildContext.fromMap(Map<String, dynamic> map)
factory

Properties

analyzer CodeAnalyzer
latefinal
buildApplicationDirectory Directory
Directory for compiled application
no setter
buildDirectory Directory
The directory where build artifacts are stored.
no setter
buildDirectoryUri Uri
A Uri to directory where build artifacts are stored during the build process.
final
buildPackagesDirectory Directory
Directory for compiled packages
no setter
buildRuntimeDirectory Directory
The generated runtime directory
no setter
context MirrorContext
The RuntimeContext available during the build process.
no setter
environment Map<String, String>?
final
executableUri Uri
A Uri to the executable build product file.
final
forTests bool
Whether dev dependencies of the application package are included in the dependencies of the compiled executable.
final
hashCode int
The hash code for this object.
no setterinherited
packageConfig Future<PackageConfig>
Gets dependency package location relative to sourceApplicationDirectory.
no setter
rootLibraryFileUri Uri
A Uri to the library file of the application to be compiled.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeMap Map<String, dynamic>
no setter
source String
The source script for the executable.
final
sourceApplicationDirectory Directory
The directory of the application being compiled.
no setter
sourceApplicationPubspec → Pubspec
no setter
sourceApplicationPubspecMap Map
no setter
sourceLibraryFile File
The library file of the application being compiled.
no setter
targetScriptFileUri Uri
no setter

Methods

getAnnotationsFromField(Type type1, String propertyName) Future<List<Annotation>>
getClassDeclarationFromType(Type type) Future<ClassDeclaration?>
getDirectory(Uri uri) Directory
Returns a Directory at uri, creates it recursively if it doesn't exist.
getFile(Uri uri) File
Returns a File at uri, creates all parent directories recursively if necessary.
getImportDirectives({Uri? uri, String? source, bool alsoImportOriginalFile = false}) Future<List<String>>
getPackageFromUri(Uri? uri) Future<Package?>
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