5c091e010f
This change removes the top level variable `allTargets` from `pkg/analyzer_utilities/lib/tool/api.dart` and replaces it with a method `allTargetsForPackage`, parameterized by the name of the package for which an `api.txt` file is generated. The individual code generators that make use of this function now all have their own top level variable `allTargets`. In addition to being conceptually clearer (since we no longer have a single `allTargets` variable with different meanings depending on where it's used), this paves the way for a CL I am working on that will change the `GeneratedContent` based code generators so that they use paths relative to the `pkg` directory. That in turn should make it simpler to move some of the code generated files that have to do with error messages from `pkg/analyzer` to `pkg/_fe_analyzer_shared`. Change-Id: Id636ddbca27c46ae4242bbf8e4b6f7b8dae4d4e9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438481 Reviewed-by: Samuel Rawlins <srawlins@google.com> Auto-Submit: Paul Berry <paulberry@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
20 lines
589 B
Dart
20 lines
589 B
Dart
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// This test verifies that all files generated by `generate.dart` are up to
|
|
// date.
|
|
|
|
import 'package:analyzer_utilities/tools.dart';
|
|
import 'package:path/path.dart';
|
|
|
|
import 'generate.dart';
|
|
|
|
Future<void> main() async {
|
|
await GeneratedContent.checkAll(
|
|
analyzerTestingPkgPath,
|
|
join(analyzerTestingPkgPath, 'tool', 'api', 'generate.dart'),
|
|
allTargets,
|
|
);
|
|
}
|