Skip to content

Instantly share code, notes, and snippets.

@pjako
Created April 3, 2012 13:05
Show Gist options
  • Save pjako/2291845 to your computer and use it in GitHub Desktop.
Save pjako/2291845 to your computer and use it in GitHub Desktop.
Dart Docs generation Script
#import('dart:io');
final String PATH_TO_DARTSDK = "/Users/XYZ/dart-sdk";
final String SUBDIRECTORY = "";
final String LIBRARY_DARTFILE = "XYZ.dart";
main() {
var p = new Process.start("${PATH_TO_DARTSDK}bin/dart", ['${PATH_TO_DARTSDK}lib/dartdoc/dartdoc.dart', "--mode=static", "${new Directory.current().path}$SUBDIRECTORY$LIBRARY_DARTFILE"],"${new Directory.current().path}$SUBDIRECTORY");
var stdoutStream = new StringInputStream(p.stdout);
stdoutStream.onLine = () => print(stdoutStream.readLine());
p.onExit = (exitCode) {
print('exit code: $exitCode');
p.close();
};
p.onError = (errorCode) {
print('exit code: $errorCode');
p.close();
};
}
@atebitftw
Copy link

This worked great for me, though I had to flip all the paths from '/' to '' to run it on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment