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

Side by Side Diff: pkg/barback/lib/src/barback.dart

Issue 22265002: Support cross-package transforms in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove a duplicated test. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library barback.barback; 5 library barback.barback;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset.dart'; 9 import 'asset.dart';
10 import 'asset_id.dart'; 10 import 'asset_id.dart';
11 import 'asset_cascade.dart'; 11 import 'build_result.dart';
12 import 'package_graph.dart'; 12 import 'package_graph.dart';
13 import 'package_provider.dart'; 13 import 'package_provider.dart';
14 14
15 /// A general-purpose asynchronous build dependency graph manager. 15 /// A general-purpose asynchronous build dependency graph manager.
16 /// 16 ///
17 /// It consumes source assets (including Dart files) in a set of packages, 17 /// It consumes source assets (including Dart files) in a set of packages,
18 /// runs transformations on them, and then tracks which sources have been 18 /// runs transformations on them, and then tracks which sources have been
19 /// modified and which transformations need to be re-run. 19 /// modified and which transformations need to be re-run.
20 /// 20 ///
21 /// To do this, you give barback a [PackageProvider] which can yield a set of 21 /// To do this, you give barback a [PackageProvider] which can yield a set of
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 Stream get errors => _graph.errors; 62 Stream get errors => _graph.errors;
63 63
64 Barback(PackageProvider provider) 64 Barback(PackageProvider provider)
65 : _graph = new PackageGraph(provider); 65 : _graph = new PackageGraph(provider);
66 66
67 /// Gets the asset identified by [id]. 67 /// Gets the asset identified by [id].
68 /// 68 ///
69 /// If [id] is for a generated or transformed asset, this will wait until 69 /// If [id] is for a generated or transformed asset, this will wait until
70 /// it has been created and return it. If the asset cannot be found, throws 70 /// it has been created and return it. If the asset cannot be found, throws
71 /// [AssetNotFoundException]. 71 /// [AssetNotFoundException].
72 Future<Asset> getAssetById(AssetId id) => _graph.getAssetById(id); 72 Future<Asset> getAssetById(AssetId id) =>
73 _graph.getAssetNode(id).then((node) => node.whenAvailable);
73 74
74 /// Adds [sources] to the graph's known set of source assets. 75 /// Adds [sources] to the graph's known set of source assets.
75 /// 76 ///
76 /// Begins applying any transforms that can consume any of the sources. If a 77 /// Begins applying any transforms that can consume any of the sources. If a
77 /// given source is already known, it is considered modified and all 78 /// given source is already known, it is considered modified and all
78 /// transforms that use it will be re-applied. 79 /// transforms that use it will be re-applied.
79 void updateSources(Iterable<AssetId> sources) => 80 void updateSources(Iterable<AssetId> sources) =>
80 _graph.updateSources(sources); 81 _graph.updateSources(sources);
81 82
82 /// Removes [removed] from the graph's known set of source assets. 83 /// Removes [removed] from the graph's known set of source assets.
83 void removeSources(Iterable<AssetId> removed) => 84 void removeSources(Iterable<AssetId> removed) =>
84 _graph.removeSources(removed); 85 _graph.removeSources(removed);
85 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698