| 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 'package:barback/barback.dart'; | 7 import 'package:barback/barback.dart'; |
| 8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
| 9 | 9 import 'package:pub_semver/pub_semver.dart'; |
| 10 import 'version.dart'; | |
| 11 | 10 |
| 12 /// The currently supported versions of packages that this version of pub works | 11 /// The currently supported versions of packages that this version of pub works |
| 13 /// with. | 12 /// with. |
| 14 /// | 13 /// |
| 15 /// Pub implicitly constrains these packages to these versions as long as | 14 /// Pub implicitly constrains these packages to these versions as long as |
| 16 /// barback is a dependency. | 15 /// barback is a dependency. |
| 17 /// | 16 /// |
| 18 /// Users' transformers are loaded in an isolate that uses the entrypoint | 17 /// Users' transformers are loaded in an isolate that uses the entrypoint |
| 19 /// package's dependency versions. However, that isolate also loads code | 18 /// package's dependency versions. However, that isolate also loads code |
| 20 /// provided by pub (`asset/dart/transformer_isolate.dart` and associated | 19 /// provided by pub (`asset/dart/transformer_isolate.dart` and associated |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 if (parts.length <= index + 1) { | 80 if (parts.length <= index + 1) { |
| 82 throw new FormatException( | 81 throw new FormatException( |
| 83 'Invalid URL path "${url.path}". Expected package name ' | 82 'Invalid URL path "${url.path}". Expected package name ' |
| 84 'after "packages".'); | 83 'after "packages".'); |
| 85 } | 84 } |
| 86 | 85 |
| 87 var package = parts[index + 1]; | 86 var package = parts[index + 1]; |
| 88 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2))); | 87 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2))); |
| 89 return new AssetId(package, assetPath); | 88 return new AssetId(package, assetPath); |
| 90 } | 89 } |
| OLD | NEW |