sdk_discovery library
SDK discovery utilities for Dart tools and AOT executables.
Properties
- dartExecutable → String
-
Throwing getter that returns the absolute path to the
dartbinary.no setter - flutterExecutable → String
-
Throwing getter that returns the absolute or command path to
flutter.no setter - sdkPath → String
-
Throwing getter that locates a Dart SDK root using findSdkPath.
no setter
Functions
-
findDartExecutable(
{String? sdkPath}) → String? -
Returns the absolute path to the
dartexecutable inside the discovered SDK, ornullif no valid SDK/binary is found. -
findFlutterExecutable(
{String? flutterRoot}) → String? -
Locates the
flutterCLI executable, probingFLUTTER_ROOT,PATH, and standard Flutter checkout directories. -
findSdkPath(
) → String? -
Locates a Dart SDK root, probing in order: the running VM's executable,
the
DART_SDKenvironment variable,dartbinaries onPATH(including Flutter checkouts, whose wrapper script hides the SDK underbin/cache/dart-sdk),FLUTTER_ROOT, and standard system SDK locations. -
hasEnclosingPackageConfig(
String packagePath) → bool -
Whether
packagePathor any ancestor directory contains a.dart_tool/package_config.jsonfile. -
hasPackageConfig(
String packagePath) → bool -
Whether
packagePathcontains a.dart_tool/package_config.jsonfile. -
isFlutterPackage(
String packagePath) → bool -
Whether the package at
packagePathis a Flutter package (e.g. declaressdk: flutteror depends onpackage:flutter). -
isFlutterPubspec(
String pubspecContent) → bool -
Whether
pubspecContentindicates a Flutter package. -
isValidSdk(
String path) → bool -
Whether
pathlooks like a Dart SDK root usable by the analyzer. -
isValidSdkPath(
String path) → bool - Alias for isValidSdk.
-
resolveSdkFromDir(
String dir, String executableName) → String? -
Resolves an SDK root from a directory containing a
dartexecutable. -
runPubGet(
String packagePath, {String? sdkPath, String? flutterRoot, List< String> additionalArgs = const []}) → ProcessResult -
Runs
pub get(routing toflutter pub getordart pub get) for the package atpackagePath.