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

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: Address comments 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
« no previous file with comments | « lib/src/options.dart ('k') | lib/src/server/server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/server/dependency_graph.dart
diff --git a/lib/src/server/dependency_graph.dart b/lib/src/server/dependency_graph.dart
index a5bbecf89ba4887acbc6ace9157e1846adbea9c4..60835e40f84f600aba70cfb4bf446ae032166270 100644
--- a/lib/src/server/dependency_graph.dart
+++ b/lib/src/server/dependency_graph.dart
@@ -156,6 +156,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.
@@ -466,7 +482,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));
« no previous file with comments | « lib/src/options.dart ('k') | lib/src/server/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698