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

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

Issue 228263008: Since we're not going to be treating "asset" as special soon, we don't need to yell at the user for… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/test/build/warns_on_assets_paths_test.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/entrypoint.dart
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index c098eeccbc57eb23a2b3b63e9cfe56262eaf98f1..2c360e14d3d89aa321815f9e2d22eef29193bd0d 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -248,57 +248,21 @@ class Entrypoint {
});
}
- /// Warns users if they have directory or file named `assets` directly
- /// inside a top-level directory.
- void _warnOnAssetsPaths() {
- var buffer = new StringBuffer();
-
- warn(message) {
- if (buffer.isEmpty) {
- buffer.writeln(
- 'Warning: Pub reserves paths containing "assets" for using assets '
- 'from packages.');
- }
-
- buffer.writeln(message);
- }
-
- // Look inside all of the top-level directories.
- for (var dir in ordered(listDir(root.dir))) {
- var assetsPath = path.join(dir, "assets");
- var relative = path.relative(assetsPath, from: root.dir);
- if (dirExists(assetsPath)) {
- warn('Please rename the directory "$relative".');
- } else if (entryExists(assetsPath)) {
- warn('Please rename the file "$relative".');
- }
- }
-
- if (buffer.isNotEmpty) log.warning(buffer);
- }
-
/// Loads the package graph for the application and all of its transitive
/// dependencies. Before loading makes sure the lockfile and dependencies are
/// installed and up to date.
- Future<PackageGraph> loadPackageGraph() =>
- _ensureLockFileIsUpToDate()
- .then((_) {
- _warnOnAssetsPaths();
- return _loadPackageGraph();
+ Future<PackageGraph> loadPackageGraph() {
+ return _ensureLockFileIsUpToDate().then((_) {
+ var lockFile = loadLockFile();
+ return Future.wait(lockFile.packages.values.map((id) {
+ var source = cache.sources[id.source];
+ return source.getDirectory(id)
+ .then((dir) => new Package.load(id.name, dir, cache.sources));
+ })).then((packages) {
+ var packageMap = new Map.fromIterable(packages, key: (p) => p.name);
+ packageMap[root.name] = root;
+ return new PackageGraph(this, lockFile, packageMap);
});
-
- /// Loads the package graph for the application and all of its transitive
- /// dependencies.
- Future<PackageGraph> _loadPackageGraph() {
- var lockFile = loadLockFile();
- return Future.wait(lockFile.packages.values.map((id) {
- var source = cache.sources[id.source];
- return source.getDirectory(id)
- .then((dir) => new Package.load(id.name, dir, cache.sources));
- })).then((packages) {
- var packageMap = new Map.fromIterable(packages, key: (p) => p.name);
- packageMap[root.name] = root;
- return new PackageGraph(this, lockFile, packageMap);
});
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/build/warns_on_assets_paths_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698