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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 return; | 382 return; |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 AnalysisServerOptions analysisServerOptions = new AnalysisServerOptions(); | 386 AnalysisServerOptions analysisServerOptions = new AnalysisServerOptions(); |
387 analysisServerOptions.enableIncrementalResolutionApi = | 387 analysisServerOptions.enableIncrementalResolutionApi = |
388 results[ENABLE_INCREMENTAL_RESOLUTION_API]; | 388 results[ENABLE_INCREMENTAL_RESOLUTION_API]; |
389 analysisServerOptions.enableIncrementalResolutionValidation = | 389 analysisServerOptions.enableIncrementalResolutionValidation = |
390 results[INCREMENTAL_RESOLUTION_VALIDATION]; | 390 results[INCREMENTAL_RESOLUTION_VALIDATION]; |
391 analysisServerOptions.enableNewAnalysisDriver = | 391 analysisServerOptions.enableNewAnalysisDriver = |
392 results[ENABLE_NEW_ANALYSIS_DRIVER]; | 392 results[ENABLE_NEW_ANALYSIS_DRIVER]; |
393 analysisServerOptions.enablePubSummaryManager = | 393 analysisServerOptions.enablePubSummaryManager = |
394 results[ENABLE_PUB_SUMMARY_MANAGER]; | 394 results[ENABLE_PUB_SUMMARY_MANAGER]; |
395 analysisServerOptions.finerGrainedInvalidation = | 395 analysisServerOptions.finerGrainedInvalidation = |
396 true /*results[FINER_GRAINED_INVALIDATION]*/; | 396 true /*results[FINER_GRAINED_INVALIDATION]*/; |
397 analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION]; | 397 analysisServerOptions.noErrorNotification = results[NO_ERROR_NOTIFICATION]; |
398 analysisServerOptions.noIndex = results[NO_INDEX]; | 398 analysisServerOptions.noIndex = results[NO_INDEX]; |
399 analysisServerOptions.useAnalysisHighlight2 = | 399 analysisServerOptions.useAnalysisHighlight2 = |
400 results[USE_ANALISYS_HIGHLIGHT2]; | 400 results[USE_ANALISYS_HIGHLIGHT2]; |
401 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; | 401 analysisServerOptions.fileReadMode = results[FILE_READ_MODE]; |
402 | 402 |
(...skipping 18 matching lines...) Expand all Loading... |
421 String defaultSdkPath; | 421 String defaultSdkPath; |
422 if (results[SDK_OPTION] != null) { | 422 if (results[SDK_OPTION] != null) { |
423 defaultSdkPath = results[SDK_OPTION]; | 423 defaultSdkPath = results[SDK_OPTION]; |
424 } else { | 424 } else { |
425 // No path to the SDK was provided. | 425 // No path to the SDK was provided. |
426 // Use DirectoryBasedDartSdk.defaultSdkDirectory, which will make a guess. | 426 // Use DirectoryBasedDartSdk.defaultSdkDirectory, which will make a guess. |
427 defaultSdkPath = FolderBasedDartSdk | 427 defaultSdkPath = FolderBasedDartSdk |
428 .defaultSdkDirectory(PhysicalResourceProvider.INSTANCE) | 428 .defaultSdkDirectory(PhysicalResourceProvider.INSTANCE) |
429 .path; | 429 .path; |
430 } | 430 } |
431 bool useSummaries = analysisServerOptions.fileReadMode == 'as-is'; | 431 bool useSummaries = analysisServerOptions.fileReadMode == 'as-is' || |
| 432 analysisServerOptions.enableNewAnalysisDriver; |
432 // TODO(brianwilkerson) It would be nice to avoid creating an SDK that | 433 // TODO(brianwilkerson) It would be nice to avoid creating an SDK that |
433 // cannot be re-used, but the SDK is needed to create a package map provider | 434 // cannot be re-used, but the SDK is needed to create a package map provider |
434 // in the case where we need to run `pub` in order to get the package map. | 435 // in the case where we need to run `pub` in order to get the package map. |
435 DartSdk defaultSdk = _createDefaultSdk(defaultSdkPath, useSummaries); | 436 DartSdk defaultSdk = _createDefaultSdk(defaultSdkPath, useSummaries); |
436 // | 437 // |
437 // Initialize the instrumentation service. | 438 // Initialize the instrumentation service. |
438 // | 439 // |
439 String logFilePath = results[INSTRUMENTATION_LOG_FILE]; | 440 String logFilePath = results[INSTRUMENTATION_LOG_FILE]; |
440 if (logFilePath != null) { | 441 if (logFilePath != null) { |
441 _rollLogFiles(logFilePath, 5); | 442 _rollLogFiles(logFilePath, 5); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 */ | 649 */ |
649 static void _rollLogFiles(String path, int numOld) { | 650 static void _rollLogFiles(String path, int numOld) { |
650 for (int i = numOld - 1; i >= 0; i--) { | 651 for (int i = numOld - 1; i >= 0; i--) { |
651 try { | 652 try { |
652 String oldPath = i == 0 ? path : '$path.$i'; | 653 String oldPath = i == 0 ? path : '$path.$i'; |
653 new File(oldPath).renameSync('$path.${i+1}'); | 654 new File(oldPath).renameSync('$path.${i+1}'); |
654 } catch (e) {} | 655 } catch (e) {} |
655 } | 656 } |
656 } | 657 } |
657 } | 658 } |
OLD | NEW |