| 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; |
| 11 | 11 |
| 12 import 'utils.dart'; | 12 import 'utils.dart'; |
| 13 import 'version.dart'; | 13 import 'version.dart'; |
| 14 | 14 |
| 15 /// The currently supported version of the Barback package that this version of | 15 /// The currently supported versions of the Barback package that this version of |
| 16 /// pub works with. | 16 /// pub works with. |
| 17 /// | 17 /// |
| 18 /// Pub implicitly constrains barback to this version or later patch versions. | 18 /// Pub implicitly constrains barback to these versions. |
| 19 /// | 19 /// |
| 20 /// Barback is in a unique position. Pub imports it, so a copy of Barback is | 20 /// Barback is in a unique position. Pub imports it, so a copy of Barback is |
| 21 /// physically included in the SDK. Packages also depend on Barback (from | 21 /// physically included in the SDK. Packages also depend on Barback (from |
| 22 /// pub.dartlang.org) when they implement their own transformers. Pub's plug-in | 22 /// pub.dartlang.org) when they implement their own transformers. Pub's plug-in |
| 23 /// API dynamically loads transformers into their own isolate. | 23 /// API dynamically loads transformers into their own isolate. |
| 24 /// | 24 /// |
| 25 /// This includes a string literal of Dart code ([_TRANSFORMER_ISOLATE] in | 25 /// This includes a string literal of Dart code ([_TRANSFORMER_ISOLATE] in |
| 26 /// load_transformers.dart). That code imports "package:barback/barback.dart". | 26 /// load_transformers.dart). That code imports "package:barback/barback.dart". |
| 27 /// This string is included in the SDK, but that import is resolved using the | 27 /// This string is included in the SDK, but that import is resolved using the |
| 28 /// application’s version of Barback. That means it must tightly control which | 28 /// application’s version of Barback. That means it must tightly control which |
| 29 /// version of Barback the application is using so that it's one that pub | 29 /// version of Barback the application is using so that it's one that pub |
| 30 /// supports. | 30 /// supports. |
| 31 /// | 31 /// |
| 32 /// Whenever a new non-patch version of barback is published, this *must* be | 32 /// Whenever a new non-patch version of barback is published, this *must* be |
| 33 /// incremented to synchronize with that. | 33 /// incremented to synchronize with that. |
| 34 final supportedVersion = new Version(0, 12, 0); | 34 final supportedVersions = new VersionConstraint.parse(">=0.11.0 <0.13.0"); |
| 35 | 35 |
| 36 /// A list of the names of all built-in transformers that pub exposes. | 36 /// A list of the names of all built-in transformers that pub exposes. |
| 37 const _BUILT_IN_TRANSFORMERS = const ['\$dart2js']; | 37 const _BUILT_IN_TRANSFORMERS = const ['\$dart2js']; |
| 38 | 38 |
| 39 /// An identifier for a transformer and the configuration that will be passed to | 39 /// An identifier for a transformer and the configuration that will be passed to |
| 40 /// it. | 40 /// it. |
| 41 /// | 41 /// |
| 42 /// It's possible that the library identified by [this] defines multiple | 42 /// It's possible that the library identified by [this] defines multiple |
| 43 /// transformers. If so, [configuration] will be passed to all of them. | 43 /// transformers. If so, [configuration] will be passed to all of them. |
| 44 class TransformerId { | 44 class TransformerId { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 if (id.package != entrypoint) { | 233 if (id.package != entrypoint) { |
| 234 throw new FormatException( | 234 throw new FormatException( |
| 235 'Can only access "lib" and "asset" directories of non-entrypoint ' | 235 'Can only access "lib" and "asset" directories of non-entrypoint ' |
| 236 'packages.'); | 236 'packages.'); |
| 237 } | 237 } |
| 238 | 238 |
| 239 // Allow any path in the entrypoint package. | 239 // Allow any path in the entrypoint package. |
| 240 return path.url.join("/", path.url.joinAll(parts)); | 240 return path.url.join("/", path.url.joinAll(parts)); |
| 241 } | 241 } |
| OLD | NEW |