| 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'; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 help: 'Additional resources to serve', defaultsTo: '') | 281 help: 'Additional resources to serve', defaultsTo: '') |
| 282 ..addFlag('source-maps', | 282 ..addFlag('source-maps', |
| 283 help: 'Whether to emit source map files', defaultsTo: true) | 283 help: 'Whether to emit source map files', defaultsTo: true) |
| 284 ..addOption('runtime-dir', | 284 ..addOption('runtime-dir', |
| 285 help: 'Where to find dev_compiler\'s runtime files', defaultsTo: null) | 285 help: 'Where to find dev_compiler\'s runtime files', defaultsTo: null) |
| 286 ..addFlag('arrow-fn-bind-this', | 286 ..addFlag('arrow-fn-bind-this', |
| 287 help: 'Work around `this` binding in => functions') | 287 help: 'Work around `this` binding in => functions') |
| 288 | 288 |
| 289 // general options | 289 // general options |
| 290 ..addFlag('help', abbr: 'h', help: 'Display this message') | 290 ..addFlag('help', abbr: 'h', help: 'Display this message') |
| 291 ..addFlag('version', help: 'Display the Dev Compiler verion') | 291 ..addFlag('version', |
| 292 negatable: false, help: 'Display the Dev Compiler verion') |
| 292 ..addFlag('server', help: 'Run as a development server.', defaultsTo: false) | 293 ..addFlag('server', help: 'Run as a development server.', defaultsTo: false) |
| 293 ..addFlag('hashing', | 294 ..addFlag('hashing', |
| 294 help: 'Enable hash-based file caching.', defaultsTo: null) | 295 help: 'Enable hash-based file caching.', defaultsTo: null) |
| 295 ..addFlag('widget', | 296 ..addFlag('widget', |
| 296 help: 'Serve embedded widget with static errors and warnings.', | 297 help: 'Serve embedded widget with static errors and warnings.', |
| 297 defaultsTo: true) | 298 defaultsTo: true) |
| 298 ..addOption('host', | 299 ..addOption('host', |
| 299 help: 'Host name or address to serve files from, e.g. --host=0.0.0.0\n' | 300 help: 'Host name or address to serve files from, e.g. --host=0.0.0.0\n' |
| 300 'to listen on all interfaces (used only when --serve is on)', | 301 'to listen on all interfaces (used only when --serve is on)', |
| 301 defaultsTo: 'localhost') | 302 defaultsTo: 'localhost') |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // The pub-cache directory is two levels up, but we verify that the layout | 368 // The pub-cache directory is two levels up, but we verify that the layout |
| 368 // looks correct. | 369 // looks correct. |
| 369 if (path.basename(dir) != 'dev_compiler') return null; | 370 if (path.basename(dir) != 'dev_compiler') return null; |
| 370 dir = path.dirname(dir); | 371 dir = path.dirname(dir); |
| 371 if (path.basename(dir) != 'global_packages') return null; | 372 if (path.basename(dir) != 'global_packages') return null; |
| 372 dir = path.dirname(dir); | 373 dir = path.dirname(dir); |
| 373 return path.join(dir, cacheDir, 'lib', 'runtime'); | 374 return path.join(dir, cacheDir, 'lib', 'runtime'); |
| 374 } | 375 } |
| 375 return null; | 376 return null; |
| 376 } | 377 } |
| OLD | NEW |