@@ -305,7 +305,7 @@ Future<void> runDoc(ArgResults commandResults) async {
305
305
}
306
306
307
307
Future <void > docFlutter ({bool withStats = false }) async {
308
- print ('building flutter docs into: $flutterDir ' );
308
+ print ('building flutter docs into: ${ flutterDir . path } ' );
309
309
var env = createThrowawayPubCache ();
310
310
await _docFlutter (
311
311
flutterPath: flutterDir.path,
@@ -325,17 +325,20 @@ Future<Iterable<Map<String, Object?>>> _docFlutter({
325
325
}) async {
326
326
var flutterRepo = await FlutterRepo .copyFromExistingFlutterRepo (
327
327
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
+ );
336
338
await flutterRepo.launcher.runStreamed (
337
339
flutterRepo.dartCmd,
338
- ['pub' , 'global' , 'activate' , 'snippets' , '0.4.3' ],
340
+ ['compile' , 'exe' , '-o' , '$snippetsOutPath /snippets' , 'bin/snippets.dart' ],
341
+ workingDirectory: path.join (snippetsPath),
339
342
);
340
343
// TODO(jcollins-g): flutter's dart SDK pub tries to precompile the universe
341
344
// when using -spath. Why?
0 commit comments