fix build
try workaround
Closes #878
Squashed commit of the following:
commit ebec1a187b93c284bdba6d722076d596d741ef5f
Author: Seth Ladd <sethladd@google.com>
Date: Fri Aug 28 13:43:53 2015 -0700
try workaround
commit 426e3687f2943d898b8543b252819ac93a3c4952
Author: Seth Ladd <sethladd@google.com>
Date: Fri Aug 28 13:36:10 2015 -0700
uncomment
commit 85b10fcb7b80b41983a8e6e5c6522374f53548a5
Author: Seth Ladd <sethladd@google.com>
Date: Fri Aug 28 13:30:30 2015 -0700
fix build
diff --git a/README.md b/README.md
index 1507fea..928cc0c 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@
[Download the Dart SDK](https://www.dartlang.org/downloads/),
version 1.12-dev.5.10 or later.
-Ensure the SDK's `bin` directory to your PATH.
+If not already added, add the SDK's `bin` directory to your PATH.
### From pub.dartlang.org
@@ -23,9 +23,9 @@
$ pub global activate dartdoc
-Note: to ensure that this version is run when you type `dartdoc` on
-the command line, ensure that `~/.pub-cache/bin` is on your PATH,
-and before the path to the Dart SDK.
+Note: to ensure that this version is run when you type dartdoc on
+the command line, make sure that ~/.pub-cache/bin is on your PATH, and
+before the path to the Dart SDK.
## Running dartdoc
diff --git a/tool/grind.dart b/tool/grind.dart
index bb3b917..46e3d9e 100644
--- a/tool/grind.dart
+++ b/tool/grind.dart
@@ -54,26 +54,6 @@
}
}
-@Task('Start observatory for a test run')
-observe() async {
- delete(docsDir);
- // TODO: Use `Dart.run` when https://github.com/google/grinder.dart/issues/214
- // is fixed.
- // TODO: uncomment all this when https://code.google.com/p/dart/issues/detail?id=23359
- // is fixed
-// runAsync('dart',
-// arguments: ['--pause-isolates-on-exit', '--enable-vm-service=7334',
-// // TODO: we only need --profile on windows
-// '--profile', 'bin/dartdoc.dart', '--output', '${DOCS_DIR.path}']);
-// await new Future.delayed(const Duration(seconds: 1));
-// runAsync('open', arguments: ['http://localhost:7334']);
-
- print('Copy and paste this into your console:\n');
- print('open http://localhost:7334');
- print('dart --pause-isolates-on-exit --enable-vm-service=7334 '
- '--profile bin/dartdoc.dart --output ${docsDir.path}');
-}
-
@Task('Publish to pub.dartlang')
@Depends(checkChangelogHasVersion, checkVersionMatches)
publish() async {
@@ -165,31 +145,43 @@
Future buildSdkDocs() async {
delete(docsDir);
log('building SDK docs');
- try {
- int sdkDocsGenTime = await _runAsyncTimed(() {
- return Dart.runAsync('bin/dartdoc.dart', arguments:
- ['--output', '${docsDir.path}', '--sdk-docs', '--show-progress']);
- });
- var indexHtml = joinFile(docsDir, ['index.html']);
- if (!indexHtml.existsSync()) {
- fail('no index.html found for SDK docs');
- }
- // check for the existence of certain files/dirs
- var libsLength =
- docsDir.listSync().where((fs) => fs.path.contains('dart_')).length;
- if (libsLength != 17) {
- fail('docs not generated for all the SDK libraries, '
- 'expected 17 directories, generated $libsLength directories');
- }
- var futureConstFile =
- joinFile(docsDir, [path.join('dart_async', 'Future', 'Future.html')]);
- if (!futureConstFile.existsSync()) {
- fail('no Future.html found for dart:async Future constructor');
- }
+ int sdkDocsGenTime = await _runAsyncTimed(() async {
+ var process = await Process.start('dart', [
+ 'bin/dartdoc.dart',
+ '--output',
+ '${docsDir.path}',
+ '--sdk-docs',
+ '--show-progress'
+ ]);
+ stdout.addStream(process.stdout);
+ stderr.addStream(process.stderr);
+ });
+ return _uploadStats(sdkDocsGenTime);
+}
- return _uploadStats(sdkDocsGenTime);
- } catch (e) {
- rethrow;
+@Task('Validate the SDK doc build.')
+//@Depends(buildSdkDocs) unfortunately this doesn't work, because
+// I get Uncaught Error: Bad state: StreamSink is bound to a stream
+// if I run grind validate-sdk-docs. However, everything works
+// if I run grind build-sdk-docs manually.
+// See https://github.com/google/grinder.dart/issues/291
+validateSdkDocs() {
+ const expectedLibCount = 18;
+ var indexHtml = joinFile(docsDir, ['index.html']);
+ if (!indexHtml.existsSync()) {
+ fail('no index.html found for SDK docs');
+ }
+ // check for the existence of certain files/dirs
+ var libsLength =
+ docsDir.listSync().where((fs) => fs.path.contains('dart-')).length;
+ if (libsLength != expectedLibCount) {
+ fail('docs not generated for all the SDK libraries, '
+ 'expected $expectedLibCount directories, generated $libsLength directories');
+ }
+ var futureConstFile =
+ joinFile(docsDir, [path.join('dart-async', 'Future', 'Future.html')]);
+ if (!futureConstFile.existsSync()) {
+ fail('no Future.html found for dart:async Future constructor');
}
}
diff --git a/tool/travis.sh b/tool/travis.sh
index d581ffd..6189dac 100755
--- a/tool/travis.sh
+++ b/tool/travis.sh
@@ -19,8 +19,9 @@
# Build the SDK docs
# silence stdout but echo stderr
echo ""
- echo "Building SDK docs..."
+ echo "Building and validating SDK docs..."
grind build-sdk-docs
+ grind validate-sdk-docs
echo "SDK docs process finished"
else
echo ""