OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 /// Set of flags and options passed to the compiler | 5 /// Set of flags and options passed to the compiler |
6 library dev_compiler.src.options; | 6 library dev_compiler.src.options; |
7 | 7 |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
11 import 'package:cli_util/cli_util.dart' show getSdkDir; | 11 import 'package:cli_util/cli_util.dart' show getSdkDir; |
12 import 'package:logging/logging.dart' show Level; | 12 import 'package:logging/logging.dart' show Level; |
13 import 'package:path/path.dart' as path; | 13 import 'package:path/path.dart' as path; |
14 import 'package:yaml/yaml.dart'; | 14 import 'package:yaml/yaml.dart'; |
15 | 15 |
16 const String _V8_BINARY_DEFAULT = 'node'; | 16 const String _V8_BINARY_DEFAULT = 'node'; |
17 const bool _CLOSURE_DEFAULT = false; | 17 const bool _CLOSURE_DEFAULT = false; |
18 const bool _DESTRUCTURE_NAMED_PARAMS_DEFAULT = true; | 18 const bool _DESTRUCTURE_NAMED_PARAMS_DEFAULT = false; |
19 | 19 |
20 /// Options used to set up Source URI resolution in the analysis context. | 20 /// Options used to set up Source URI resolution in the analysis context. |
21 class SourceResolverOptions { | 21 class SourceResolverOptions { |
22 /// Whether to resolve 'package:' uris using the multi-package resolver. | 22 /// Whether to resolve 'package:' uris using the multi-package resolver. |
23 final bool useMultiPackage; | 23 final bool useMultiPackage; |
24 | 24 |
25 /// Custom URI mappings, such as "dart:foo" -> "path/to/foo.dart" | 25 /// Custom URI mappings, such as "dart:foo" -> "path/to/foo.dart" |
26 final Map<String, String> customUrlMappings; | 26 final Map<String, String> customUrlMappings; |
27 | 27 |
28 /// Package root when resolving 'package:' urls the standard way. | 28 /// Package root when resolving 'package:' urls the standard way. |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 // The pub-cache directory is two levels up, but we verify that the layout | 403 // The pub-cache directory is two levels up, but we verify that the layout |
404 // looks correct. | 404 // looks correct. |
405 if (path.basename(dir) != 'dev_compiler') return null; | 405 if (path.basename(dir) != 'dev_compiler') return null; |
406 dir = path.dirname(dir); | 406 dir = path.dirname(dir); |
407 if (path.basename(dir) != 'global_packages') return null; | 407 if (path.basename(dir) != 'global_packages') return null; |
408 dir = path.dirname(dir); | 408 dir = path.dirname(dir); |
409 return path.join(dir, cacheDir, 'lib', 'runtime'); | 409 return path.join(dir, cacheDir, 'lib', 'runtime'); |
410 } | 410 } |
411 return null; | 411 return null; |
412 } | 412 } |
OLD | NEW |