Skip to content

Commit

Permalink
Merge pull request #301 from google/dartdoc
Browse files Browse the repository at this point in the history
add check for dartdoc
  • Loading branch information
devoncarew committed Oct 24, 2015
2 parents 10d2744 + cf60de0 commit e1f9def
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/grinder_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ class Dart2js {

/// Utility class for invoking dartdoc.
class DartDoc {
/// Return whether the dartdoc tool exists in this SDK.
static bool exists() {
File file = new File(sdkBin('dartdoc'));
return file.existsSync();
}

static void doc() {
runlib.run(sdkBin('dartdoc'));
}
Expand Down
8 changes: 7 additions & 1 deletion tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ void coverage() {
void buildbot() => null;

@Task()
doc() => DartDoc.docAsync();
doc() {
if (DartDoc.exists()) {
DartDoc.docAsync();
} else {
log('Dartdoc is not available in this SDK.');
}
}

@Task()
ddc() {
Expand Down

0 comments on commit e1f9def

Please sign in to comment.