Files
kevmoo a2055fbb82 pkg:api_summary
- Moved existing summary logic to the new package

Change-Id: I47d032f5a253cfa32d9b685d9ff18bb08f534177
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499440
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2026-05-01 11:29:56 -07:00

27 lines
891 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.
/// Generates the file `api.txt`, which describes a package's public API.
library;
import 'package:api_summary/api_summary.dart';
import 'package:analyzer_utilities/tools.dart';
import 'package:path/path.dart';
/// Computes a list of all targets generated by this code generator for a given
/// package.
List<GeneratedContent> allTargetsForPackage(
String packageName, {
ApiSummaryCustomizer Function()? createCustomizer,
}) => [
GeneratedFile('$packageName/api.txt', (pkgRoot) async {
var packagePath = join(pkgRoot, packageName);
return await summarizePackage(
packagePath,
packageName,
createCustomizer: createCustomizer,
);
}),
];