[flutter_plugin_tools] Overhaul drive-examples (#4099)

Significantly restructures drive-examples:
- Migrates it to the new package-looping base command
- Enforces that only one platform is passed, since in practice multiple platforms never actually worked. (The logic is structured so that it will be easy to enable multi-platform if `flutter drive` gains multi-platform support.)
- Fixes the issue where `--ios` and `--android` were semi-broken, by doing explicit device targeting for them rather than relying on the default device being the right kind
- Extracts much of the logic to helpers so it's easier to understand the flow
- Removes support for a legacy integration test file structure that is no longer used
- Adds more test coverage; previously no failure cases were actually tested.

Fixes https://github.com/flutter/flutter/issues/85147
Part of https://github.com/flutter/flutter/issues/83413
This commit is contained in:
stuartmorgan
2021-06-30 12:16:46 -07:00
committed by GitHub
parent ec9233eb41
commit 92d6214984
4 changed files with 697 additions and 311 deletions

View File

@ -6,7 +6,6 @@ import 'dart:async';
import 'package:file/file.dart';
import 'package:path/path.dart' as p;
import 'package:platform/platform.dart';
import 'common/core.dart';
import 'common/package_looping_command.dart';
@ -151,8 +150,6 @@ class BuildExamplesCommand extends PackageLoopingCommand {
String flutterBuildType, {
List<String> extraBuildFlags = const <String>[],
}) async {
final String flutterCommand =
const LocalPlatform().isWindows ? 'flutter.bat' : 'flutter';
final String enableExperiment = getStringArg(kEnableExperiment);
final int exitCode = await processRunner.runAndStream(