Skip to content

Conversation

@gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Aug 16, 2023

Description

This re-lands #132353 with some additional options for keeping around the staging directory, so that the recipe for publishing docs can give those options and have the staging directory left around for deploying to the website.

Reverted in #132613

Related Issues

@gspencergoog gspencergoog changed the title Reland: "Reorganize and clarify API doc generator" (#132613) Reland: "Reorganize and clarify API doc generator" (#132353) Aug 16, 2023
import 'dartdoc_checker.dart';
import 'examples_smoke_test.dart';

FileSystem filesystem = const LocalFileSystem();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
FileSystem filesystem = const LocalFileSystem();
const FileSystem filesystem = LocalFileSystem();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that was on purpose: I wanted tests to be able to set that global to a memory filesystem (even though I don't actually use that capability yet).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, in talking to Chris, I think he's right: if I write more tests for this, I'd be testing the main classes, not the main function itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen my share of test flakes from this pattern :)

if (!offlineDir.existsSync()) {
offlineDir.createSync(recursive: true);
}
tarDirectory(packageRoot, offlineDir.childFile('flutter.docset.tar.gz'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we call this on Windows? I wouldn't expect tar to be present on Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only expected to work on Linux and macOS. It is only called on Linux in CI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be another advantage of rewriting the bash script in Dart: it might run on Windows. Of course, you'd still have to have tar, since that's what the expected output for the offline docs is, but you could use the archive package to do it. It generates ZIP files that are about 40% larger though, so you wouldn't want to use package:archive for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, i forgot we only build docs on linux, carry on

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to deprecate package:archive, btw #115660

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 17, 2023
@auto-submit auto-submit bot merged commit ced3e76 into flutter:master Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants