[fuchsia] - migrate devicer discovery workflows to use ffx (#76241)

This commit is contained in:
omerlevran46
2021-03-01 13:16:13 -08:00
committed by GitHub
parent 54455c706d
commit f996033fcc
12 changed files with 483 additions and 54 deletions

View File

@@ -30,6 +30,7 @@ final ArgParser parser = ArgParser()
..addOption('entrypoint', defaultsTo: 'main.dart', help: 'The filename of the main method. Defaults to main.dart')
..addOption('device', help: 'The device id to attach to')
..addOption('dev-finder', help: 'The location of the device-finder binary')
..addOption('ffx', help: 'The location of the ffx binary')
..addFlag('verbose', negatable: true);
// Track the original working directory so that the tool can find the
@@ -48,6 +49,7 @@ Future<void> main(List<String> args) async {
final File frontendServer = globals.fs.file('$buildDirectory/host_x64/gen/third_party/flutter/frontend_server/frontend_server_tool.snapshot');
final File sshConfig = globals.fs.file('$buildDirectory/ssh-keys/ssh_config');
final File devFinder = globals.fs.file(argResults['dev-finder']);
final File ffx = globals.fs.file(argResults['ffx']);
final File platformKernelDill = globals.fs.file('$buildDirectory/flutter_runner_patched_sdk/platform_strong.dill');
final File flutterPatchedSdk = globals.fs.file('$buildDirectory/flutter_runner_patched_sdk');
final String packages = '$buildDirectory/dartlang/gen/$path/${name}_dart_library.packages';
@@ -62,6 +64,10 @@ Future<void> main(List<String> args) async {
print('Error: device-finder not found at ${devFinder.path}.');
return 1;
}
if (!ffx.existsSync()) {
print('Error: ffx not found at ${ffx.path}.');
return 1;
}
if (!frontendServer.existsSync()) {
print(
'Error: frontend_server not found at ${frontendServer.path}. This '
@@ -107,7 +113,8 @@ Future<void> main(List<String> args) async {
overrides: <Type, Generator>{
FeatureFlags: () => const _FuchsiaFeatureFlags(),
DeviceManager: () => _FuchsiaDeviceManager(),
FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig, devFinder: devFinder),
FuchsiaArtifacts: () => FuchsiaArtifacts(
sshConfig: sshConfig, devFinder: devFinder, ffx: ffx),
Artifacts: () => OverrideArtifacts(
parent: CachedArtifacts(
fileSystem: globals.fs,