Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1474)

Side by Side Diff: pkg/analyzer_cli/lib/src/options.dart

Issue 1974993002: Dont search for the sdk on startup in worker mode (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.options; 5 library analyzer_cli.src.options;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer_cli/src/driver.dart'; 9 import 'package:analyzer_cli/src/driver.dart';
10 import 'package:args/args.dart'; 10 import 'package:args/args.dart';
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 strongMode = args['strong'], 186 strongMode = args['strong'],
187 lintsAreFatal = args['fatal-lints']; 187 lintsAreFatal = args['fatal-lints'];
188 188
189 /// Parse [args] into [CommandLineOptions] describing the specified 189 /// Parse [args] into [CommandLineOptions] describing the specified
190 /// analyzer options. In case of a format error, calls [printAndFail], which 190 /// analyzer options. In case of a format error, calls [printAndFail], which
191 /// by default prints an error message to stderr and exits. 191 /// by default prints an error message to stderr and exits.
192 static CommandLineOptions parse(List<String> args, 192 static CommandLineOptions parse(List<String> args,
193 [printAndFail(String msg) = printAndFail]) { 193 [printAndFail(String msg) = printAndFail]) {
194 CommandLineOptions options = _parse(args); 194 CommandLineOptions options = _parse(args);
195 // Check SDK. 195 // Check SDK.
196 { 196 if (!options.buildModePersistentWorker) {
197 // Infer if unspecified. 197 // Infer if unspecified.
198 if (options.dartSdkPath == null) { 198 if (options.dartSdkPath == null) {
199 Directory sdkDir = getSdkDir(args); 199 Directory sdkDir = getSdkDir(args);
200 if (sdkDir != null) { 200 if (sdkDir != null) {
201 options.dartSdkPath = sdkDir.path; 201 options.dartSdkPath = sdkDir.path;
202 } 202 }
203 } 203 }
204 204
205 var sdkPath = options.dartSdkPath; 205 var sdkPath = options.dartSdkPath;
206 206
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 int _getNextFlagIndex(args, i) { 668 int _getNextFlagIndex(args, i) {
669 for (; i < args.length; ++i) { 669 for (; i < args.length; ++i) {
670 if (args[i].startsWith('--')) { 670 if (args[i].startsWith('--')) {
671 return i; 671 return i;
672 } 672 }
673 } 673 }
674 return i; 674 return i;
675 } 675 }
676 } 676 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698