pub library

Classes

DartExecutableWithPackageConfig
The result of a getExecutableForCommand command resolution.

Enums

CommandResolutionIssue
Information on why no executable is returned.

Functions

ensurePubspecResolved(String dir, {bool isOffline = false, bool summaryOnly = true, bool onlyOutputWhenTerminal = true}) Future<void>
Makes sure that dir/pubspec.yaml is resolved such that pubspec.lock and .dart_tool/package_config.json are up-to-date and all packages are downloaded to the cache.
getExecutableForCommand(String descriptor, {bool allowSnapshot = true, String? root, String? pubCacheDir, List<String> additionalSources = const [], String? nativeAssets}) Future<DartExecutableWithPackageConfig>
Returns the dart program/snapshot to invoke for running descriptor resolved according to the package configuration of the package at root (defaulting to the current working directory). Using the pub-cache at pubCacheDir (defaulting to the default pub cache).
getPackageNameFromGitRepo(String url, {String? ref, String? path, String? tagPattern, String? relativeTo, bool isOffline = false}) Future<String>
Given a Git repo that contains a pub package, gets the name of the pub package.
pubCommand({required bool isVerbose(), String category = ''}) → Command<int>
Returns a Command for pub functionality that can be used by an embedding CommandRunner.

Exceptions / Errors

CommandResolutionFailedException
Indicates that a command string did not resolve to an executable.
ResolutionFailedException