| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Command line tool to run the checker on a Dart program. | 5 /// Command line tool to run the checker on a Dart program. |
| 6 library dev_compiler.src.compiler; | 6 library dev_compiler.src.compiler; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 import 'dart:convert' show JSON; | 10 import 'dart:convert' show JSON; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 return null; | 56 return null; |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 return options; | 59 return options; |
| 60 } | 60 } |
| 61 | 61 |
| 62 /// Compile with the given options and return success or failure. | 62 /// Compile with the given options and return success or failure. |
| 63 bool compile(CompilerOptions options) { | 63 bool compile(CompilerOptions options) { |
| 64 assert(!options.serverMode); | 64 assert(!options.serverMode); |
| 65 | 65 |
| 66 var context = createAnalysisContextWithSources( | 66 var context = createAnalysisContextWithSources(options.sourceOptions); |
| 67 options.strongOptions, options.sourceOptions); | |
| 68 var reporter = createErrorReporter(context, options); | 67 var reporter = createErrorReporter(context, options); |
| 69 bool status = new BatchCompiler(context, options, reporter: reporter).run(); | 68 bool status = new BatchCompiler(context, options, reporter: reporter).run(); |
| 70 | 69 |
| 71 if (options.dumpInfo && reporter is SummaryReporter) { | 70 if (options.dumpInfo && reporter is SummaryReporter) { |
| 72 var result = (reporter as SummaryReporter).result; | 71 var result = (reporter as SummaryReporter).result; |
| 73 print(summaryToString(result)); | 72 print(summaryToString(result)); |
| 74 if (options.dumpInfoFile != null) { | 73 if (options.dumpInfoFile != null) { |
| 75 var file = new File(options.dumpInfoFile); | 74 var file = new File(options.dumpInfoFile); |
| 76 file.writeAsStringSync(JSON.encode(result.toJsonMap())); | 75 file.writeAsStringSync(JSON.encode(result.toJsonMap())); |
| 77 } | 76 } |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 '_rtti.js', | 522 '_rtti.js', |
| 524 '_classes.js', | 523 '_classes.js', |
| 525 '_operations.js', | 524 '_operations.js', |
| 526 'dart_runtime.js', | 525 'dart_runtime.js', |
| 527 ]; | 526 ]; |
| 528 files.addAll(corelibOrder.map((l) => l.replaceAll('.', '/') + '.js')); | 527 files.addAll(corelibOrder.map((l) => l.replaceAll('.', '/') + '.js')); |
| 529 return files; | 528 return files; |
| 530 }(); | 529 }(); |
| 531 | 530 |
| 532 final _log = new Logger('dev_compiler.src.compiler'); | 531 final _log = new Logger('dev_compiler.src.compiler'); |
| OLD | NEW |