From bf2326e2a1094eb0a2a6e3b464b1d029ae68aebb Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 6 Feb 2024 09:44:57 -0600 Subject: [PATCH] Fix the 'serve testing-package' task to generate docs --- tool/task.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tool/task.dart b/tool/task.dart index 725e99ad28..803d05ada0 100644 --- a/tool/task.dart +++ b/tool/task.dart @@ -469,17 +469,18 @@ Map createThrowawayPubCache() { final String _defaultPubCache = Platform.environment['PUB_CACHE'] ?? path.context.resolveTildePath('~/.pub-cache'); -Future docTestingPackage() async { +Future docTestingPackage() async { var testPackagePath = testPackage.absolute.path; var launcher = SubprocessLauncher('doc-test-package'); await launcher.runStreamedDartCommand(['pub', 'get'], workingDirectory: testPackagePath); + var outputPath = _testingPackageDocsDir.absolute.path; await launcher.runStreamedDartCommand( [ '--enable-asserts', path.join(Directory.current.absolute.path, 'bin', 'dartdoc.dart'), '--output', - _testingPackageDocsDir.absolute.path, + outputPath, '--example-path-prefix', 'examples', '--include-source', @@ -489,6 +490,7 @@ Future docTestingPackage() async { ], workingDirectory: testPackagePath, ); + return outputPath; } final Directory _testingPackageDocsDir = @@ -649,6 +651,7 @@ Future _serveDocsFrom(String servePath, int port, String context) async { } Future serveTestingPackageDocs() async { + var outputPath = await docTestingPackage(); print('launching dhttpd on port 8002 for SDK'); var launcher = SubprocessLauncher('serve-test-package-docs'); await launcher.runStreamed(Platform.resolvedExecutable, [ @@ -659,7 +662,7 @@ Future serveTestingPackageDocs() async { '--port', '8002', '--path', - _testingPackageDocsDir.absolute.path, + outputPath, ]); }