Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flutter CI with re-internalized snippets tool #3776

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions tool/task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ Future<void> runDoc(ArgResults commandResults) async {
}

Future<void> docFlutter({bool withStats = false}) async {
print('building flutter docs into: $flutterDir');
print('building flutter docs into: ${flutterDir.path}');
var env = createThrowawayPubCache();
await _docFlutter(
flutterPath: flutterDir.path,
Expand All @@ -325,17 +325,20 @@ Future<Iterable<Map<String, Object?>>> _docFlutter({
}) async {
var flutterRepo = await FlutterRepo.copyFromExistingFlutterRepo(
await cleanFlutterRepo, flutterPath, env, label);
try {
await flutterRepo.launcher.runStreamed(
flutterRepo.dartCmd,
['pub', 'global', 'deactivate', 'snippets'],
);
} on SubprocessException {
// Ignore failure to deactivate so this works on completely clean bots.
}
var snippetsPath = path.join(flutterPath, 'dev', 'snippets');
var snippetsOutPath =
path.join(flutterPath, 'bin', 'cache', 'artifacts', 'snippets');
print('building snippets tool executable...');
Directory(snippetsOutPath).createSync(recursive: true);
await flutterRepo.launcher.runStreamed(
flutterRepo.flutterCmd,
['pub', 'get'],
workingDirectory: path.join(snippetsPath),
);
await flutterRepo.launcher.runStreamed(
flutterRepo.dartCmd,
['pub', 'global', 'activate', 'snippets', '0.4.3'],
['compile', 'exe', '-o', '$snippetsOutPath/snippets', 'bin/snippets.dart'],
workingDirectory: path.join(snippetsPath),
);
// TODO(jcollins-g): flutter's dart SDK pub tries to precompile the universe
// when using -spath. Why?
Expand Down