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 part of pipeline; | 5 part of pipeline; |
6 | 6 |
7 List log; | 7 List log; |
8 var replyPort; | 8 var replyPort; |
9 int _procId = 1; | 9 int _procId = 1; |
10 Map _procs = {}; | 10 Map _procs = {}; |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 /** | 23 /** |
24 * Given a file path [file], make it absolute if it is relative, | 24 * Given a file path [file], make it absolute if it is relative, |
25 * and return the result as a [Path]. | 25 * and return the result as a [Path]. |
26 */ | 26 */ |
27 Path getAbsolutePath(String file) { | 27 Path getAbsolutePath(String file) { |
28 var p = new Path(file).canonicalize(); | 28 var p = new Path(file).canonicalize(); |
29 if (p.isAbsolute) { | 29 if (p.isAbsolute) { |
30 return p; | 30 return p; |
31 } else { | 31 } else { |
32 var cwd = new Path((new Directory.current()).path); | 32 var cwd = new Path(Directory.current.path); |
33 return cwd.join(p); | 33 return cwd.join(p); |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 /** Get the directory that contains a [file]. */ | 37 /** Get the directory that contains a [file]. */ |
38 String getDirectory(String file) => | 38 String getDirectory(String file) => |
39 getAbsolutePath(file).directoryPath.toString(); | 39 getAbsolutePath(file).directoryPath.toString(); |
40 | 40 |
41 /** Create a file [fileName] and populate it with [contents]. */ | 41 /** Create a file [fileName] and populate it with [contents]. */ |
42 void writeFile(String fileName, String contents) { | 42 void writeFile(String fileName, String contents) { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 203 |
204 void completePipeline(List stdout, List stderr, [exitCode = 0]) { | 204 void completePipeline(List stdout, List stderr, [exitCode = 0]) { |
205 replyPort.send([stdout, stderr, log, exitCode]); | 205 replyPort.send([stdout, stderr, log, exitCode]); |
206 } | 206 } |
207 | 207 |
208 /** Utility function to log diagnostic messages. */ | 208 /** Utility function to log diagnostic messages. */ |
209 void logMessage(msg) => log.add(msg); | 209 void logMessage(msg) => log.add(msg); |
210 | 210 |
211 /** Turn file paths into standard form with forward slashes. */ | 211 /** Turn file paths into standard form with forward slashes. */ |
212 String normalizePath(String p) => (new Path(p)).toString(); | 212 String normalizePath(String p) => (new Path(p)).toString(); |
OLD | NEW |