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

Unified Diff: pkg/analysis_server/bin/dartdeps.dart

Issue 196423005: add dart-sdk option to dartdeps (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/bin/dartdeps.dart
diff --git a/pkg/analysis_server/bin/dartdeps.dart b/pkg/analysis_server/bin/dartdeps.dart
index 15ea8c182166b86891f5b1f2102a5f4eec33e7bc..9282844c65f2a4e2796e106b0e2e2f027b89e3d9 100644
--- a/pkg/analysis_server/bin/dartdeps.dart
+++ b/pkg/analysis_server/bin/dartdeps.dart
@@ -33,6 +33,11 @@ class _DartDependencyAnalyzer {
static const BINARY_NAME = 'dartdeps';
/**
+ * The name of the option used to specify the Dart SDK.
+ */
+ static const String DART_SDK_OPTION = 'dart-sdk';
+
+ /**
* The name of the option used to print usage information.
*/
static const String HELP_OPTION = 'help';
@@ -48,6 +53,11 @@ class _DartDependencyAnalyzer {
final List<String> args;
/**
+ * The path to the Dart SDK used during analysis.
+ */
+ String sdkPath;
+
+ /**
* The manager for the analysis server.
*/
AnalysisManager manager;
@@ -69,6 +79,9 @@ class _DartDependencyAnalyzer {
*/
Future<AnalysisManager> start() {
var parser = new ArgParser();
+ parser.addOption(
+ DART_SDK_OPTION,
+ help: '[sdkPath] path to Dart SDK');
parser.addFlag(HELP_OPTION,
help: 'print this help message without starting analysis',
defaultsTo: false,
@@ -92,6 +105,18 @@ class _DartDependencyAnalyzer {
printUsage(parser);
return null;
}
+ sdkPath = results[DART_SDK_OPTION];
+ if (sdkPath is! String) {
+ print('Missing path to Dart SDK');
+ printUsage(parser);
+ return null;
+ }
+ Directory sdkDir = new Directory(sdkPath);
+ if (!sdkDir.existsSync()) {
+ print('Specified Dart SDK does not exist: $sdkPath');
+ printUsage(parser);
+ return null;
+ }
if (results.rest.length == 0) {
printUsage(parser);
exitCode = 1;
« 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