[
+ '/flutter/bin/flutter',
+ 'pub',
+ 'global',
+ 'run',
+ '--enable-asserts',
+ 'dartdoc',
+ '--output',
+ '/path/to/publish/flutter',
+ '--allow-tools',
+ '--json',
+ '--validate-links',
+ '--link-to-source-excludes',
+ '/flutter/bin/cache',
+ '--link-to-source-root',
+ '/flutter',
+ '--link-to-source-uri-template',
+ 'https://github.com/flutter/flutter/blob/master/%f%#L%l%',
+ '--inject-html',
+ '--use-base-href',
+ '--header',
+ '/path/to/docs/styles.html',
+ '--header',
+ '/path/to/docs/analytics-header.html',
+ '--header',
+ '/path/to/docs/survey.html',
+ '--header',
+ '/path/to/docs/snippets.html',
+ '--header',
+ '/path/to/docs/opensearch.html',
+ '--footer',
+ '/path/to/docs/analytics-footer.html',
+ '--footer-text',
+ '/path/to/package/footer.html',
+ '--allow-warnings-in-packages',
+ // match package names
+ RegExp(r'^(\w+,)+(\w+)$'),
+ '--exclude-packages',
+ RegExp(r'^(\w+,)+(\w+)$'),
+ '--exclude',
+ // match dart package URIs
+ RegExp(r'^([\w\/:.]+,)+([\w\/:.]+)$'),
+ '--favicon',
+ '/path/to/docs/favicon.ico',
+ '--package-order',
+ 'flutter,Dart,${apidocs.kPlatformIntegrationPackageName},flutter_test,flutter_driver',
+ '--auto-include-dependencies',
+ ],
+ onRun: () {
+ for (final File canary in generator.canaries) {
+ canary.createSync(recursive: true);
+ }
+ for (final String path in dartdocDirectiveCanaryFiles) {
+ publishRoot.childDirectory('flutter').childFile(path).createSync(recursive: true);
+ }
+ for (final String path in dartdocDirectiveCanaryLibraries) {
+ publishRoot.childDirectory('flutter').childDirectory(path).createSync(recursive: true);
+ }
+ publishRoot.childDirectory('flutter').childFile('index.html').createSync();
+
+ final Directory widgetsDir = publishRoot
+ .childDirectory('flutter')
+ .childDirectory('widgets')
+ ..createSync(recursive: true);
+ widgetsDir.childFile('showGeneralDialog.html').writeAsStringSync('''
+
+
+ import 'package:flutter/material.dart';
+
+
+''',
+ );
+ expect(publishRoot.childDirectory('flutter').existsSync(), isTrue);
+ (widgetsDir
+ .childDirectory('ModalRoute')
+ ..createSync(recursive: true))
+ .childFile('barrierColor.html')
+ .writeAsStringSync('''
+
+
+ class FooClass {
+ Color get barrierColor => FooColor();
+ }
+
+
+''');
+ const String queryParams = 'split=1&run=true&sample_id=widgets.Listener.123&sample_channel=master&channel=master';
+ widgetsDir.childFile('Listener-class.html').writeAsStringSync('''
+
+''');
+ }
+ ),
+ ]);
+
+ await generator.generateDartdoc();
+ });
+ });
}
const String branchName = 'stable';