| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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("builtin"); | 5 #library("builtin"); |
| 6 #import("dart:uri"); | 6 #import("dart:uri"); |
| 7 | 7 |
| 8 // Corelib 'print' implementation. | 8 // Corelib 'print' implementation. |
| 9 void _print(arg) { | 9 void _print(arg) { |
| 10 _Logger._printString(arg.toString()); | 10 _Logger._printString(arg.toString()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // The directory to look in to resolve "package:" scheme URIs. | 23 // The directory to look in to resolve "package:" scheme URIs. |
| 24 var _packageRoot; | 24 var _packageRoot; |
| 25 | 25 |
| 26 void _logResolution(String msg) { | 26 void _logResolution(String msg) { |
| 27 final enabled = false; | 27 final enabled = false; |
| 28 if (enabled) { | 28 if (enabled) { |
| 29 _Logger._printString(msg); | 29 _Logger._printString(msg); |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 String _setPackageRoot(String packageRoot) { | 33 _setPackageRoot(String packageRoot) { |
| 34 // TODO(mattsh) - refactor windows drive and path handling code | 34 // TODO(mattsh) - refactor windows drive and path handling code |
| 35 // so it can be used here if needed. | 35 // so it can be used here if needed. |
| 36 _packageRoot = packageRoot; | 36 _packageRoot = packageRoot; |
| 37 } | 37 } |
| 38 | 38 |
| 39 String _resolveScriptUri(String cwd, String scriptName, bool isWindows) { | 39 String _resolveScriptUri(String cwd, String scriptName, bool isWindows) { |
| 40 _logResolution("# Current working directory: $cwd"); | 40 _logResolution("# Current working directory: $cwd"); |
| 41 _logResolution("# ScriptName: $scriptName"); | 41 _logResolution("# ScriptName: $scriptName"); |
| 42 if (isWindows) { | 42 if (isWindows) { |
| 43 // For Windows we need to massage the paths a bit according to | 43 // For Windows we need to massage the paths a bit according to |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 var path; | 149 var path; |
| 150 if (_packageRoot !== null) { | 150 if (_packageRoot !== null) { |
| 151 path = "${_packageRoot}${uri.path}"; | 151 path = "${_packageRoot}${uri.path}"; |
| 152 } else { | 152 } else { |
| 153 path = _entrypoint.resolve('packages/${uri.path}').path; | 153 path = _entrypoint.resolve('packages/${uri.path}').path; |
| 154 } | 154 } |
| 155 | 155 |
| 156 _logResolution("# Package: $path"); | 156 _logResolution("# Package: $path"); |
| 157 return path; | 157 return path; |
| 158 } | 158 } |
| OLD | NEW |