| OLD | NEW |
| 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_set.dart'; |
| 11 import 'build_result.dart'; | 12 import 'build_result.dart'; |
| 12 import 'errors.dart'; | 13 import 'errors.dart'; |
| 13 import 'package_graph.dart'; | 14 import 'package_graph.dart'; |
| 14 import 'package_provider.dart'; | 15 import 'package_provider.dart'; |
| 16 import 'transformer.dart'; |
| 15 | 17 |
| 16 /// A general-purpose asynchronous build dependency graph manager. | 18 /// A general-purpose asynchronous build dependency graph manager. |
| 17 /// | 19 /// |
| 18 /// It consumes source assets (including Dart files) in a set of packages, | 20 /// It consumes source assets (including Dart files) in a set of packages, |
| 19 /// runs transformations on them, and then tracks which sources have been | 21 /// runs transformations on them, and then tracks which sources have been |
| 20 /// modified and which transformations need to be re-run. | 22 /// modified and which transformations need to be re-run. |
| 21 /// | 23 /// |
| 22 /// To do this, you give barback a [PackageProvider] which can yield a set of | 24 /// To do this, you give barback a [PackageProvider] which can yield a set of |
| 23 /// [Transformer]s and raw source [Asset]s. Then you tell it which input files | 25 /// [Transformer]s and raw source [Asset]s. Then you tell it which input files |
| 24 /// have been added or modified by calling [updateSources]. Barback will | 26 /// have been added or modified by calling [updateSources]. Barback will |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 /// Begins applying any transforms that can consume any of the sources. If a | 84 /// Begins applying any transforms that can consume any of the sources. If a |
| 83 /// given source is already known, it is considered modified and all | 85 /// given source is already known, it is considered modified and all |
| 84 /// transforms that use it will be re-applied. | 86 /// transforms that use it will be re-applied. |
| 85 void updateSources(Iterable<AssetId> sources) => | 87 void updateSources(Iterable<AssetId> sources) => |
| 86 _graph.updateSources(sources); | 88 _graph.updateSources(sources); |
| 87 | 89 |
| 88 /// Removes [removed] from the graph's known set of source assets. | 90 /// Removes [removed] from the graph's known set of source assets. |
| 89 void removeSources(Iterable<AssetId> removed) => | 91 void removeSources(Iterable<AssetId> removed) => |
| 90 _graph.removeSources(removed); | 92 _graph.removeSources(removed); |
| 91 | 93 |
| 94 /// Gets all output assets. |
| 95 /// |
| 96 /// If a build is currently in progress, waits until it completes. The |
| 97 /// returned future will complete with a [BarbackException] if the build is |
| 98 /// not successful. |
| 99 Future<AssetSet> getAllAssets() => _graph.getAllAssets(); |
| 100 |
| 92 /// Sets the transformer phases for [package]'s assets to [transformers]. | 101 /// Sets the transformer phases for [package]'s assets to [transformers]. |
| 93 /// | 102 /// |
| 94 /// To the extent that [transformers] is similar to the previous transformer | 103 /// To the extent that [transformers] is similar to the previous transformer |
| 95 /// phases for [package], the existing asset graph will be preserved. | 104 /// phases for [package], the existing asset graph will be preserved. |
| 96 void updateTransformers(String package, | 105 void updateTransformers(String package, |
| 97 Iterable<Iterable<Transformer>> transformers) => | 106 Iterable<Iterable<Transformer>> transformers) => |
| 98 _graph.updateTransformers(package, transformers); | 107 _graph.updateTransformers(package, transformers); |
| 99 } | 108 } |
| OLD | NEW |