Move snippets package back into flutter repo (#147690)
## Description This moves the snippets package back into the Flutter repo so that API documentation generation can happen without the use of `dart pub global run` because `pub run` doesn't handle concurrency well. The change modifies the dartdoc building process to include building an executable from the snippets tool and installing that in the cache directory for use during docs generation. The snippets tool will reside in dev/snippets, where it originally resided before being moved to https://github.com/flutter/assets-for-api-docs. The snippets code itself is unchanged from the code that is in https://github.com/flutter/assets-for-api-docs/packages/snippets. ## Related Issues - https://github.com/flutter/flutter/issues/144408 - https://github.com/flutter/flutter/issues/147609 - https://github.com/flutter/flutter/pull/147645 ## Tests - Added snippets tests to the overall testing build.
This commit is contained in:
@@ -521,8 +521,8 @@ class DartdocGenerator {
|
||||
|
||||
final Version version = FlutterInformation.instance.getFlutterVersion();
|
||||
|
||||
// Verify which version of snippets and dartdoc we're using.
|
||||
final ProcessResult snippetsResult = processManager.runSync(
|
||||
// Verify which version of the global activated packages we're using.
|
||||
final ProcessResult versionResults = processManager.runSync(
|
||||
<String>[
|
||||
FlutterInformation.instance.getFlutterBinaryPath().path,
|
||||
'pub',
|
||||
@@ -535,8 +535,8 @@ class DartdocGenerator {
|
||||
);
|
||||
print('');
|
||||
final Iterable<RegExpMatch> versionMatches =
|
||||
RegExp(r'^(?<name>snippets|dartdoc) (?<version>[^\s]+)', multiLine: true)
|
||||
.allMatches(snippetsResult.stdout as String);
|
||||
RegExp(r'^(?<name>dartdoc) (?<version>[^\s]+)', multiLine: true)
|
||||
.allMatches(versionResults.stdout as String);
|
||||
for (final RegExpMatch match in versionMatches) {
|
||||
print('${match.namedGroup('name')} version: ${match.namedGroup('version')}');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user