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

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

Issue 22265002: Support cross-package transforms in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 4 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/build_result.dart ('k') | pkg/barback/lib/src/phase.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/package_graph.dart
diff --git a/pkg/barback/lib/src/package_graph.dart b/pkg/barback/lib/src/package_graph.dart
index 4dc2719221467bd29fe50a07041910903eb8e35a..c85fdd78bbaeca6e2c867afb9b4d55cc07d0710c 100644
--- a/pkg/barback/lib/src/package_graph.dart
+++ b/pkg/barback/lib/src/package_graph.dart
@@ -11,6 +11,8 @@ import 'package:stack_trace/stack_trace.dart';
import 'asset.dart';
import 'asset_cascade.dart';
import 'asset_id.dart';
+import 'asset_node.dart';
+import 'build_result.dart';
import 'errors.dart';
import 'package_provider.dart';
import 'utils.dart';
@@ -80,17 +82,15 @@ class PackageGraph {
_errors = mergeStreams(_cascades.values.map((cascade) => cascade.errors));
}
- /// Gets the asset identified by [id].
+ /// Gets the asset node identified by [id].
///
- /// If [id] is for a generated or transformed asset, this will wait until
- /// it has been created and return it. If the asset cannot be found, throws
- /// [AssetNotFoundException].
- Future<Asset> getAssetById(AssetId id) {
+ /// If [id] is for a generated or transformed asset, this will wait until it
+ /// has been created and return it. If the asset cannot be found, returns
+ /// null.
+ Future<AssetNode> getAssetNode(AssetId id) {
var cascade = _cascades[id.package];
- if (cascade != null) return cascade.getAssetById(id);
- return new Future.error(
- new AssetNotFoundException(id),
- new Trace.current().vmTrace);
+ if (cascade != null) return cascade.getAssetNode(id);
+ return new Future.value(null);
}
/// Adds [sources] to the graph's known set of source assets.
« no previous file with comments | « pkg/barback/lib/src/build_result.dart ('k') | pkg/barback/lib/src/phase.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698