From 423bde93d2b417d75273e4cee5ef862aeecd6e7b Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Thu, 9 Apr 2015 14:40:21 -0500 Subject: [PATCH 1/2] Fix #161 --- changelog.md | 3 + lib/grinder_tools.dart | 205 ++++++++++++++--------------------------- lib/src/run.dart | 143 ++++++++++++++++++++++++++++ lib/src/run_utils.dart | 18 ++++ tool/grind.dart | 2 +- 5 files changed, 232 insertions(+), 139 deletions(-) create mode 100644 lib/src/run.dart create mode 100644 lib/src/run_utils.dart diff --git a/changelog.md b/changelog.md index 55195d53..3174d7ec 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,9 @@ variables. They're injected into the zone running the current task. - `copyFile` and `copyDirectory` and deprecated in favor of a new `copy` method - `deleteEntity` is deprecated in favor of a new `delete` method +- Renamed `runProcess`/`runProcessAsync`/`runDartScript` to `run`/`runAsync`/`Dart.run`. + Process result info (stdout, stderr, exitCode) is now exposed by these + methods and some others which call them. - Added a wrapper class around `pub global activate` applications - `PubApplication` - Grinder can now create a simple starter script for a project - run `pub run grinder:init` diff --git a/lib/grinder_tools.dart b/lib/grinder_tools.dart index 7b95def6..8cca9ff0 100644 --- a/lib/grinder_tools.dart +++ b/lib/grinder_tools.dart @@ -8,7 +8,6 @@ library grinder.tools; import 'dart:async'; -import 'dart:convert'; import 'dart:io'; import 'dart:math' as math; @@ -16,10 +15,14 @@ import 'package:cli_util/cli_util.dart' as cli_util; import 'package:which/which.dart'; import 'grinder.dart'; +import 'src/run.dart' as r; +import 'src/run_utils.dart'; import 'src/utils.dart'; import 'src/_mserve.dart'; import 'src/_wip.dart'; +export 'src/run.dart'; + final Directory BIN_DIR = new Directory('bin'); final Directory BUILD_DIR = new Directory('build'); final Directory LIB_DIR = new Directory('lib'); @@ -43,9 +46,10 @@ Directory getSdkDir([List cliArgs]) => cli_util.getSdkDir(cliArgs); File get dartVM => joinFile(sdkDir, ['bin', _sdkBin('dart')]); -/// Run a dart [script] using [runProcess]. +/// Run a dart [script] using [r.run]. /// /// Returns the stdout. +@Deprecated('Use `Dart.run` instead.') String runDartScript(String script, {List arguments : const [], bool quiet: false, String packageRoot, String workingDirectory, int vmNewGenHeapMB, int vmOldGenHeapMB}) { @@ -66,92 +70,10 @@ String runDartScript(String script, args.add(script); args.addAll(arguments); - return runProcess(_sdkBin('dart'), arguments: args, quiet: quiet, + return r.run(_sdkBin('dart'), arguments: args, quiet: quiet, workingDirectory: workingDirectory); } -/// Synchronously run an [executable]. -/// -/// If [quiet] is false, [log]s the stdout. The stderr is always logged. -/// -/// Returns the stdout. -/// -/// All other optional parameters are forwarded to [Process.runSync]. -String runProcess(String executable, - {List arguments : const [], - bool quiet: false, - String workingDirectory, - Map environment}) { - log("${executable} ${arguments.join(' ')}"); - - ProcessResult result = Process.runSync( - executable, arguments, workingDirectory: workingDirectory, - environment: environment); - - if (!quiet) { - if (result.stdout != null && result.stdout.isNotEmpty) { - log(result.stdout.trim()); - } - } - - if (result.stderr != null && result.stderr.isNotEmpty) { - log(result.stderr); - } - - if (result.exitCode != 0) { - throw new ProcessException._(executable, result.exitCode, result.stdout, - result.stderr); - } - - return result.stdout; -} - -/// Asynchronously run an [executable]. -/// -/// If [quiet] is false, [log]s the stdout as line breaks are encountered. -/// The stderr is always logged. -/// -/// Returns a future for the stdout. -/// -/// All other optional parameters are forwarded to [Process.start]. -Future runProcessAsync(String executable, - {List arguments : const [], - bool quiet: false, - String workingDirectory}) { - - if (!quiet) log("$executable ${arguments.join(' ')}"); - - List stdout = [], stderr = []; - - return Process.start(executable, arguments, workingDirectory: workingDirectory) - .then((Process process) { - - // Handle stdout. - var broadcastStdout = process.stdout.asBroadcastStream(); - var stdoutLines = _toLineStream(broadcastStdout); - broadcastStdout.listen((List data) => stdout.addAll(data)); - if (!quiet) { - stdoutLines.listen(_logStdout); - } - - // Handle stderr. - var broadcastStderr = process.stderr.asBroadcastStream(); - var stderrLines = _toLineStream(broadcastStderr); - broadcastStderr.listen((List data) => stderr.addAll(data)); - stderrLines.listen(_logStderr); - - return process.exitCode.then((int code) { - var stdoutString = SYSTEM_ENCODING.decode(stdout); - - if (code != 0) { - throw new ProcessException._(executable, code, stdoutString, SYSTEM_ENCODING.decode(stderr)); - } - - return stdoutString; - }); - }); -} - /// A default implementation of an `init` task. This task verifies that the /// grind script is executed from the project root. @Deprecated('the functionality of this method has been rolled into grinder startup') @@ -191,7 +113,7 @@ class Pub { FileSet publock = new FileSet.fromFile(new File('pubspec.lock')); if (force || !publock.upToDate(pubspec)) { - return runProcessAsync(_sdkBin('pub'), arguments: ['get'], + return r.runAsync(_sdkBin('pub'), arguments: ['get'], workingDirectory: workingDirectory).then((_) => null); } @@ -209,7 +131,7 @@ class Pub { * Run `pub upgrade` on the current project. */ static Future upgradeAsync({String workingDirectory}) { - return runProcessAsync(_sdkBin('pub'), arguments: ['upgrade'], + return r.runAsync(_sdkBin('pub'), arguments: ['upgrade'], workingDirectory: workingDirectory).then((_) => null); } @@ -228,7 +150,7 @@ class Pub { if (outputDirectory != null) args.add('--output=${outputDirectory}'); if (directories != null && directories.isNotEmpty) args.addAll(directories); - runProcess(_sdkBin('pub'), arguments: args, + r.run(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory); } @@ -247,7 +169,7 @@ class Pub { if (outputDirectory != null) args.add('--output=${outputDirectory}'); if (directories != null && directories.isNotEmpty) args.addAll(directories); - return runProcessAsync(_sdkBin('pub'), arguments: args, + return r.runAsync(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory).then((_) => null); } @@ -259,7 +181,7 @@ class Pub { var scriptArg = script == null ? package : '$package:$script'; List args = ['run', scriptArg]; if (arguments != null) args.addAll(arguments); - return runProcess(_sdkBin('pub'), arguments: args, + return r.run(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory); } @@ -269,7 +191,7 @@ class Pub { static PubGlobal get global => _global; static String _run(String command, {bool quiet: false, String workingDirectory}) { - return runProcess(_sdkBin('pub'), quiet: quiet, arguments: [command], + return r.run(_sdkBin('pub'), quiet: quiet, arguments: [command], workingDirectory: workingDirectory); } } @@ -280,14 +202,14 @@ class PubGlobal { /// Install a new Dart application. void activate(String package) { - runProcess(_sdkBin('pub'), arguments: ['global', 'activate', package]); + r.run(_sdkBin('pub'), arguments: ['global', 'activate', package]); } /// Run the given installed Dart application. String run(String package, {List arguments, String workingDirectory}) { List args = ['global', 'run', package]; if (arguments != null) args.addAll(arguments); - return runProcess(_sdkBin('pub'), arguments: args, + return r.run(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory); } @@ -298,7 +220,7 @@ class PubGlobal { //discoveryapis_generator 0.6.1 //... - var stdout = runProcess(_sdkBin('pub'), arguments: ['global', 'list'], quiet: true); + var stdout = r.run(_sdkBin('pub'), arguments: ['global', 'list'], quiet: true); var lines = stdout.trim().split('\n'); return lines.map((line) { @@ -356,6 +278,46 @@ class PubApplication { String toString() => appName; } +/// Utility tasks for invoking dart. +class Dart { + + /// Run a dart [script] using [r.run]. + /// + /// Returns the stdout. + static String run(String script, + {List arguments : const [], bool quiet: false, + String packageRoot, String workingDirectory, int vmNewGenHeapMB, + int vmOldGenHeapMB}) { + List args = []; + + if (packageRoot != null) { + args.add('--package-root=${packageRoot}'); + } + + if (vmNewGenHeapMB != null) { + args.add('--new_gen_heap_size=${vmNewGenHeapMB}'); + } + + if (vmOldGenHeapMB != null) { + args.add('--old_gen_heap_size=${vmOldGenHeapMB}'); + } + + args.add(script); + args.addAll(arguments); + + return r.run(_sdkBin('dart'), arguments: args, quiet: quiet, + workingDirectory: workingDirectory); + } + + static String version({bool quiet: false}) { + r.run(_sdkBin('dart'), arguments: ['--version'], + quiet: quiet); + // The stdout does not have a stable documented format, so use the provided + // metadata instead. + return Platform.version.substring(0, Platform.version.indexOf(' ')); + } +} + /** * Utility tasks for invoking dart2js. */ @@ -376,7 +338,7 @@ class Dart2js { args.add('-o${outFile.path}'); args.add(sourceFile.path); - runProcess(_sdkBin('dart2js'), arguments: args); + r.run(_sdkBin('dart2js'), arguments: args); } /** @@ -395,7 +357,7 @@ class Dart2js { args.add('-o${outFile.path}'); args.add(sourceFile.path); - return runProcessAsync(_sdkBin('dart2js'), arguments: args) + return r.runAsync(_sdkBin('dart2js'), arguments: args) .then((_) => null); } @@ -403,7 +365,7 @@ class Dart2js { AppVersion.parse(_run('--version', quiet: quiet)).version; static String _run(String command, {bool quiet: false}) => - runProcess(_sdkBin('dart2js'), quiet: quiet, arguments: [command]); + r.run(_sdkBin('dart2js'), quiet: quiet, arguments: [command]); } /** @@ -425,10 +387,10 @@ class Analyzer { if (fatalWarnings) args.add('--fatal-warnings'); args.addAll(files.map((f) => f is File ? f.path : f)); - runProcess(_sdkBin('dartanalyzer'), arguments: args); + r.run(_sdkBin('dartanalyzer'), arguments: args); } - static String version({bool quiet: false}) => AppVersion.parse(runProcess( + static String version({bool quiet: false}) => AppVersion.parse(r.run( _sdkBin('dartanalyzer'), quiet: quiet, arguments: ['--version'])).version; } @@ -443,7 +405,7 @@ class Tests { static void runCliTests({String directory: 'test', String testFile: 'all.dart'}) { String file = '${directory}/${testFile}'; log('running tests: ${file}...'); - runDartScript(file); + Dart.run(file); } /** @@ -612,7 +574,7 @@ class Chrome { // TODO: This process often won't terminate, so that's a problem. log("starting chrome..."); - runProcess(browserPath, arguments: args, environment: envVars); + r.run(browserPath, arguments: args, environment: envVars); } Future launchUrl(String url, @@ -631,12 +593,12 @@ class Chrome { return Process.start(browserPath, _args, environment: envVars) .then((Process process) { // Handle stdout. - var stdoutLines = _toLineStream(process.stdout); - stdoutLines.listen(_logStdout); + var stdoutLines = toLineStream(process.stdout); + stdoutLines.listen(logStdout); // Handle stderr. - var stderrLines = _toLineStream(process.stderr); - stderrLines.listen(_logStderr); + var stderrLines = toLineStream(process.stderr); + stderrLines.listen(logStderr); return new BrowserInstance(this, process); }); @@ -803,36 +765,3 @@ class AppVersion { String toString() => '$name $version'; } - -/// An exception from a process which exited with a non-zero exit code. -class ProcessException { - final String executable; - final int exitCode; - final String stdout; - final String stderr; - - ProcessException._(this.executable, this.exitCode, this.stdout, this.stderr); - - String toString() => """ -$executable failed with: -exit code: $exitCode - -stdout: - -$stdout - -stderr: - -$stderr"""; -} - -Stream _toLineStream(Stream> s) => - s.transform(UTF8.decoder).transform(const LineSplitter()); - -_logStdout(String line) { - log(line); -} - -_logStderr(String line) { - log('stderr: $line'); -} diff --git a/lib/src/run.dart b/lib/src/run.dart new file mode 100644 index 00000000..71943c23 --- /dev/null +++ b/lib/src/run.dart @@ -0,0 +1,143 @@ + +library grinder.src.run; + +import 'dart:async'; +import 'dart:io'; + +import '../grinder.dart'; +import 'run_utils.dart'; + +/// Synchronously run an [executable]. +/// +/// If [quiet] is false, [log]s the stdout. The stderr is always logged. +/// +/// Returns the stdout. +/// +/// All other optional parameters are forwarded to [Process.runSync]. +String run(String executable, + {List arguments : const [], + bool quiet: false, + String workingDirectory, + Map environment}) { + log("${executable} ${arguments.join(' ')}"); + + ProcessResult result = Process.runSync( + executable, arguments, workingDirectory: workingDirectory, + environment: environment); + + if (!quiet) { + if (result.stdout != null && result.stdout.isNotEmpty) { + log(result.stdout.trim()); + } + } + + if (result.stderr != null && result.stderr.isNotEmpty) { + log(result.stderr); + } + + if (result.exitCode != 0) { + throw new ProcessException._(executable, result.exitCode, result.stdout, + result.stderr); + } + + return result.stdout; +} + +/// Synchronously run an [executable]. +/// +/// If [quiet] is false, [log]s the stdout. The stderr is always logged. +/// +/// Returns the stdout. +/// +/// All other optional parameters are forwarded to [Process.runSync]. +@Deprecated('Use `run` instead.') +String runProcess(String executable, + {List arguments : const [], + bool quiet: false, + String workingDirectory, + Map environment}) => run(executable, arguments: arguments, + quiet: quiet, workingDirectory: workingDirectory, + environment: environment); + +/// Asynchronously run an [executable]. +/// +/// If [quiet] is false, [log]s the stdout as line breaks are encountered. +/// The stderr is always logged. +/// +/// Returns a future for the stdout. +/// +/// All other optional parameters are forwarded to [Process.start]. +Future runAsync(String executable, + {List arguments : const [], + bool quiet: false, + String workingDirectory}) { + + if (!quiet) log("$executable ${arguments.join(' ')}"); + + List stdout = [], stderr = []; + + return Process.start(executable, arguments, workingDirectory: workingDirectory) + .then((Process process) { + + // Handle stdout. + var broadcastStdout = process.stdout.asBroadcastStream(); + var stdoutLines = toLineStream(broadcastStdout); + broadcastStdout.listen((List data) => stdout.addAll(data)); + if (!quiet) { + stdoutLines.listen(logStdout); + } + + // Handle stderr. + var broadcastStderr = process.stderr.asBroadcastStream(); + var stderrLines = toLineStream(broadcastStderr); + broadcastStderr.listen((List data) => stderr.addAll(data)); + stderrLines.listen(logStderr); + + return process.exitCode.then((int code) { + var stdoutString = SYSTEM_ENCODING.decode(stdout); + + if (code != 0) { + throw new ProcessException._(executable, code, stdoutString, SYSTEM_ENCODING.decode(stderr)); + } + + return stdoutString; + }); + }); +} + +/// Asynchronously run an [executable]. +/// +/// If [quiet] is false, [log]s the stdout as line breaks are encountered. +/// The stderr is always logged. +/// +/// Returns a future for the stdout. +/// +/// All other optional parameters are forwarded to [Process.start]. +@Deprecated('Use `runAsync` instead.') +Future runProcessAsync(String executable, + {List arguments : const [], + bool quiet: false, + String workingDirectory}) => runAsync(executable, arguments: arguments, + quiet: quiet, workingDirectory: workingDirectory); + +/// An exception from a process which exited with a non-zero exit code. +class ProcessException { +final String executable; +final int exitCode; +final String stdout; +final String stderr; + +ProcessException._(this.executable, this.exitCode, this.stdout, this.stderr); + +String toString() => """ +$executable failed with: +exit code: $exitCode + +stdout: + +$stdout + +stderr: + +$stderr"""; +} diff --git a/lib/src/run_utils.dart b/lib/src/run_utils.dart new file mode 100644 index 00000000..d91b5e6c --- /dev/null +++ b/lib/src/run_utils.dart @@ -0,0 +1,18 @@ + +library grinder.src.run_utils; + +import 'dart:async'; +import 'dart:convert'; + +import '../grinder.dart'; + +Stream toLineStream(Stream> s) => + s.transform(UTF8.decoder).transform(const LineSplitter()); + +logStdout(String line) { + log(line); +} + +logStderr(String line) { + log('stderr: $line'); +} diff --git a/tool/grind.dart b/tool/grind.dart index 0fc44330..cfedef36 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -25,7 +25,7 @@ checkInit() { try { File pubspec = temp.join('pubspec.yaml').createFile(); pubspec.writeAsStringSync('name: foo', flush: true); - runDartScript(FilePath.current.join('bin', 'init.dart').path, workingDirectory: temp.path); + Dart.run(FilePath.current.join('bin', 'init.dart').path, workingDirectory: temp.path); Analyzer.analyze(temp.join('tool', 'grind.dart').path, fatalWarnings: true); } finally { temp.delete(); From f7c721ce675d73acd7cfd37af374111439a20c29 Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Fri, 10 Apr 2015 07:50:39 -0500 Subject: [PATCH 2/2] Review changes --- lib/grinder_tools.dart | 42 +++++++++++++++++++++--------------------- lib/src/run.dart | 2 ++ lib/src/run_utils.dart | 2 ++ 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/lib/grinder_tools.dart b/lib/grinder_tools.dart index 8cca9ff0..c8c26fbc 100644 --- a/lib/grinder_tools.dart +++ b/lib/grinder_tools.dart @@ -15,7 +15,7 @@ import 'package:cli_util/cli_util.dart' as cli_util; import 'package:which/which.dart'; import 'grinder.dart'; -import 'src/run.dart' as r; +import 'src/run.dart' as run_lib; import 'src/run_utils.dart'; import 'src/utils.dart'; import 'src/_mserve.dart'; @@ -46,7 +46,7 @@ Directory getSdkDir([List cliArgs]) => cli_util.getSdkDir(cliArgs); File get dartVM => joinFile(sdkDir, ['bin', _sdkBin('dart')]); -/// Run a dart [script] using [r.run]. +/// Run a dart [script] using [run_lib.run]. /// /// Returns the stdout. @Deprecated('Use `Dart.run` instead.') @@ -70,7 +70,7 @@ String runDartScript(String script, args.add(script); args.addAll(arguments); - return r.run(_sdkBin('dart'), arguments: args, quiet: quiet, + return run_lib.run(_sdkBin('dart'), arguments: args, quiet: quiet, workingDirectory: workingDirectory); } @@ -113,7 +113,7 @@ class Pub { FileSet publock = new FileSet.fromFile(new File('pubspec.lock')); if (force || !publock.upToDate(pubspec)) { - return r.runAsync(_sdkBin('pub'), arguments: ['get'], + return run_lib.runAsync(_sdkBin('pub'), arguments: ['get'], workingDirectory: workingDirectory).then((_) => null); } @@ -131,7 +131,7 @@ class Pub { * Run `pub upgrade` on the current project. */ static Future upgradeAsync({String workingDirectory}) { - return r.runAsync(_sdkBin('pub'), arguments: ['upgrade'], + return run_lib.runAsync(_sdkBin('pub'), arguments: ['upgrade'], workingDirectory: workingDirectory).then((_) => null); } @@ -150,7 +150,7 @@ class Pub { if (outputDirectory != null) args.add('--output=${outputDirectory}'); if (directories != null && directories.isNotEmpty) args.addAll(directories); - r.run(_sdkBin('pub'), arguments: args, + run_lib.run(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory); } @@ -169,7 +169,7 @@ class Pub { if (outputDirectory != null) args.add('--output=${outputDirectory}'); if (directories != null && directories.isNotEmpty) args.addAll(directories); - return r.runAsync(_sdkBin('pub'), arguments: args, + return run_lib.runAsync(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory).then((_) => null); } @@ -181,7 +181,7 @@ class Pub { var scriptArg = script == null ? package : '$package:$script'; List args = ['run', scriptArg]; if (arguments != null) args.addAll(arguments); - return r.run(_sdkBin('pub'), arguments: args, + return run_lib.run(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory); } @@ -191,7 +191,7 @@ class Pub { static PubGlobal get global => _global; static String _run(String command, {bool quiet: false, String workingDirectory}) { - return r.run(_sdkBin('pub'), quiet: quiet, arguments: [command], + return run_lib.run(_sdkBin('pub'), quiet: quiet, arguments: [command], workingDirectory: workingDirectory); } } @@ -202,14 +202,14 @@ class PubGlobal { /// Install a new Dart application. void activate(String package) { - r.run(_sdkBin('pub'), arguments: ['global', 'activate', package]); + run_lib.run(_sdkBin('pub'), arguments: ['global', 'activate', package]); } /// Run the given installed Dart application. String run(String package, {List arguments, String workingDirectory}) { List args = ['global', 'run', package]; if (arguments != null) args.addAll(arguments); - return r.run(_sdkBin('pub'), arguments: args, + return run_lib.run(_sdkBin('pub'), arguments: args, workingDirectory: workingDirectory); } @@ -220,7 +220,7 @@ class PubGlobal { //discoveryapis_generator 0.6.1 //... - var stdout = r.run(_sdkBin('pub'), arguments: ['global', 'list'], quiet: true); + var stdout = run_lib.run(_sdkBin('pub'), arguments: ['global', 'list'], quiet: true); var lines = stdout.trim().split('\n'); return lines.map((line) { @@ -281,7 +281,7 @@ class PubApplication { /// Utility tasks for invoking dart. class Dart { - /// Run a dart [script] using [r.run]. + /// Run a dart [script] using [run_lib.run]. /// /// Returns the stdout. static String run(String script, @@ -305,12 +305,12 @@ class Dart { args.add(script); args.addAll(arguments); - return r.run(_sdkBin('dart'), arguments: args, quiet: quiet, + return run_lib.run(_sdkBin('dart'), arguments: args, quiet: quiet, workingDirectory: workingDirectory); } static String version({bool quiet: false}) { - r.run(_sdkBin('dart'), arguments: ['--version'], + run_lib.run(_sdkBin('dart'), arguments: ['--version'], quiet: quiet); // The stdout does not have a stable documented format, so use the provided // metadata instead. @@ -338,7 +338,7 @@ class Dart2js { args.add('-o${outFile.path}'); args.add(sourceFile.path); - r.run(_sdkBin('dart2js'), arguments: args); + run_lib.run(_sdkBin('dart2js'), arguments: args); } /** @@ -357,7 +357,7 @@ class Dart2js { args.add('-o${outFile.path}'); args.add(sourceFile.path); - return r.runAsync(_sdkBin('dart2js'), arguments: args) + return run_lib.runAsync(_sdkBin('dart2js'), arguments: args) .then((_) => null); } @@ -365,7 +365,7 @@ class Dart2js { AppVersion.parse(_run('--version', quiet: quiet)).version; static String _run(String command, {bool quiet: false}) => - r.run(_sdkBin('dart2js'), quiet: quiet, arguments: [command]); + run_lib.run(_sdkBin('dart2js'), quiet: quiet, arguments: [command]); } /** @@ -387,10 +387,10 @@ class Analyzer { if (fatalWarnings) args.add('--fatal-warnings'); args.addAll(files.map((f) => f is File ? f.path : f)); - r.run(_sdkBin('dartanalyzer'), arguments: args); + run_lib.run(_sdkBin('dartanalyzer'), arguments: args); } - static String version({bool quiet: false}) => AppVersion.parse(r.run( + static String version({bool quiet: false}) => AppVersion.parse(run_lib.run( _sdkBin('dartanalyzer'), quiet: quiet, arguments: ['--version'])).version; } @@ -574,7 +574,7 @@ class Chrome { // TODO: This process often won't terminate, so that's a problem. log("starting chrome..."); - r.run(browserPath, arguments: args, environment: envVars); + run_lib.run(browserPath, arguments: args, environment: envVars); } Future launchUrl(String url, diff --git a/lib/src/run.dart b/lib/src/run.dart index 71943c23..58509ffa 100644 --- a/lib/src/run.dart +++ b/lib/src/run.dart @@ -1,3 +1,5 @@ +// Copyright 2015 Google. All rights reserved. Use of this source code is +// governed by a BSD-style license that can be found in the LICENSE file. library grinder.src.run; diff --git a/lib/src/run_utils.dart b/lib/src/run_utils.dart index d91b5e6c..e729f8d2 100644 --- a/lib/src/run_utils.dart +++ b/lib/src/run_utils.dart @@ -1,3 +1,5 @@ +// Copyright 2015 Google. All rights reserved. Use of this source code is +// governed by a BSD-style license that can be found in the LICENSE file. library grinder.src.run_utils;