| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 /** | 62 /** |
| 63 * Perform a single loop step. | 63 * Perform a single loop step. |
| 64 */ | 64 */ |
| 65 @override | 65 @override |
| 66 WorkResponse performRequest(WorkRequest request) { | 66 WorkResponse performRequest(WorkRequest request) { |
| 67 errorBuffer.clear(); | 67 errorBuffer.clear(); |
| 68 outBuffer.clear(); | 68 outBuffer.clear(); |
| 69 try { | 69 try { |
| 70 // 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 |
| 71 // will try to find the currently installed sdk. | 71 // will try to find the currently installed sdk. |
| 72 var arguments = new List.from(request.arguments); | 72 var arguments = new List<String>.from(request.arguments); |
| 73 if (dartSdkPath != null && | 73 if (dartSdkPath != null && |
| 74 !arguments.any((arg) => arg.startsWith('--dart-sdk'))) { | 74 !arguments.any((arg) => arg.startsWith('--dart-sdk'))) { |
| 75 arguments.add('--dart-sdk=$dartSdkPath'); | 75 arguments.add('--dart-sdk=$dartSdkPath'); |
| 76 } | 76 } |
| 77 // Prepare options. | 77 // Prepare options. |
| 78 CommandLineOptions options = | 78 CommandLineOptions options = |
| 79 CommandLineOptions.parse(arguments, (String msg) { | 79 CommandLineOptions.parse(arguments, (String msg) { |
| 80 throw new ArgumentError(msg); | 80 throw new ArgumentError(msg); |
| 81 }); | 81 }); |
| 82 // Analyze and respond. | 82 // Analyze and respond. |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); | 382 'Illegal input file (must be "\$uri|\$path"): $sourceFile'); |
| 383 return null; | 383 return null; |
| 384 } | 384 } |
| 385 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); | 385 Uri uri = Uri.parse(sourceFile.substring(0, pipeIndex)); |
| 386 String path = sourceFile.substring(pipeIndex + 1); | 386 String path = sourceFile.substring(pipeIndex + 1); |
| 387 uriToFileMap[uri] = new JavaFile(path); | 387 uriToFileMap[uri] = new JavaFile(path); |
| 388 } | 388 } |
| 389 return uriToFileMap; | 389 return uriToFileMap; |
| 390 } | 390 } |
| 391 } | 391 } |
| OLD | NEW |