Commit Graph

12 Commits

Author SHA1 Message Date
Michael Goderbauer
52bb198fb2
Remove master from API docs (#144425) 2024-03-01 01:06:56 +00:00
Michael Goderbauer
e41ffcb742
Reland "Use dartpad's main channel for master/main docs (#144329)" (#144431)
Fix is in the second commit. The logic here went out of sync with the logic in the snippets generator from https://github.com/flutter/assets-for-api-docs, whose version was bumped as part of this change.
2024-02-29 23:10:53 +00:00
auto-submit[bot]
b099bf0b4c
Reverts "Use dartpad's main channel for master/main docs (#144329)" (#144429)
Reverts flutter/flutter#144329
Initiated by: goderbauer
Reason for reverting: broke postsubmit doc generation.
Original PR Author: goderbauer

Reviewed By: {devoncarew, HansMuller, gspencergoog}

This change reverts the following previous change:
Original Description:
Dartpad doesn't have a "master" channel anymore, it got renamed to "main". Sadly, specifying "master" is now falling back to "stable" which breaks some of our examples in the docs that require a more current Flutter version, e.g. https://main-api.flutter.dev/flutter/material/TextButton-class.html
2024-02-29 21:57:18 +00:00
Michael Goderbauer
41eeb2bb8c
Use dartpad's main channel for master/main docs (#144329)
Dartpad doesn't have a "master" channel anymore, it got renamed to "main". Sadly, specifying "master" is now falling back to "stable" which breaks some of our examples in the docs that require a more current Flutter version, e.g. https://main-api.flutter.dev/flutter/material/TextButton-class.html
2024-02-29 19:08:25 +00:00
Andrew Kolos
295a9a2031
provide command to FakeCommand::onRun (#142206)
Part of work on [#101077](https://github.com/flutter/flutter/pull/141194). This is done as a separate PR to avoid a massive diff.

## Context
1. The `FakeCommand` class accepts a list of patterns that's used to match a command given to its `FakeProcessManager`. Since `FakeCommand` can match a list of patterns, not just specifically strings, it can be used to match commands where the exact value of some arguments can't (easily) known ahead of time. For example, a part of the tool may invoke a command with an argument that is the path of a temporarily file that has a randomly-generated basename.
2. The `FakeCommand` class provides on `onRun` parameter, which is a callback that is run when the `FakeProcessManager` runs a command that matches the `FakeCommand` in question.

## Issue
In the event that a `FakeCommand` is constructed using patterns, the test code can't know the exact values used for arguments in the command. This PR proposes changing the type of `onRun` from `VoidCallback?` to `void Function(List<String>)?`. When run, the value `List<String>` parameter will be the full command that the `FakeCommand` matched.

Example:
```dart
FakeCommand(
  command: <Pattern>[
    artifacts.getArtifactPath(Artifact.engineDartBinary),
    'run',
    'vector_graphics_compiler',
    RegExp(r'--input=/.*\.temp'),
    RegExp(r'--output=/.*\.temp'),
  ],
  onRun: (List<String> command) {
    final outputPath = (() { 
      // code to parse `--output` from `command`
    })();
    testFileSystem.file(outputPath).createSync(recursive: true);
  },
)
```
2024-01-25 07:51:25 +00:00
Christopher Fujino
4dcd1598b7
update analytics in generate api docs site to use new UA4 (#136497)
Change the analytics instance that the generated api.flutter.dev and master-api.flutter.dev use.
2023-10-16 19:47:48 +00:00
Christopher Fujino
c353e641ad
run tests under dev/tools as part of framework-misc and get them passing (#136501)
part of https://github.com/flutter/flutter/issues/136500

this should not affect any production code, it merely runs the tests on CI and makes the changes needed to get them passing.
2023-10-13 18:48:43 +00:00
Greg Spencer
5bd8579bc8
Use flutter pub get instead of dart pub get in create_api_docs.dart (#133493) 2023-08-28 16:12:16 -07:00
Zachary Anderson
d5a162b788
Forward port API docs creation realm handling from prior script (#132867)
It looks like the logic added here:


https://github.com/flutter/flutter/pull/131951/files#diff-297ee4cfe6d9bffc2fa1376918a50b8e4165ada4569575880c40811b6f749265R18

got dropped in the refactor here:

https://github.com/flutter/flutter/pull/132710
2023-08-18 15:33:27 -07:00
Greg Spencer
ced3e76626
Reland: "Reorganize and clarify API doc generator" (#132353) (#132710)
## 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
 - https://flutter-review.googlesource.com/c/recipes/+/49580
2023-08-17 23:53:06 +00:00
Jonah Williams
909400dc4d
Revert "Reorganize and clarify API doc generator" (#132613)
Reverts flutter/flutter#132353

Educated guess that this is causing the docs failures: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8772644466113801713/+/u/Docs/Deploy_docs/Firebase_deploy/stdout
2023-08-16 02:47:26 +00:00
Greg Spencer
899a29f830
Reorganize and clarify API doc generator (#132353)
## Description

This cleans up a lot of issues with the API doc generation.

Here are the main changes:
 - Rename `dartdoc.dart` to `create_api_docs.dart`
 - Move the bulk of the operations out of `dev/bots/docs.sh` into `create_api_docs.dart`.
 - Delete `dashing_postprocess.dart` and `java_and_objc.dart` and incorporate those operations into `create_api_docs.dart`.
 - Refactor the doc generation into more understandable classes
 - Bump the snippets tool version to 0.4.0 (the latest one)
 - Centralize the information gathering about the Flutter repo into the new `FlutterInformation` class.
 - Clean up the directory handling, and convert to using the `file` package for all file and directory paths.
 - Add an `--output` option to docs.sh that specifies the location of the output ZIP file containing the docs.
   - Defaults to placing the output in `dev/docs/api_docs.zip` (i.e. where the previous code generates the file).
 - Moved all document generation into a temporary folder that is removed once the documents are generated, to avoid VSCode and other IDEs trying to index the thousands of HTML and JS files in the docs output.
 - Updated pubspec dependencies.

## Tests
 - Added tests for doc generation.
2023-08-15 22:12:16 +00:00