Files
sdk/pkg/analyzer_testing/pubspec.yaml
T
Sam Rawlins 1188d014a9 analyzer_testing: improve error message when trying to use built-in mocks
Work towards https://github.com/dart-lang/sdk/issues/61597

The analyzer_testing package's mock packages are "data" or "resource"
files which are notoriously hard to find on disk. No dart tooling I
know of can give me "the root directory of a package which is
referenced in a Dart program via "package:". Konstantin notes that
a program may be compiled ahead of time, and so the running VM itself
does not know where source files originally came from.

When users of the analyzer_testing package try to use
`addFlutterPackageDep` in a test, which attempts to locate the Dart
SDK's `pkg/` root directory, they get a StateError. This CL adds more
information and context to that error.

Change-Id: I3ae55cd580c8fa16ca86d66e6f7b655b8f9bcc42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452532
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-09-30 21:21:39 -07:00

27 lines
800 B
YAML

name: analyzer_testing
description: Testing utilities related to the analyzer and analysis_server_plugin packages.
version: 0.1.4-dev
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer_testing
environment:
sdk: ^3.9.0
resolution: workspace
dependencies:
# See the release policy for managing this dependency at
# pkg/analyzer/doc/implementation/releasing.md.
analyzer: 8.2.0
meta: ^1.10.0
path: ^1.9.0
test: ^1.25.0
# We use 'any' version constraints here as we get our package versions from
# the dart-lang/sdk repo's DEPS file. Note that this is a special case; the
# best practice for packages is to specify their compatible version ranges.
# See also https://dart.dev/tools/pub/dependencies.
dev_dependencies:
analyzer_utilities: any
args: any
lints: any