From cf60de0e9526b36feda8ef6a4fe925dcac24d34b Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 23 Oct 2015 13:28:22 -0700 Subject: [PATCH] add check for dartdoc --- lib/grinder_sdk.dart | 6 ++++++ tool/grind.dart | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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 afbeac44..e55f4486 100644 --- a/tool/grind.dart +++ b/tool/grind.dart @@ -73,7 +73,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() {