addLibraryToGraph method

void addLibraryToGraph(
  1. DartDocResolvedLibrary resolvedLibrary

Call during initialization to add a library to this PackageGraph.

Libraries added in this manner are assumed to be part of documented packages, even if includes or embedder.yaml files cause these to span packages.


void addLibraryToGraph(DartDocResolvedLibrary resolvedLibrary) {
  var libraryElement = resolvedLibrary.element;
  var packageMeta =
      packageMetaProvider.fromElement(libraryElement, config.sdkDir);
  if (packageMeta == null) {
    throw DartdocFailure(packageMetaProvider.getMessageForMissingPackageMeta(
        libraryElement, config));
  var lib = Library.fromLibraryResult(
      resolvedLibrary, this, Package.fromPackageMeta(packageMeta, this));
  allLibraries[libraryElement.source.fullName] = lib;