Skip to content

Commit

Permalink
Fix the 'serve testing-package' task to generate docs (#3647)
Browse files Browse the repository at this point in the history
  • Loading branch information
srawlins authored Feb 6, 2024
1 parent 457c34e commit d2f90c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tool/task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -469,17 +469,18 @@ Map<String, String> createThrowawayPubCache() {
final String _defaultPubCache = Platform.environment['PUB_CACHE'] ??
path.context.resolveTildePath('~/.pub-cache');

Future<void> docTestingPackage() async {
Future<String> 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',
Expand All @@ -489,6 +490,7 @@ Future<void> docTestingPackage() async {
],
workingDirectory: testPackagePath,
);
return outputPath;
}

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

Future<void> 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, [
Expand All @@ -659,7 +662,7 @@ Future<void> serveTestingPackageDocs() async {
'--port',
'8002',
'--path',
_testingPackageDocsDir.absolute.path,
outputPath,
]);
}

Expand Down

0 comments on commit d2f90c5

Please sign in to comment.