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 /** | 5 /** |
6 * To generate docs for a library, run this script with the path to an | 6 * To generate docs for a library, run this script with the path to an |
7 * entrypoint .dart file, like: | 7 * entrypoint .dart file, like: |
8 * | 8 * |
9 * $ dart dartdoc.dart foo.dart | 9 * $ dart dartdoc.dart foo.dart |
10 * | 10 * |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 * path to the directory containing `dartdoc.dart`. If you're running a script | 224 * path to the directory containing `dartdoc.dart`. If you're running a script |
225 * that imports dartdoc, it will be the path to that script. | 225 * that imports dartdoc, it will be the path to that script. |
226 */ | 226 */ |
227 // TODO(johnniwinther): Convert to final (lazily initialized) variables when | 227 // TODO(johnniwinther): Convert to final (lazily initialized) variables when |
228 // the feature is supported. | 228 // the feature is supported. |
229 Path get scriptDir() => | 229 Path get scriptDir() => |
230 new Path.fromNative(new Options().script).directoryPath; | 230 new Path.fromNative(new Options().script).directoryPath; |
231 | 231 |
232 // TODO(johnniwinther): Trailing slashes matter due to the use of [libPath] as | 232 // TODO(johnniwinther): Trailing slashes matter due to the use of [libPath] as |
233 // a base URI with [Uri.resolve]. | 233 // a base URI with [Uri.resolve]. |
| 234 /// Relative path to the library in which dart2js resides. |
234 Path get libPath() => IN_SDK | 235 Path get libPath() => IN_SDK |
235 ? scriptDir.append('../dart2js/') | 236 ? scriptDir.append('../../lib/dart2js/') |
236 : scriptDir.append('../../'); | 237 : scriptDir.append('../../'); |
237 | 238 |
238 /** | 239 /** |
239 * Deletes and recreates the output directory at [path] if it exists. | 240 * Deletes and recreates the output directory at [path] if it exists. |
240 */ | 241 */ |
241 void cleanOutputDirectory(Path path) { | 242 void cleanOutputDirectory(Path path) { |
242 final outputDir = new Directory.fromPath(path); | 243 final outputDir = new Directory.fromPath(path); |
243 if (outputDir.existsSync()) { | 244 if (outputDir.existsSync()) { |
244 outputDir.deleteRecursivelySync(); | 245 outputDir.deleteRecursivelySync(); |
245 } | 246 } |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 } | 1585 } |
1585 | 1586 |
1586 /** | 1587 /** |
1587 * Returns [:true:] if [type] should be regarded as an exception. | 1588 * Returns [:true:] if [type] should be regarded as an exception. |
1588 */ | 1589 */ |
1589 bool isException(TypeMirror type) { | 1590 bool isException(TypeMirror type) { |
1590 return type.simpleName.endsWith('Exception'); | 1591 return type.simpleName.endsWith('Exception'); |
1591 } | 1592 } |
1592 } | 1593 } |
1593 | 1594 |
OLD | NEW |