| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 * operational. | 290 * operational. |
| 291 */ | 291 */ |
| 292 static const String SDK_OPTION = "sdk"; | 292 static const String SDK_OPTION = "sdk"; |
| 293 | 293 |
| 294 /** | 294 /** |
| 295 * The instrumentation server that is to be used by the analysis server. | 295 * The instrumentation server that is to be used by the analysis server. |
| 296 */ | 296 */ |
| 297 InstrumentationServer instrumentationServer; | 297 InstrumentationServer instrumentationServer; |
| 298 | 298 |
| 299 /** | 299 /** |
| 300 * The file resolver provider used to override the way file URI's are |
| 301 * resolved in some contexts. |
| 302 */ |
| 303 ResolverProvider fileResolverProvider; |
| 304 |
| 305 /** |
| 300 * The package resolver provider used to override the way package URI's are | 306 * The package resolver provider used to override the way package URI's are |
| 301 * resolved in some contexts. | 307 * resolved in some contexts. |
| 302 */ | 308 */ |
| 303 ResolverProvider packageResolverProvider; | 309 ResolverProvider packageResolverProvider; |
| 304 | 310 |
| 305 /** | 311 /** |
| 306 * If this flag is `true`, then single analysis context should be used for | 312 * If this flag is `true`, then single analysis context should be used for |
| 307 * analysis of multiple analysis roots, special files that could otherwise | 313 * analysis of multiple analysis roots, special files that could otherwise |
| 308 * cause creating additional contexts, such as `pubspec.yaml`, or `.packages`, | 314 * cause creating additional contexts, such as `pubspec.yaml`, or `.packages`, |
| 309 * or analysis options are ignored. | 315 * or analysis options are ignored. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 AnalysisEngine.instance.instrumentationService = service; | 438 AnalysisEngine.instance.instrumentationService = service; |
| 433 // | 439 // |
| 434 // Create the sockets and start listening for requests. | 440 // Create the sockets and start listening for requests. |
| 435 // | 441 // |
| 436 socketServer = new SocketServer( | 442 socketServer = new SocketServer( |
| 437 analysisServerOptions, | 443 analysisServerOptions, |
| 438 defaultSdkCreator, | 444 defaultSdkCreator, |
| 439 defaultSdk, | 445 defaultSdk, |
| 440 service, | 446 service, |
| 441 serverPlugin, | 447 serverPlugin, |
| 448 fileResolverProvider, |
| 442 packageResolverProvider, | 449 packageResolverProvider, |
| 443 useSingleContextManager); | 450 useSingleContextManager); |
| 444 httpServer = new HttpAnalysisServer(socketServer); | 451 httpServer = new HttpAnalysisServer(socketServer); |
| 445 stdioServer = new StdioAnalysisServer(socketServer); | 452 stdioServer = new StdioAnalysisServer(socketServer); |
| 446 socketServer.userDefinedPlugins = _userDefinedPlugins; | 453 socketServer.userDefinedPlugins = _userDefinedPlugins; |
| 447 | 454 |
| 448 if (serve_http) { | 455 if (serve_http) { |
| 449 httpServer.serveHttp(port); | 456 httpServer.serveHttp(port); |
| 450 } | 457 } |
| 451 | 458 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 */ | 612 */ |
| 606 static void _rollLogFiles(String path, int numOld) { | 613 static void _rollLogFiles(String path, int numOld) { |
| 607 for (int i = numOld - 1; i >= 0; i--) { | 614 for (int i = numOld - 1; i >= 0; i--) { |
| 608 try { | 615 try { |
| 609 String oldPath = i == 0 ? path : '$path.$i'; | 616 String oldPath = i == 0 ? path : '$path.$i'; |
| 610 new File(oldPath).renameSync('$path.${i+1}'); | 617 new File(oldPath).renameSync('$path.${i+1}'); |
| 611 } catch (e) {} | 618 } catch (e) {} |
| 612 } | 619 } |
| 613 } | 620 } |
| 614 } | 621 } |
| OLD | NEW |