| 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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 HttpAnalysisServer httpServer; | 327 HttpAnalysisServer httpServer; |
| 328 | 328 |
| 329 StdioAnalysisServer stdioServer; | 329 StdioAnalysisServer stdioServer; |
| 330 | 330 |
| 331 Driver(); | 331 Driver(); |
| 332 | 332 |
| 333 /** | 333 /** |
| 334 * Set the [plugins] that are defined outside the analysis_server package. | 334 * Set the [plugins] that are defined outside the analysis_server package. |
| 335 */ | 335 */ |
| 336 void set userDefinedPlugins(List<Plugin> plugins) { | 336 void set userDefinedPlugins(List<Plugin> plugins) { |
| 337 _userDefinedPlugins = plugins == null ? <Plugin>[] : plugins; | 337 _userDefinedPlugins = plugins ?? <Plugin>[]; |
| 338 } | 338 } |
| 339 | 339 |
| 340 /** | 340 /** |
| 341 * Use the given command-line [arguments] to start this server. | 341 * Use the given command-line [arguments] to start this server. |
| 342 */ | 342 */ |
| 343 void start(List<String> arguments) { | 343 void start(List<String> arguments) { |
| 344 CommandLineParser parser = _createArgParser(); | 344 CommandLineParser parser = _createArgParser(); |
| 345 ArgResults results = parser.parse(arguments, <String, String>{}); | 345 ArgResults results = parser.parse(arguments, <String, String>{}); |
| 346 if (results[HELP_OPTION]) { | 346 if (results[HELP_OPTION]) { |
| 347 _printUsage(parser.parser); | 347 _printUsage(parser.parser); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 */ | 611 */ |
| 612 static void _rollLogFiles(String path, int numOld) { | 612 static void _rollLogFiles(String path, int numOld) { |
| 613 for (int i = numOld - 1; i >= 0; i--) { | 613 for (int i = numOld - 1; i >= 0; i--) { |
| 614 try { | 614 try { |
| 615 String oldPath = i == 0 ? path : '$path.$i'; | 615 String oldPath = i == 0 ? path : '$path.$i'; |
| 616 new File(oldPath).renameSync('$path.${i+1}'); | 616 new File(oldPath).renameSync('$path.${i+1}'); |
| 617 } catch (e) {} | 617 } catch (e) {} |
| 618 } | 618 } |
| 619 } | 619 } |
| 620 } | 620 } |
| OLD | NEW |