| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 manager.processPlugins(plugins); | 392 manager.processPlugins(plugins); |
| 393 | 393 |
| 394 JavaFile defaultSdkDirectory; | 394 JavaFile defaultSdkDirectory; |
| 395 if (results[SDK_OPTION] != null) { | 395 if (results[SDK_OPTION] != null) { |
| 396 defaultSdkDirectory = new JavaFile(results[SDK_OPTION]); | 396 defaultSdkDirectory = new JavaFile(results[SDK_OPTION]); |
| 397 } else { | 397 } else { |
| 398 // No path to the SDK was provided. | 398 // No path to the SDK was provided. |
| 399 // Use DirectoryBasedDartSdk.defaultSdkDirectory, which will make a guess. | 399 // Use DirectoryBasedDartSdk.defaultSdkDirectory, which will make a guess. |
| 400 defaultSdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory; | 400 defaultSdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory; |
| 401 } | 401 } |
| 402 SdkCreator defaultSdkCreator = () { | 402 SdkCreator defaultSdkCreator = |
| 403 DirectoryBasedDartSdk sdk = | 403 () => new DirectoryBasedDartSdk(defaultSdkDirectory); |
| 404 new DirectoryBasedDartSdk(defaultSdkDirectory); | |
| 405 sdk.useSummary = true; | |
| 406 return sdk; | |
| 407 }; | |
| 408 // TODO(brianwilkerson) It would be nice to avoid creating an SDK that | 404 // TODO(brianwilkerson) It would be nice to avoid creating an SDK that |
| 409 // cannot be re-used, but the SDK is needed to create a package map provider | 405 // cannot be re-used, but the SDK is needed to create a package map provider |
| 410 // in the case where we need to run `pub` in order to get the package map. | 406 // in the case where we need to run `pub` in order to get the package map. |
| 411 DirectoryBasedDartSdk defaultSdk = defaultSdkCreator(); | 407 DirectoryBasedDartSdk defaultSdk = defaultSdkCreator(); |
| 412 // | 408 // |
| 413 // Initialize the instrumentation service. | 409 // Initialize the instrumentation service. |
| 414 // | 410 // |
| 415 String logFilePath = results[INSTRUMENTATION_LOG_FILE]; | 411 String logFilePath = results[INSTRUMENTATION_LOG_FILE]; |
| 416 if (logFilePath != null) { | 412 if (logFilePath != null) { |
| 417 _rollLogFiles(logFilePath, 5); | 413 _rollLogFiles(logFilePath, 5); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 */ | 598 */ |
| 603 static void _rollLogFiles(String path, int numOld) { | 599 static void _rollLogFiles(String path, int numOld) { |
| 604 for (int i = numOld - 1; i >= 0; i--) { | 600 for (int i = numOld - 1; i >= 0; i--) { |
| 605 try { | 601 try { |
| 606 String oldPath = i == 0 ? path : '$path.$i'; | 602 String oldPath = i == 0 ? path : '$path.$i'; |
| 607 new File(oldPath).renameSync('$path.${i+1}'); | 603 new File(oldPath).renameSync('$path.${i+1}'); |
| 608 } catch (e) {} | 604 } catch (e) {} |
| 609 } | 605 } |
| 610 } | 606 } |
| 611 } | 607 } |
| OLD | NEW |