BricksJson class

A local cache for mason bricks.

This cache contains local paths to all bricks.

Constructors

BricksJson({required Directory directory})
Creates a BricksJson instance from the directory.
BricksJson.global()
Creates a BricksJson instance from the global bricks.json file.
BricksJson.temp()
Creates a BricksJson instance from a temporary directory.

Properties

cache Map<String, String>
Read-only cache of brick,location pairs.
no setter
encode String
Encodes entire cache contents.
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

add(Brick brick) Future<CachedBrick>
Caches brick if necessary and updates bricks.json. Returns the CachedBrick which includes the resolved brick and local path.
clear() → void
Removes all key/value pairs from the cache.
flush() Future<void>
Flushes cache contents to bricks.json.
getPath(Brick brick) String?
Returns the local path to the brick if it is included in the cache. Returns null if the brick has not been cached.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(Brick brick) → void
Removes current brick from bricks.json.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

bundled Directory
Bundled subdirectory within the mason cache.
no setter
globalDir Directory
Global subdirectory within the mason cache.
no setter
hostedUri Uri
The uri of the registry where bricks are hosted.
no setter
rootDir Directory
Root mason cache directory
no setter
testEnvironment Map<String, String>?
Environment map which can be overridden for testing purposes.
getter/setter pair
testIsWindows bool?
bool which can be overridden for test purposes to indicate the platform is windows.
getter/setter pair