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 pub.barback; | 5 library pub.barback; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 /// This is relative to the `lib/` directory in [package], and doesn't end in | 50 /// This is relative to the `lib/` directory in [package], and doesn't end in |
51 /// `.dart`. | 51 /// `.dart`. |
52 /// | 52 /// |
53 /// This can be null; if so, it indicates that the transformer(s) should be | 53 /// This can be null; if so, it indicates that the transformer(s) should be |
54 /// loaded from `lib/transformer.dart` if that exists, and `lib/$package.dart` | 54 /// loaded from `lib/transformer.dart` if that exists, and `lib/$package.dart` |
55 /// otherwise. | 55 /// otherwise. |
56 final String path; | 56 final String path; |
57 | 57 |
58 /// The configuration to pass to the transformer. | 58 /// The configuration to pass to the transformer. |
59 /// | 59 /// |
60 /// This will be an empty map if no configuration was provided. | 60 /// Any pub-specific configuration (i.e. keys starting with "$") will have |
| 61 /// been stripped out of this and handled separately. This will be an empty |
| 62 /// map if no configuration was provided. |
61 final Map configuration; | 63 final Map configuration; |
62 | 64 |
63 /// The primary input inclusions. | 65 /// The primary input inclusions. |
64 /// | 66 /// |
65 /// Each inclusion is an asset path. If this set is non-empty, than *only* | 67 /// Each inclusion is an asset path. If this set is non-empty, than *only* |
66 /// matching assets are allowed as a primary input by this transformer. If | 68 /// matching assets are allowed as a primary input by this transformer. If |
67 /// `null`, all assets are included. | 69 /// `null`, all assets are included. |
68 /// | 70 /// |
69 /// This is processed before [excludes]. If a transformer has both includes | 71 /// This is processed before [excludes]. If a transformer has both includes |
70 /// and excludes, then the set of included assets is determined and assets | 72 /// and excludes, then the set of included assets is determined and assets |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 307 |
306 if (id.package != entrypoint) { | 308 if (id.package != entrypoint) { |
307 throw new FormatException( | 309 throw new FormatException( |
308 'Can only access "lib" and "asset" directories of non-entrypoint ' | 310 'Can only access "lib" and "asset" directories of non-entrypoint ' |
309 'packages.'); | 311 'packages.'); |
310 } | 312 } |
311 | 313 |
312 // Allow any path in the entrypoint package. | 314 // Allow any path in the entrypoint package. |
313 return path.url.join("/", path.url.joinAll(parts)); | 315 return path.url.join("/", path.url.joinAll(parts)); |
314 } | 316 } |
OLD | NEW |