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

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

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 4 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
« no previous file with comments | « lib/src/asset/dart/utils.dart ('k') | lib/src/barback/asset_environment.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import 'package:barback/barback.dart'; 5 import 'package:barback/barback.dart';
6 import 'package:path/path.dart' as p; 6 import 'package:path/path.dart' as p;
7 import 'package:pub_semver/pub_semver.dart'; 7 import 'package:pub_semver/pub_semver.dart';
8 8
9 /// The currently supported versions of packages that this version of pub works 9 /// The currently supported versions of packages that this version of pub works
10 /// with. 10 /// with.
(...skipping 19 matching lines...) Expand all
30 /// 30 ///
31 /// Whenever a new minor or patch version of barback is published, this *must* 31 /// Whenever a new minor or patch version of barback is published, this *must*
32 /// be incremented to synchronize with that. See the barback [compatibility 32 /// be incremented to synchronize with that. See the barback [compatibility
33 /// documentation][compat] for details on the relationship between this 33 /// documentation][compat] for details on the relationship between this
34 /// constraint and barback's version. 34 /// constraint and barback's version.
35 /// 35 ///
36 /// [compat]: https://gist.github.com/nex3/10942218 36 /// [compat]: https://gist.github.com/nex3/10942218
37 final pubConstraints = { 37 final pubConstraints = {
38 "barback": new VersionConstraint.parse(">=0.15.0 <0.15.3"), 38 "barback": new VersionConstraint.parse(">=0.15.0 <0.15.3"),
39 "source_span": new VersionConstraint.parse(">=1.0.0 <2.0.0"), 39 "source_span": new VersionConstraint.parse(">=1.0.0 <2.0.0"),
40 "stack_trace": new VersionConstraint.parse(">=0.9.1 <2.0.0") 40 "stack_trace": new VersionConstraint.parse(">=0.9.1 <2.0.0"),
41 "async": new VersionConstraint.parse(">=1.8.0 <2.0.0")
41 }; 42 };
42 43
43 /// Converts [id] to a "package:" URI. 44 /// Converts [id] to a "package:" URI.
44 /// 45 ///
45 /// This will throw an [ArgumentError] if [id] doesn't represent a library in 46 /// This will throw an [ArgumentError] if [id] doesn't represent a library in
46 /// `lib/`. 47 /// `lib/`.
47 Uri idToPackageUri(AssetId id) { 48 Uri idToPackageUri(AssetId id) {
48 if (!id.path.startsWith('lib/')) { 49 if (!id.path.startsWith('lib/')) {
49 throw new ArgumentError("Asset id $id doesn't identify a library."); 50 throw new ArgumentError("Asset id $id doesn't identify a library.");
50 } 51 }
(...skipping 27 matching lines...) Expand all
78 if (parts.length <= index + 1) { 79 if (parts.length <= index + 1) {
79 throw new FormatException( 80 throw new FormatException(
80 'Invalid URL path "${url.path}". Expected package name ' 81 'Invalid URL path "${url.path}". Expected package name '
81 'after "packages".'); 82 'after "packages".');
82 } 83 }
83 84
84 var package = parts[index + 1]; 85 var package = parts[index + 1];
85 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2))); 86 var assetPath = p.url.join("lib", p.url.joinAll(parts.skip(index + 2)));
86 return new AssetId(package, assetPath); 87 return new AssetId(package, assetPath);
87 } 88 }
OLDNEW
« no previous file with comments | « lib/src/asset/dart/utils.dart ('k') | lib/src/barback/asset_environment.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698