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

Unified Diff: dart/lib/dartdoc/dartdoc.dart

Issue 10141009: Use 'frog' in apidoc. Also fix broken dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 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
Index: dart/lib/dartdoc/dartdoc.dart
diff --git a/dart/lib/dartdoc/dartdoc.dart b/dart/lib/dartdoc/dartdoc.dart
index 57191283f9718f3c214726e17a676fc2e7f09cf6..88a6c22ba3baa8e07bca7775b612c5a454163ded 100644
--- a/dart/lib/dartdoc/dartdoc.dart
+++ b/dart/lib/dartdoc/dartdoc.dart
@@ -175,17 +175,27 @@ void copyFiles(String from, String to) {
*/
void compileScript(String compilerPath, String libDir,
String dartPath, String jsPath) {
- final process = new Process.start(compilerPath, [
- '--libdir=$libDir', '--out=$jsPath',
- '--compile-only', '--enable-type-checks', '--warnings-as-errors',
- dartPath]);
+ onExit(int exitCode, String stdout, String stderr) {
+ if (exitCode != 0) {
+ final message = 'Non-zero exit code from $compilerPath';
+ print('$message.');
Bob Nystrom 2012/04/24 16:03:58 This is a bit strange. Why not just put the "." in
ahe 2012/04/25 08:26:55 I'm not sure how to format exception messages: Sho
Bob Nystrom 2012/04/25 18:03:41 I'd say whatever initially creates the exception m
+ print(stdout);
+ print(stderr);
+ throw message;
+ }
+ }
- process.stdout.pipe(stdout, close: false);
+ onError(error) {
+ final message = 'Error trying to execute $compilerPath. Error: $error';
+ print('$message.');
+ throw message;
+ }
- process.onError = (error) {
- print('Failed to compile $dartPath with $compilerPath. Error:');
- print(error);
- };
+ print('Compiling $dartPath to $jsPath');
+ new Process.run(compilerPath, [
+ '--libdir=$libDir', '--out=$jsPath',
+ '--compile-only', '--enable-type-checks', '--warnings-as-errors',
+ dartPath], null, onExit).onError = onError;
}
class Dartdoc {

Powered by Google App Engine
This is Rietveld 408576698