diff --git a/lib/grinder_sdk.dart b/lib/grinder_sdk.dart index 84cc2e4c..7ef67ab1 100644 --- a/lib/grinder_sdk.dart +++ b/lib/grinder_sdk.dart @@ -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')); } diff --git a/tool/grind.dart b/tool/grind.dart index 4cdc46e2..fc0db4be 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -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() {