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 library driver; | 5 library driver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:math'; | 9 import 'dart:math'; |
10 | 10 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 static const String INCREMENTAL_RESOLUTION_LOG = "incremental-resolution-log"; | 236 static const String INCREMENTAL_RESOLUTION_LOG = "incremental-resolution-log"; |
237 | 237 |
238 /** | 238 /** |
239 * The name of the option used to enable validation of incremental resolution | 239 * The name of the option used to enable validation of incremental resolution |
240 * results. | 240 * results. |
241 */ | 241 */ |
242 static const String INCREMENTAL_RESOLUTION_VALIDATION = | 242 static const String INCREMENTAL_RESOLUTION_VALIDATION = |
243 "incremental-resolution-validation"; | 243 "incremental-resolution-validation"; |
244 | 244 |
245 /** | 245 /** |
246 * The name of the option used to enable using pub summary manager. | 246 * The name of the option used to enable using the new analysis driver. |
247 */ | 247 */ |
248 static const String ENABLE_NEW_ANALYSIS_DRIVER = 'enable-new-analysis-driver'; | 248 static const String ENABLE_NEW_ANALYSIS_DRIVER = 'enable-new-analysis-driver'; |
249 | 249 |
250 /** | 250 /** |
251 * The name of the option used to enable using pub summary manager. | 251 * The name of the option used to enable using pub summary manager. |
252 */ | 252 */ |
253 static const String ENABLE_PUB_SUMMARY_MANAGER = 'enable-pub-summary-manager'; | 253 static const String ENABLE_PUB_SUMMARY_MANAGER = 'enable-pub-summary-manager'; |
254 | 254 |
255 /** | 255 /** |
256 * The name of the option used to enable fined grained invalidation. | 256 * The name of the option used to enable fined grained invalidation. |
(...skipping 12 matching lines...) Expand all Loading... |
269 */ | 269 */ |
270 static const String INTERNAL_DELAY_FREQUENCY = 'internal-delay-frequency'; | 270 static const String INTERNAL_DELAY_FREQUENCY = 'internal-delay-frequency'; |
271 | 271 |
272 /** | 272 /** |
273 * The name of the option used to specify if [print] should print to the | 273 * The name of the option used to specify if [print] should print to the |
274 * console instead of being intercepted. | 274 * console instead of being intercepted. |
275 */ | 275 */ |
276 static const String INTERNAL_PRINT_TO_CONSOLE = "internal-print-to-console"; | 276 static const String INTERNAL_PRINT_TO_CONSOLE = "internal-print-to-console"; |
277 | 277 |
278 /** | 278 /** |
| 279 * The name of the option used to describe the new analysis driver logger. |
| 280 */ |
| 281 static const String NEW_ANALYSIS_DRIVER_LOG = 'new-analysis-driver-log'; |
| 282 |
| 283 /** |
279 * The name of the flag used to disable error notifications. | 284 * The name of the flag used to disable error notifications. |
280 */ | 285 */ |
281 static const String NO_ERROR_NOTIFICATION = "no-error-notification"; | 286 static const String NO_ERROR_NOTIFICATION = "no-error-notification"; |
282 | 287 |
283 /** | 288 /** |
284 * The name of the flag used to disable the index. | 289 * The name of the flag used to disable the index. |
285 */ | 290 */ |
286 static const String NO_INDEX = "no-index"; | 291 static const String NO_INDEX = "no-index"; |
287 | 292 |
288 /** | 293 /** |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 results[ENABLE_NEW_ANALYSIS_DRIVER]; | 397 results[ENABLE_NEW_ANALYSIS_DRIVER]; |
393 analysisServerOptions.enablePubSummaryManager = | 398 analysisServerOptions.enablePubSummaryManager = |
394 results[ENABLE_PUB_SUMMARY_MANAGER]; | 399 results[ENABLE_PUB_SUMMARY_MANAGER]; |
395 analysisServerOptions.finerGrainedInvalidation = | 400 analysisServerOptions.finerGrainedInvalidation = |
396 results[FINER_GRAINED_INVALIDATION]; | 401 results[FINER_GRAINED_INVALIDATION]; |
397 analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION]; | 402 analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION]; |
398 analysisServerOptions.noIndex = results[NO_INDEX]; | 403 analysisServerOptions.noIndex = results[NO_INDEX]; |
399 analysisServerOptions.useAnalysisHighlight2 = | 404 analysisServerOptions.useAnalysisHighlight2 = |
400 results[USE_ANALISYS_HIGHLIGHT2]; | 405 results[USE_ANALISYS_HIGHLIGHT2]; |
401 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; | 406 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; |
| 407 analysisServerOptions.newAnalysisDriverLog = |
| 408 results[NEW_ANALYSIS_DRIVER_LOG]; |
402 | 409 |
403 _initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]); | 410 _initIncrementalLogger(results[INCREMENTAL_RESOLUTION_LOG]); |
404 | 411 |
405 // | 412 // |
406 // Process all of the plugins so that extensions are registered. | 413 // Process all of the plugins so that extensions are registered. |
407 // | 414 // |
408 ServerPlugin serverPlugin = new ServerPlugin(); | 415 ServerPlugin serverPlugin = new ServerPlugin(); |
409 List<Plugin> plugins = <Plugin>[]; | 416 List<Plugin> plugins = <Plugin>[]; |
410 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | 417 plugins.addAll(AnalysisEngine.instance.requiredPlugins); |
411 plugins.add(AnalysisEngine.instance.commandLinePlugin); | 418 plugins.add(AnalysisEngine.instance.commandLinePlugin); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 help: "enable finer grained invalidation", | 559 help: "enable finer grained invalidation", |
553 defaultsTo: false, | 560 defaultsTo: false, |
554 negatable: false); | 561 negatable: false); |
555 parser.addOption(INSTRUMENTATION_LOG_FILE, | 562 parser.addOption(INSTRUMENTATION_LOG_FILE, |
556 help: | 563 help: |
557 "the path of the file to which instrumentation data will be written"
); | 564 "the path of the file to which instrumentation data will be written"
); |
558 parser.addFlag(INTERNAL_PRINT_TO_CONSOLE, | 565 parser.addFlag(INTERNAL_PRINT_TO_CONSOLE, |
559 help: "enable sending `print` output to the console", | 566 help: "enable sending `print` output to the console", |
560 defaultsTo: false, | 567 defaultsTo: false, |
561 negatable: false); | 568 negatable: false); |
| 569 parser.addOption(NEW_ANALYSIS_DRIVER_LOG, |
| 570 help: "set a destination for the new analysis driver's log"); |
562 parser.addOption(PORT_OPTION, | 571 parser.addOption(PORT_OPTION, |
563 help: "the http diagnostic port on which the server provides" | 572 help: "the http diagnostic port on which the server provides" |
564 " status and performance information"); | 573 " status and performance information"); |
565 parser.addOption(INTERNAL_DELAY_FREQUENCY); | 574 parser.addOption(INTERNAL_DELAY_FREQUENCY); |
566 parser.addOption(SDK_OPTION, help: "[path] the path to the sdk"); | 575 parser.addOption(SDK_OPTION, help: "[path] the path to the sdk"); |
567 parser.addFlag(NO_ERROR_NOTIFICATION, | 576 parser.addFlag(NO_ERROR_NOTIFICATION, |
568 help: "disable sending all analysis error notifications to the server", | 577 help: "disable sending all analysis error notifications to the server", |
569 defaultsTo: false, | 578 defaultsTo: false, |
570 negatable: false); | 579 negatable: false); |
571 parser.addFlag(NO_INDEX, | 580 parser.addFlag(NO_INDEX, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 */ | 658 */ |
650 static void _rollLogFiles(String path, int numOld) { | 659 static void _rollLogFiles(String path, int numOld) { |
651 for (int i = numOld - 1; i >= 0; i--) { | 660 for (int i = numOld - 1; i >= 0; i--) { |
652 try { | 661 try { |
653 String oldPath = i == 0 ? path : '$path.$i'; | 662 String oldPath = i == 0 ? path : '$path.$i'; |
654 new File(oldPath).renameSync('$path.${i+1}'); | 663 new File(oldPath).renameSync('$path.${i+1}'); |
655 } catch (e) {} | 664 } catch (e) {} |
656 } | 665 } |
657 } | 666 } |
658 } | 667 } |
OLD | NEW |