OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer_cli.src.build_mode; | 5 library analyzer_cli.src.build_mode; |
6 | 6 |
7 import 'dart:core' hide Resource; | 7 import 'dart:core' hide Resource; |
8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; | 10 import 'package:analyzer/dart/ast/ast.dart' show CompilationUnit; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 * Performs analysis with given [options]. | 55 * Performs analysis with given [options]. |
56 */ | 56 */ |
57 void analyze(CommandLineOptions options) { | 57 void analyze(CommandLineOptions options) { |
58 new BuildMode(options, new AnalysisStats()).analyze(); | 58 new BuildMode(options, new AnalysisStats()).analyze(); |
59 AnalysisEngine.instance.clearCaches(); | 59 AnalysisEngine.instance.clearCaches(); |
60 } | 60 } |
61 | 61 |
62 /** | 62 /** |
63 * Perform a single loop step. | 63 * Perform a single loop step. |
64 */ | 64 */ |
| 65 @override |
65 WorkResponse performRequest(WorkRequest request) { | 66 WorkResponse performRequest(WorkRequest request) { |
66 errorBuffer.clear(); | 67 errorBuffer.clear(); |
67 outBuffer.clear(); | 68 outBuffer.clear(); |
68 try { | 69 try { |
69 // Add in the dart-sdk argument if `dartSdkPath` is not null, otherwise it | 70 // Add in the dart-sdk argument if `dartSdkPath` is not null, otherwise it |
70 // will try to find the currently installed sdk. | 71 // will try to find the currently installed sdk. |
71 var arguments = new List.from(request.arguments); | 72 var arguments = new List.from(request.arguments); |
72 if (dartSdkPath != null && | 73 if (dartSdkPath != null && |
73 !arguments.any((arg) => arg.startsWith('--dart-sdk'))) { | 74 !arguments.any((arg) => arg.startsWith('--dart-sdk'))) { |
74 arguments.add('--dart-sdk=$dartSdkPath'); | 75 arguments.add('--dart-sdk=$dartSdkPath'); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); | 371 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); |
371 return null; | 372 return null; |
372 } | 373 } |
373 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); | 374 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); |
374 String path = sourceFile.substring(pipeIndex + 1); | 375 String path = sourceFile.substring(pipeIndex + 1); |
375 uriToFileMap[uri] = new JavaFile(path); | 376 uriToFileMap[uri] = new JavaFile(path); |
376 } | 377 } |
377 return uriToFileMap; | 378 return uriToFileMap; |
378 } | 379 } |
379 } | 380 } |
OLD | NEW |