From b099bf0b4cdecc215cd427f94120685c4e569fde Mon Sep 17 00:00:00 2001 From: "auto-submit[bot]" <98614782+auto-submit[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 21:57:18 +0000 Subject: [PATCH] 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 --- dev/bots/docs.sh | 2 +- dev/snippets/config/skeletons/dartpad-sample.html | 2 +- dev/tools/create_api_docs.dart | 5 +++-- dev/tools/test/create_api_docs_test.dart | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index 21fed4fd7ef..4b613da98f8 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -116,7 +116,7 @@ function generate_docs() { # Install and activate the snippets tool, which resides in the # assets-for-api-docs repo: # https://github.com/flutter/assets-for-api-docs/tree/master/packages/snippets - "$DART" pub global activate snippets 0.4.2 + "$DART" pub global activate snippets 0.4.0 # This script generates a unified doc set, and creates # a custom index.html, placing everything into DOC_DIR. diff --git a/dev/snippets/config/skeletons/dartpad-sample.html b/dev/snippets/config/skeletons/dartpad-sample.html index d8ce7cafd31..9afc6233d90 100644 --- a/dev/snippets/config/skeletons/dartpad-sample.html +++ b/dev/snippets/config/skeletons/dartpad-sample.html @@ -13,7 +13,7 @@
{@end-inject-html} \ No newline at end of file diff --git a/dev/tools/create_api_docs.dart b/dev/tools/create_api_docs.dart index 150204cc1aa..12c49deb7d6 100644 --- a/dev/tools/create_api_docs.dart +++ b/dev/tools/create_api_docs.dart @@ -742,13 +742,14 @@ class DartdocGenerator { // Check a "dartpad" example, any one will do, and check for the correct URL // arguments. - // Just use "main" for any branch other than the LUCI_BRANCH. + // Just use "master" for any branch other than the LUCI_BRANCH. final String? luciBranch = platform.environment['LUCI_BRANCH']?.trim(); - final String expectedBranch = luciBranch != null && luciBranch.isNotEmpty ? luciBranch : 'main'; + final String expectedBranch = luciBranch != null && luciBranch.isNotEmpty ? luciBranch : 'master'; final List