buildGraph static method

ProjectGraph buildGraph(
  1. List<SourceFile> files
)

Implementation

static ProjectGraph buildGraph(List<SourceFile> files) {
  final graph = ProjectGraph();

  for (final file in files) {
    graph.addNode(file.path);
    for (final imported in file.imports) {
      graph.addDependency(file.path, imported);
    }
    for (final exported in file.exports) {
      graph.addDependency(file.path, exported);
    }
  }

  return graph;
}