From 6701bbc528f5901d747256cea51fa5daefa48829 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 21 Mar 2019 16:13:04 -0700 Subject: [PATCH] update fuchsia-attach (#29764) --- packages/flutter_tools/bin/fuchsia_attach.dart | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/bin/fuchsia_attach.dart b/packages/flutter_tools/bin/fuchsia_attach.dart index b752efccb28..97e14b7b1f1 100644 --- a/packages/flutter_tools/bin/fuchsia_attach.dart +++ b/packages/flutter_tools/bin/fuchsia_attach.dart @@ -23,6 +23,7 @@ final ArgParser parser = ArgParser() ..addOption('target', help: 'The GN target to attach to') ..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 dev_finder binary') ..addFlag('verbose', negatable: true); // Track the original working directory so that the tool can find the @@ -40,7 +41,7 @@ Future main(List args) async { final String buildDirectory = argResults['build-dir']; final File frontendServer = fs.file('$buildDirectory/host_x64/gen/third_party/flutter/frontend_server/frontend_server_tool.snapshot'); final File sshConfig = fs.file('$buildDirectory/ssh-keys/ssh_config'); - final File devFinder = fs.file('$buildDirectory/host_x64/dev_finder'); + final File devFinder = fs.file(argResults['dev-finder']); final File platformKernelDill = fs.file('$buildDirectory/flutter_runner_patched_sdk/platform_strong.dill'); final File flutterPatchedSdk = fs.file('$buildDirectory/flutter_runner_patched_sdk'); final String packages = '$buildDirectory/dartlang/gen/$path/${name}_dart_library.packages'; @@ -51,6 +52,19 @@ Future main(List args) async { originalWorkingDirectory = fs.currentDirectory.path; fs.currentDirectory = path; + if (!devFinder.existsSync()) { + print('Error: dev_finder not found at ${devFinder.path}.'); + return 1; + } + if (!frontendServer.existsSync()) { + print( + 'Error: frontend_server not found at ${frontendServer.path}. This ' + 'Usually means you ran fx set without specifying ' + '--args=flutter_profile=true.' + ); + return 1; + } + // Check for a package with a lib directory. final String entrypoint = argResults['entrypoint']; String targetFile = 'lib/$entrypoint';