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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback.dart

Issue 306693002: Remove support for the special "assets" directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback.dart b/sdk/lib/_internal/pub/lib/src/barback.dart
index 00a2a954e60aba76a7f4f21272d9d214bddfcb6f..af5e0c45927b8597c40d748283ef9c076dd8d816 100644
--- a/sdk/lib/_internal/pub/lib/src/barback.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback.dart
@@ -204,18 +204,13 @@ Uri idToPackageUri(AssetId id) {
return new Uri(scheme: 'package', path: id.path.replaceFirst('lib/', ''));
}
-/// Converts [uri] into an [AssetId] if its path is within "packages" or
-/// "assets".
-///
-/// While "packages" can appear anywhere in the path, "assets" is only allowed
-/// as the top-level directory. (This throws a [FormatException] if "assets"
-/// appears anywhere else.)
+/// Converts [uri] into an [AssetId] if its path is within "packages".
///
/// If the URL contains a special directory, but lacks a following package name,
/// throws a [FormatException].
///
/// If the URI doesn't contain one of those special directories, returns null.
-AssetId specialUrlToId(Uri url) {
+AssetId packagesUrlToId(Uri url) {
var parts = path.url.split(url.path);
// Strip the leading "/" from the URL.
@@ -223,20 +218,7 @@ AssetId specialUrlToId(Uri url) {
if (parts.isEmpty) return null;
- // Check for "assets" at the beginning of the URL.
- if (parts.first == "assets") {
- if (parts.length <= 1) {
- throw new FormatException(
- 'Invalid URL path "${url.path}". Expected package name after '
- '"assets".');
- }
-
- var package = parts[1];
- var assetPath = path.url.join("asset", path.url.joinAll(parts.skip(2)));
- return new AssetId(package, assetPath);
- }
-
- // Check for "packages" anywhere in the URL.
+ // Check for "packages" in the URL.
// TODO(rnystrom): If we rewrite "package:" imports to relative imports that
// point to a canonical "packages" directory, we can limit "packages" to the
// root of the URL as well. See: #16649.
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698