Skip to content

Commit d2f90c5

Browse files
authored
Fix the 'serve testing-package' task to generate docs (#3647)
1 parent 457c34e commit d2f90c5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tool/task.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,17 +469,18 @@ Map<String, String> createThrowawayPubCache() {
469469
final String _defaultPubCache = Platform.environment['PUB_CACHE'] ??
470470
path.context.resolveTildePath('~/.pub-cache');
471471

472-
Future<void> docTestingPackage() async {
472+
Future<String> docTestingPackage() async {
473473
var testPackagePath = testPackage.absolute.path;
474474
var launcher = SubprocessLauncher('doc-test-package');
475475
await launcher.runStreamedDartCommand(['pub', 'get'],
476476
workingDirectory: testPackagePath);
477+
var outputPath = _testingPackageDocsDir.absolute.path;
477478
await launcher.runStreamedDartCommand(
478479
[
479480
'--enable-asserts',
480481
path.join(Directory.current.absolute.path, 'bin', 'dartdoc.dart'),
481482
'--output',
482-
_testingPackageDocsDir.absolute.path,
483+
outputPath,
483484
'--example-path-prefix',
484485
'examples',
485486
'--include-source',
@@ -489,6 +490,7 @@ Future<void> docTestingPackage() async {
489490
],
490491
workingDirectory: testPackagePath,
491492
);
493+
return outputPath;
492494
}
493495

494496
final Directory _testingPackageDocsDir =
@@ -649,6 +651,7 @@ Future<void> _serveDocsFrom(String servePath, int port, String context) async {
649651
}
650652

651653
Future<void> serveTestingPackageDocs() async {
654+
var outputPath = await docTestingPackage();
652655
print('launching dhttpd on port 8002 for SDK');
653656
var launcher = SubprocessLauncher('serve-test-package-docs');
654657
await launcher.runStreamed(Platform.resolvedExecutable, [
@@ -659,7 +662,7 @@ Future<void> serveTestingPackageDocs() async {
659662
'--port',
660663
'8002',
661664
'--path',
662-
_testingPackageDocsDir.absolute.path,
665+
outputPath,
663666
]);
664667
}
665668

0 commit comments

Comments
 (0)