Skip to content

Fix the 'serve testing-package' task to generate docs #3647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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