Index: sdk/lib/_internal/pub/lib/src/barback/barback_server.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart b/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart |
index 611d62ff1931fc51a014003636d0b910dc222f19..954658b600eb797c3360b84674d77538fd9b4ca5 100644 |
--- a/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart |
+++ b/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart |
@@ -117,6 +117,25 @@ class BarbackServer extends BaseServer<BarbackServerResult> { |
return; |
} |
+ // TODO(rnystrom): Remove this when #16647 is fixed. |
+ // The "assets" path is deprecated so warn if the user is relying on it. |
+ // We do this here in pub serve so we only warn if they in fact actually |
+ // use an asset from a package's "asset" directory. |
+ if (id.path.startsWith("asset/")) { |
+ var message = 'Warning: Support for the "asset" directory is deprecated ' |
+ 'and will be removed soon.\n'; |
+ |
+ var fixed = id.path.replaceAll(new RegExp(r"^asset/"), "lib/"); |
+ if (id.package == environment.rootPackage.name) { |
+ message += 'Please move "${id.path}" to "$fixed".'; |
+ } else { |
+ message += 'Please ask the maintainer of "${id.package}" to move ' |
+ '"${id.path}" to "$fixed".'; |
+ } |
+ |
+ log.warning(log.yellow(message)); |
+ } |
+ |
logRequest(request, "Loading $id"); |
environment.barback.getAssetById(id).then((result) { |
logRequest(request, "getAssetById($id) returned"); |