Skip to content

Commit

Permalink
Fix summary generation in "package-summary-only" mode.
Browse files Browse the repository at this point in the history
If we aren't doing full analysis, then we can't use
`context.librarySources` to find out the set of library sources (because
it doesn't include sources that haven't been examined yet).  Instead, we
have to query each source to find out its type.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1770323003 .
  • Loading branch information
stereotype441 committed Mar 8, 2016
1 parent a0e3bfd commit c497c02
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/analyzer_cli/lib/src/package_analyzer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ class PackageAnalyzer {
// Write summary for Dart libraries.
if (options.packageSummaryOutput != null) {
PackageBundleAssembler assembler = new PackageBundleAssembler();
for (Source source in context.librarySources) {
for (Source source in explicitSources) {
if (context.computeKindOf(source) != SourceKind.LIBRARY) {
continue;
}
if (pathos.isWithin(packageLibPath, source.fullName)) {
LibraryElement libraryElement = context.computeLibraryElement(source);
if (libraryElement != null) {
assembler.serializeLibraryElement(libraryElement);
}
assembler.serializeLibraryElement(libraryElement);
}
}
// Write the whole package bundle.
Expand Down

0 comments on commit c497c02

Please sign in to comment.