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

Unified Diff: options.dart

Issue 8437081: Frog changes (in experimental) to get frog integrated into the test infrastructure. (Closed) Base URL: http://dart.googlecode.com/svn/experimental/frog/
Patch Set: '' Created 9 years, 1 month 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 | « frogsh ('k') | presubmit.py » ('j') | scripts/buildbot_annotated_steps.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.dart
===================================================================
--- options.dart (revision 1140)
+++ options.dart (working copy)
@@ -6,9 +6,9 @@
Options options;
/** Extracts options from command-line arguments. */
-void parseOptions(String homedir, List<String> args) {
+void parseOptions(String homedir, List<String> args, FileSystem files) {
assert(options == null);
- options = new Options(homedir, args);
+ options = new Options(homedir, args, files);
}
// TODO(sigmund): make into a generic option parser...
@@ -44,9 +44,11 @@
*/
List<String> childArgs;
- Options(String homedir, List<String> args) {
+ Options(String homedir, List<String> args, FileSystem files) {
libDir = homedir + '/lib'; // Default value for --libdir.
bool ignoreUnrecognizedFlags = false;
+ bool passedLibDir = false;
+ childArgs = [];
// Start from 2 to skip arguments representing the compiler command
// (node/python followed by frogsh/frog.py).
@@ -106,11 +108,12 @@
if (arg.endsWith('.dart')) {
dartScript = arg;
childArgs = args.getRange(i + 1, args.length - i - 1);
- return;
+ break loop;
} else if (arg.startsWith('--out=')) {
outfile = arg.substring('--out='.length);
} else if (arg.startsWith('--libdir=')) {
libDir = arg.substring('--libdir='.length);
+ passedLibDir = true;
} else {
if (!ignoreUnrecognizedFlags) {
print('unrecognized flag: "$arg"');
@@ -118,6 +121,15 @@
}
}
}
- childArgs = [];
+
+ if (!passedLibDir && !files.fileExists(libDir)) {
+ // Try locally
+ var temp = 'frog/lib';
+ if (files.fileExists(temp)) {
+ libDir = temp;
+ } else {
+ libDir = 'lib';
+ }
+ }
}
}
« no previous file with comments | « frogsh ('k') | presubmit.py » ('j') | scripts/buildbot_annotated_steps.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698