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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 CommandLineParser parser = _createArgParser(); | 336 CommandLineParser parser = _createArgParser(); |
337 ArgResults results = parser.parse(arguments, <String, String>{}); | 337 ArgResults results = parser.parse(arguments, <String, String>{}); |
338 if (results[HELP_OPTION]) { | 338 if (results[HELP_OPTION]) { |
339 _printUsage(parser.parser); | 339 _printUsage(parser.parser); |
340 return; | 340 return; |
341 } | 341 } |
342 | 342 |
343 // TODO (danrubel) Remove this workaround | 343 // TODO (danrubel) Remove this workaround |
344 // once the underlying VM and dart:io issue has been fixed. | 344 // once the underlying VM and dart:io issue has been fixed. |
345 if (results[INTERNAL_DELAY_FREQUENCY] != null) { | 345 if (results[INTERNAL_DELAY_FREQUENCY] != null) { |
346 AnalysisServer.performOperationDelayFreqency = | 346 AnalysisServer.performOperationDelayFrequency = |
347 int.parse(results[INTERNAL_DELAY_FREQUENCY], onError: (_) => 0); | 347 int.parse(results[INTERNAL_DELAY_FREQUENCY], onError: (_) => 0); |
348 } | 348 } |
349 | 349 |
350 int port; | 350 int port; |
351 bool serve_http = false; | 351 bool serve_http = false; |
352 if (results[PORT_OPTION] != null) { | 352 if (results[PORT_OPTION] != null) { |
353 serve_http = true; | 353 serve_http = true; |
354 try { | 354 try { |
355 port = int.parse(results[PORT_OPTION]); | 355 port = int.parse(results[PORT_OPTION]); |
356 } on FormatException { | 356 } on FormatException { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 */ | 598 */ |
599 static void _rollLogFiles(String path, int numOld) { | 599 static void _rollLogFiles(String path, int numOld) { |
600 for (int i = numOld - 1; i >= 0; i--) { | 600 for (int i = numOld - 1; i >= 0; i--) { |
601 try { | 601 try { |
602 String oldPath = i == 0 ? path : '$path.$i'; | 602 String oldPath = i == 0 ? path : '$path.$i'; |
603 new File(oldPath).renameSync('$path.${i+1}'); | 603 new File(oldPath).renameSync('$path.${i+1}'); |
604 } catch (e) {} | 604 } catch (e) {} |
605 } | 605 } |
606 } | 606 } |
607 } | 607 } |
OLD | NEW |