analytica library
Core infrastructure and shared utilities for the Analytica tooling ecosystem.
Classes
- ExitCode
- Exit code constants.
Extensions
- AnalyticaArgParserExtensions on ArgParser
- Standard CLI argument parsing options and helpers across Analytica tools.
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
-
appendGitHubStepSummary(
String markdown, {File? summaryFile, StringSink? errSink}) → void -
Appends
markdowncontent to the GitHub Actions step summary file. -
emitGitHubError(
String message, {String? file, int? line, int? endLine, int? col, int? endColumn, String? title, StringSink? sink}) → void - Emits a GitHub Actions workflow error annotation.
-
emitGitHubNotice(
String message, {String? file, int? line, int? endLine, int? col, int? endColumn, String? title, StringSink? sink}) → void - Emits a GitHub Actions workflow notice annotation.
-
emitGitHubWarning(
String message, {String? file, int? line, int? endLine, int? col, int? endColumn, String? title, StringSink? sink}) → void - Emits a GitHub Actions workflow warning annotation.
-
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.
-
parseLineBounds(
String lines) → (int, int) -
Parses a 1-based line range of format
<start>-<end>(e.g.45-80). -
parseNonNegativeInt(
String val, String name) → int - Parses a non-negative integer or throws a FormatException.
-
resolveGitHubSummaryFile(
) → File? -
Resolves the GitHub Actions Step Summary markdown file from the environment,
or
nullif not running inside GitHub Actions. -
resolveSdkFromDir(
String dir, String executableName) → String? -
Resolves an SDK root from a directory containing a
dartexecutable. -
resolveTargetFileAndLines(
String rawTarget, {String? explicitLines}) → ({String filePath, String? linesString}) - Resolves a file target and optional line specifier from command arguments.
-
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.
Exceptions / Errors
- AnalyticaException
- Base exception for all Analytica tooling errors with exit code support.
- CliException
- General CLI exception with an explicit exit code.
- MissingInputException
- Thrown when a required input file or directory is missing.
- PackageResolutionException
- Thrown when package configuration or dependencies are unresolved.
- SdkDiscoveryException
- Thrown when a usable Dart SDK cannot be located or a provided SDK path is not a valid SDK root.
- UsageException
- Thrown when CLI argument parsing or user input validation fails.