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 |
11 import 'package:analysis_server/src/analysis_server.dart'; | 11 import 'package:analysis_server/src/analysis_server.dart'; |
12 import 'package:analysis_server/src/plugin/linter_plugin.dart'; | 12 import 'package:analysis_server/src/plugin/linter_plugin.dart'; |
13 import 'package:analysis_server/src/plugin/server_plugin.dart'; | 13 import 'package:analysis_server/src/plugin/server_plugin.dart'; |
14 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; | 14 import 'package:analysis_server/src/provisional/completion/dart/completion_plugi
n.dart'; |
15 import 'package:analysis_server/src/server/http_server.dart'; | 15 import 'package:analysis_server/src/server/http_server.dart'; |
16 import 'package:analysis_server/src/server/stdio_server.dart'; | 16 import 'package:analysis_server/src/server/stdio_server.dart'; |
17 import 'package:analysis_server/src/socket_server.dart'; | 17 import 'package:analysis_server/src/socket_server.dart'; |
18 import 'package:analysis_server/starter.dart'; | 18 import 'package:analysis_server/starter.dart'; |
19 import 'package:analyzer/file_system/physical_file_system.dart'; | 19 import 'package:analyzer/file_system/physical_file_system.dart'; |
20 import 'package:analyzer/instrumentation/file_instrumentation.dart'; | 20 import 'package:analyzer/instrumentation/file_instrumentation.dart'; |
21 import 'package:analyzer/instrumentation/instrumentation.dart'; | 21 import 'package:analyzer/instrumentation/instrumentation.dart'; |
22 import 'package:analyzer/plugin/resolver_provider.dart'; | 22 import 'package:analyzer/plugin/resolver_provider.dart'; |
23 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 23 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
24 import 'package:analyzer/src/generated/engine.dart'; | 24 import 'package:analyzer/src/generated/engine.dart'; |
25 import 'package:analyzer/src/generated/incremental_logger.dart'; | 25 import 'package:analyzer/src/generated/incremental_logger.dart'; |
26 import 'package:analyzer/src/generated/sdk.dart'; | 26 import 'package:analyzer/src/generated/sdk.dart'; |
27 import 'package:args/args.dart'; | 27 import 'package:args/args.dart'; |
28 import 'package:linter/src/plugin/linter_plugin.dart'; | |
29 import 'package:linter/src/rules.dart' as linter; | 28 import 'package:linter/src/rules.dart' as linter; |
30 import 'package:plugin/manager.dart'; | 29 import 'package:plugin/manager.dart'; |
31 import 'package:plugin/plugin.dart'; | 30 import 'package:plugin/plugin.dart'; |
32 | 31 |
33 /** | 32 /** |
34 * Initializes incremental logger. | 33 * Initializes incremental logger. |
35 * | 34 * |
36 * Supports following formats of [spec]: | 35 * Supports following formats of [spec]: |
37 * | 36 * |
38 * "console" - log to the console; | 37 * "console" - log to the console; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 411 |
413 // | 412 // |
414 // Process all of the plugins so that extensions are registered. | 413 // Process all of the plugins so that extensions are registered. |
415 // | 414 // |
416 ServerPlugin serverPlugin = new ServerPlugin(); | 415 ServerPlugin serverPlugin = new ServerPlugin(); |
417 List<Plugin> plugins = <Plugin>[]; | 416 List<Plugin> plugins = <Plugin>[]; |
418 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | 417 plugins.addAll(AnalysisEngine.instance.requiredPlugins); |
419 plugins.add(AnalysisEngine.instance.commandLinePlugin); | 418 plugins.add(AnalysisEngine.instance.commandLinePlugin); |
420 plugins.add(AnalysisEngine.instance.optionsPlugin); | 419 plugins.add(AnalysisEngine.instance.optionsPlugin); |
421 plugins.add(serverPlugin); | 420 plugins.add(serverPlugin); |
422 plugins.add(linterPlugin); | |
423 plugins.add(linterServerPlugin); | 421 plugins.add(linterServerPlugin); |
424 plugins.add(dartCompletionPlugin); | 422 plugins.add(dartCompletionPlugin); |
425 plugins.addAll(_userDefinedPlugins); | 423 plugins.addAll(_userDefinedPlugins); |
426 ExtensionManager manager = new ExtensionManager(); | 424 ExtensionManager manager = new ExtensionManager(); |
427 manager.processPlugins(plugins); | 425 manager.processPlugins(plugins); |
428 linter.registerLintRules(); | 426 linter.registerLintRules(); |
429 | 427 |
430 String defaultSdkPath; | 428 String defaultSdkPath; |
431 if (results[SDK_OPTION] != null) { | 429 if (results[SDK_OPTION] != null) { |
432 defaultSdkPath = results[SDK_OPTION]; | 430 defaultSdkPath = results[SDK_OPTION]; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 */ | 658 */ |
661 static void _rollLogFiles(String path, int numOld) { | 659 static void _rollLogFiles(String path, int numOld) { |
662 for (int i = numOld - 1; i >= 0; i--) { | 660 for (int i = numOld - 1; i >= 0; i--) { |
663 try { | 661 try { |
664 String oldPath = i == 0 ? path : '$path.$i'; | 662 String oldPath = i == 0 ? path : '$path.$i'; |
665 new File(oldPath).renameSync('$path.${i+1}'); | 663 new File(oldPath).renameSync('$path.${i+1}'); |
666 } catch (e) {} | 664 } catch (e) {} |
667 } | 665 } |
668 } | 666 } |
669 } | 667 } |
OLD | NEW |