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
This commit is contained in:
parent
1349c591cc
commit
b099bf0b4c
@ -116,7 +116,7 @@ function generate_docs() {
|
|||||||
# Install and activate the snippets tool, which resides in the
|
# Install and activate the snippets tool, which resides in the
|
||||||
# assets-for-api-docs repo:
|
# assets-for-api-docs repo:
|
||||||
# https://github.com/flutter/assets-for-api-docs/tree/master/packages/snippets
|
# 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
|
# This script generates a unified doc set, and creates
|
||||||
# a custom index.html, placing everything into DOC_DIR.
|
# a custom index.html, placing everything into DOC_DIR.
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<iframe class="snippet-dartpad"
|
<iframe class="snippet-dartpad"
|
||||||
src="https://dartpad.dev/embed-flutter.html?split=60&run=true&sample_id={{id}}&channel={{channel}}">
|
src="https://dartpad.dev/embed-flutter.html?split=60&run=true&sample_id={{id}}&sample_channel={{channel}}&channel={{channel}}">
|
||||||
</iframe>
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
{@end-inject-html}
|
{@end-inject-html}
|
@ -742,13 +742,14 @@ class DartdocGenerator {
|
|||||||
|
|
||||||
// Check a "dartpad" example, any one will do, and check for the correct URL
|
// Check a "dartpad" example, any one will do, and check for the correct URL
|
||||||
// arguments.
|
// 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? 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<String> argumentRegExps = <String>[
|
final List<String> argumentRegExps = <String>[
|
||||||
r'split=\d+',
|
r'split=\d+',
|
||||||
r'run=true',
|
r'run=true',
|
||||||
r'sample_id=widgets\.Listener\.\d+',
|
r'sample_id=widgets\.Listener\.\d+',
|
||||||
|
'sample_channel=$expectedBranch',
|
||||||
'channel=$expectedBranch',
|
'channel=$expectedBranch',
|
||||||
];
|
];
|
||||||
for (final String argumentRegExp in argumentRegExps) {
|
for (final String argumentRegExp in argumentRegExps) {
|
||||||
|
@ -441,7 +441,7 @@ void main() {
|
|||||||
</code>
|
</code>
|
||||||
</pre>
|
</pre>
|
||||||
''');
|
''');
|
||||||
const String queryParams = 'split=1&run=true&sample_id=widgets.Listener.123&channel=main';
|
const String queryParams = 'split=1&run=true&sample_id=widgets.Listener.123&sample_channel=master&channel=master';
|
||||||
widgetsDir.childFile('Listener-class.html').writeAsStringSync('''
|
widgetsDir.childFile('Listener-class.html').writeAsStringSync('''
|
||||||
<iframe class="snippet-dartpad" src="https://dartpad.dev/embed-flutter.html?$queryParams">
|
<iframe class="snippet-dartpad" src="https://dartpad.dev/embed-flutter.html?$queryParams">
|
||||||
</iframe>
|
</iframe>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user