diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index 2d154430ec2..4463b9f0cde 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -28,11 +28,6 @@ function generate_docs() { # >>> If you update this version, also update it in dev/bots/analyze_sample_code.dart <<< "$DART" pub global activate snippets 0.2.5 - # Run the snippets tool once to force building of the package executable, - # since "dart pub global run" has issues with startup concurrency. - # TODO(gspencergoog): Remove once pub issue is fixed, https://github.com/dart-lang/pub/issues/3165 - "$DART" pub global run snippets --help - # This script generates a unified doc set, and creates # a custom index.html, placing everything into dev/docs/doc. (cd "$FLUTTER_ROOT/dev/tools" && "$FLUTTER" pub get) diff --git a/dev/snippets/config/skeletons/sample.html b/dev/snippets/config/skeletons/sample.html index 92dd25aa832..e4b672fa694 100644 --- a/dev/snippets/config/skeletons/sample.html +++ b/dev/snippets/config/skeletons/sample.html @@ -8,35 +8,18 @@ link -
{{code}}
- {{app}}
+ {{app}}
\s*\s*import 'package:flutter/material.dart';');
+ _sanityCheckExample(sampleExample, sampleRegExp);
+
+ // Check a "snippet" example, any one will do.
+ final File snippetExample = File('$kPublishRoot/api/widgets/ModalRoute/barrierColor.html');
+ final RegExp snippetRegExp = RegExp(r'\s*.*Color get barrierColor => Theme\.of\(navigator\.context\)\.backgroundColor;.*
');
+ _sanityCheckExample(snippetExample, snippetRegExp);
+
+ // Check a "dartpad" example, any one will do.
+ final File dartpadExample = File('$kPublishRoot/api/widgets/PhysicalShape-class.html');
+ final RegExp dartpadRegExp = RegExp(r'\s*');
+ _sanityCheckExample(dartpadExample, dartpadRegExp);
}
/// Creates a custom index.html because we try to maintain old