Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: lib/src/server/dependency_graph.dart

Issue 1645343002: Builds / serves multiple HTML files. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Cleanup Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/server/dependency_graph.dart
diff --git a/lib/src/server/dependency_graph.dart b/lib/src/server/dependency_graph.dart
index 9ab8d3d03d05462e833ca24a8eb556385765230e..7d66768ec092a217753d0f26c2cda919d95ac488 100644
--- a/lib/src/server/dependency_graph.dart
+++ b/lib/src/server/dependency_graph.dart
@@ -157,6 +157,22 @@ abstract class SourceNode {
}
}
+/// A unique node representing all entry points in the graph. This is just for
+/// graph algorthm convenience.
+class EntryNode extends SourceNode {
+ final Iterable<SourceNode> entryPoints;
+
+ @override
+ Iterable<SourceNode> get allDeps => entryPoints;
+
+ @override
+ Iterable<SourceNode> get depsWithoutParts => entryPoints;
+
+ EntryNode(SourceGraph graph, Uri uri, Iterable<SourceNode> nodes)
+ : entryPoints = nodes,
+ super(graph, uri, null);
+}
+
/// A node representing an entry HTML source file.
class HtmlSourceNode extends SourceNode {
/// Resources included by default on any application.
@@ -467,7 +483,7 @@ rebuild(SourceNode start, bool build(SourceNode node)) {
bool shouldBuildNode(SourceNode n) {
if (n.needsRebuild) return true;
if (n is HtmlSourceNode) return htmlNeedsRebuild;
- if (n is ResourceSourceNode) return false;
+ if (n is ResourceSourceNode || n is EntryNode) return false;
return (n as DartSourceNode)
.imports
.any((i) => apiChangeDetected.contains(i));

Powered by Google App Engine
This is Rietveld 408576698