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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 if (results[SDK_OPTION] != null) { | 374 if (results[SDK_OPTION] != null) { |
375 defaultSdk = new DirectoryBasedDartSdk(new JavaFile(results[SDK_OPTION])); | 375 defaultSdk = new DirectoryBasedDartSdk(new JavaFile(results[SDK_OPTION])); |
376 } else { | 376 } else { |
377 // No path to the SDK provided; use DirectoryBasedDartSdk.defaultSdk, | 377 // No path to the SDK provided; use DirectoryBasedDartSdk.defaultSdk, |
378 // which will make a guess. | 378 // which will make a guess. |
379 defaultSdk = DirectoryBasedDartSdk.defaultSdk; | 379 defaultSdk = DirectoryBasedDartSdk.defaultSdk; |
380 } | 380 } |
381 // | 381 // |
382 // Initialize the instrumentation service. | 382 // Initialize the instrumentation service. |
383 // | 383 // |
384 if (instrumentationServer != null) { | 384 String logFilePath = results[INSTRUMENTATION_LOG_FILE]; |
385 String filePath = results[INSTRUMENTATION_LOG_FILE]; | 385 if (logFilePath != null) { |
386 if (filePath != null) { | 386 FileInstrumentationServer fileBasedServer = |
387 instrumentationServer = new MulticastInstrumentationServer( | 387 new FileInstrumentationServer(logFilePath); |
388 [instrumentationServer, new FileInstrumentationServer(filePath)]); | 388 instrumentationServer = instrumentationServer != null |
389 } | 389 ? new MulticastInstrumentationServer( |
| 390 [instrumentationServer, fileBasedServer]) |
| 391 : fileBasedServer; |
390 } | 392 } |
391 InstrumentationService service = | 393 InstrumentationService service = |
392 new InstrumentationService(instrumentationServer); | 394 new InstrumentationService(instrumentationServer); |
393 service.logVersion(_readUuid(service), results[CLIENT_ID], | 395 service.logVersion(_readUuid(service), results[CLIENT_ID], |
394 results[CLIENT_VERSION], AnalysisServer.VERSION, defaultSdk.sdkVersion); | 396 results[CLIENT_VERSION], AnalysisServer.VERSION, defaultSdk.sdkVersion); |
395 AnalysisEngine.instance.instrumentationService = service; | 397 AnalysisEngine.instance.instrumentationService = service; |
396 // | 398 // |
397 // Enable the new task model, if appropriate. | 399 // Enable the new task model, if appropriate. |
398 // | 400 // |
399 AnalysisEngine.instance.useTaskModel = !results[DISABLE_NEW_TASK_MODEL]; | 401 AnalysisEngine.instance.useTaskModel = !results[DISABLE_NEW_TASK_MODEL]; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 uuidFile.parent.createSync(recursive: true); | 570 uuidFile.parent.createSync(recursive: true); |
569 uuidFile.writeAsStringSync(uuid); | 571 uuidFile.writeAsStringSync(uuid); |
570 } catch (exception, stackTrace) { | 572 } catch (exception, stackTrace) { |
571 service.logPriorityException(exception, stackTrace); | 573 service.logPriorityException(exception, stackTrace); |
572 // Slightly alter the uuid to indicate it was not persisted | 574 // Slightly alter the uuid to indicate it was not persisted |
573 uuid = 'temp-$uuid'; | 575 uuid = 'temp-$uuid'; |
574 } | 576 } |
575 return uuid; | 577 return uuid; |
576 } | 578 } |
577 } | 579 } |
OLD | NEW |