Skip to content

Commit 8be17e1

Browse files
committed
Fix flutter CI with re-internalized snippets tool (#3776)
1 parent dff86ed commit 8be17e1

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

tool/task.dart

+13-10
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ Future<void> runDoc(ArgResults commandResults) async {
305305
}
306306

307307
Future<void> docFlutter({bool withStats = false}) async {
308-
print('building flutter docs into: $flutterDir');
308+
print('building flutter docs into: ${flutterDir.path}');
309309
var env = createThrowawayPubCache();
310310
await _docFlutter(
311311
flutterPath: flutterDir.path,
@@ -325,17 +325,20 @@ Future<Iterable<Map<String, Object?>>> _docFlutter({
325325
}) async {
326326
var flutterRepo = await FlutterRepo.copyFromExistingFlutterRepo(
327327
await cleanFlutterRepo, flutterPath, env, label);
328-
try {
329-
await flutterRepo.launcher.runStreamed(
330-
flutterRepo.dartCmd,
331-
['pub', 'global', 'deactivate', 'snippets'],
332-
);
333-
} on SubprocessException {
334-
// Ignore failure to deactivate so this works on completely clean bots.
335-
}
328+
var snippetsPath = path.join(flutterPath, 'dev', 'snippets');
329+
var snippetsOutPath =
330+
path.join(flutterPath, 'bin', 'cache', 'artifacts', 'snippets');
331+
print('building snippets tool executable...');
332+
Directory(snippetsOutPath).createSync(recursive: true);
333+
await flutterRepo.launcher.runStreamed(
334+
flutterRepo.flutterCmd,
335+
['pub', 'get'],
336+
workingDirectory: path.join(snippetsPath),
337+
);
336338
await flutterRepo.launcher.runStreamed(
337339
flutterRepo.dartCmd,
338-
['pub', 'global', 'activate', 'snippets', '0.4.3'],
340+
['compile', 'exe', '-o', '$snippetsOutPath/snippets', 'bin/snippets.dart'],
341+
workingDirectory: path.join(snippetsPath),
339342
);
340343
// TODO(jcollins-g): flutter's dart SDK pub tries to precompile the universe
341344
// when using -spath. Why?

0 commit comments

Comments
 (0)