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

Unified Diff: pkg/barback/lib/src/change_batch.dart

Issue 16854005: First pass at build dependency graph for barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle unprovided sources and errors a bit better. Created 7 years, 6 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 | « pkg/barback/lib/src/asset_provider.dart ('k') | pkg/barback/lib/src/errors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/change_batch.dart
diff --git a/pkg/barback/lib/src/change_batch.dart b/pkg/barback/lib/src/change_batch.dart
new file mode 100644
index 0000000000000000000000000000000000000000..aa2a1c4f94b5151b86717ccd19c5a121a2acb625
--- /dev/null
+++ b/pkg/barback/lib/src/change_batch.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library barback.change_batch;
+
+import 'asset.dart';
+import 'asset_id.dart';
+
+/// Represents a batch of source asset changes: additions, removals and
+/// modifications.
+class ChangeBatch {
+ /// The assets that have been added or modified in this batch.
+ final updated = new Set<AssetId>();
+
+ /// The assets that have been removed in this batch.
+ final removed = new Set<AssetId>();
+
+ /// Adds the updated [assets] to this batch.
+ void update(Iterable<AssetId> assets) {
+ updated.addAll(assets);
+
+ // If they were previously removed, they are back now.
+ removed.removeAll(assets);
+ }
+
+ /// Removes [assets] from this batch.
+ void remove(Iterable<AssetId> assets) {
+ removed.addAll(assets);
+
+ // If they were previously updated, they are gone now.
+ updated.removeAll(assets);
+ }
+}
« no previous file with comments | « pkg/barback/lib/src/asset_provider.dart ('k') | pkg/barback/lib/src/errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698