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

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

Issue 5695057915019264: Make barback more package-aware. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Additional tests. Created 7 years, 5 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.asset_provider; 5 library barback.asset_provider;
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 'transformer.dart';
11 12
13 // TODO(nweiz): change the name of this class now that it provides more than
14 // just assets.
12 /// API for locating and accessing packages on disk. 15 /// API for locating and accessing packages on disk.
13 /// 16 ///
14 /// Implemented by pub and provided to barback so that it isn't coupled 17 /// Implemented by pub and provided to barback so that it isn't coupled
15 /// directly to pub. 18 /// directly to pub.
16 abstract class AssetProvider { 19 abstract class AssetProvider {
17 /// The names of all packages that can be provided by this provider. 20 /// The names of all packages that can be provided by this provider.
18 /// 21 ///
19 /// This is equal to the transitive closure of the entrypoint package 22 /// This is equal to the transitive closure of the entrypoint package
20 /// dependencies. 23 /// dependencies.
21 Iterable<String> get packages; 24 Iterable<String> get packages;
22 25
23 // TODO(rnystrom): Make this async. 26 // TODO(rnystrom): Make this async.
24 /// The paths of all available asset files in [package], relative to the 27 /// The paths of all available asset files in [package], relative to the
25 /// package's root directory. 28 /// package's root directory.
26 /// 29 ///
27 /// You can pass [within], which should be the relative path to a directory 30 /// You can pass [within], which should be the relative path to a directory
28 /// within the package, to only return the files within that subdirectory. 31 /// within the package, to only return the files within that subdirectory.
29 List<AssetId> listAssets(String package, {String within}); 32 List<AssetId> listAssets(String package, {String within});
30 33
34 /// Returns the list of transformer phases that are applicable to [package].
35 ///
36 /// The phases will be run in sequence, with the outputs of one pipelined into
37 /// the next. All [Transformer]s in a single phase will be run in parallel.
38 Iterable<Iterable<Transformer>> getTransformers(String package);
39
31 Future<Asset> getAsset(AssetId id); 40 Future<Asset> getAsset(AssetId id);
32 } 41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698