PubCache class
Used to locate and manipulate the dart pub cache
Constructors
- PubCache()
-
factory
- PubCache.forScope()
-
Use this ctor to alter the location of .pub-cache
during testing.
factory
Properties
- cacheDir → String
-
Returns the directory name of the pub cache.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- pathTo ↔ String
-
The fully qualified path to the pub cache.
getter/setter pair
- pathToBin → String
-
The fully qualified path to the pub cache's bin directory
where executables from installed packages are stored.
no setter
- pathToDartLang → String
-
Path to the PubCache's hosted/pub.dartlang.org directory
where all of the downloaded packages from pub.dev live.
@deprecated use pathToHosted
no setter
- pathToHosted → String
-
Path to the pub cache hosted directory
hosted/pub.dartlang.org
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
findPrimaryVersion(
String packageName) → Version? - Finds and returns the latest (non-pre-release) version installed into pub cache for the given package.
-
globalActivate(
String packageName) → void -
Run dart pub global activate on the given
packageName
. -
globalActivateFromSource(
String path) → void -
Run dart pub global activate for a package located in
path
relative to the current directory. -
globalDeactivate(
String packageName) → void -
Run dart pub global deactivate on the given
packageName
. -
isGloballyActivated(
String packageName) → bool - returns true if the given package has been globally activated
-
isGloballyActivatedFromSource(
String packageName) → bool -
Returns true if the the dart project
packageName
is running from local source. This means that the package has been activated via -
isInstalled(
String packageName) → bool - Returns true if the package is installed in pub-cache
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pathToPackage(
String packageName, String version) → String -
Returns the path to the package in .pub-cache for the dart
project named
packageName
for the versionversion
. e.g. ~/.pub-cache/hosted/pub.dartlang.org/dswitch-4.0.1 -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- envVarPubCache → const String
- The name of the environment variable that can be set to change the location of the .pub-cache directory. You should change this path by calling pathTo.