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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/command/build.dart

Issue 203673003: Allow [path.fromUri] to take a string as well as a URI. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/pub_package_provider.dart ('k') | no next file » | 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 library pub.command.build; 5 library pub.command.build;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:path/path.dart' as path; 10 import 'package:path/path.dart' as path;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // Must depend on the browser package. 287 // Must depend on the browser package.
288 if (!entrypoint.root.immediateDependencies.any( 288 if (!entrypoint.root.immediateDependencies.any(
289 (dep) => dep.name == 'browser' && dep.source == 'hosted')) { 289 (dep) => dep.name == 'browser' && dep.source == 'hosted')) {
290 return 0; 290 return 0;
291 } 291 }
292 292
293 // Get all of the subdirectories that contain Dart entrypoints. 293 // Get all of the subdirectories that contain Dart entrypoints.
294 var entrypointDirs = entrypoints 294 var entrypointDirs = entrypoints
295 // Convert the asset path to a native-separated one and get the 295 // Convert the asset path to a native-separated one and get the
296 // directory containing the entrypoint. 296 // directory containing the entrypoint.
297 .map((id) => path.dirname(path.joinAll(path.url.split(id.path)))) 297 .map((id) => path.dirname(path.fromUri(id.path)))
298 // Don't copy files to the top levels of the build directories since 298 // Don't copy files to the top levels of the build directories since
299 // the normal lib asset copying will take care of that. 299 // the normal lib asset copying will take care of that.
300 .where((dir) => dir.contains(path.separator)) 300 .where((dir) => dir.contains(path.separator))
301 .toSet(); 301 .toSet();
302 302
303 for (var dir in entrypointDirs) { 303 for (var dir in entrypointDirs) {
304 // TODO(nweiz): we should put browser JS files next to any HTML file 304 // TODO(nweiz): we should put browser JS files next to any HTML file
305 // rather than any entrypoint. An HTML file could import an entrypoint 305 // rather than any entrypoint. An HTML file could import an entrypoint
306 // that's not adjacent. 306 // that's not adjacent.
307 _addBrowserJs(dir, "dart"); 307 _addBrowserJs(dir, "dart");
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 "end": { 353 "end": {
354 "line": entry.span.end.line, 354 "line": entry.span.end.line,
355 "column": entry.span.end.column 355 "column": entry.span.end.column
356 }, 356 },
357 }; 357 };
358 } 358 }
359 359
360 return data; 360 return data;
361 } 361 }
362 } 362 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/pub_package_provider.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698