Unverified Commit 6701bbc5 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

update fuchsia-attach (#29764)

parent 40cbdd11
...@@ -23,6 +23,7 @@ final ArgParser parser = ArgParser() ...@@ -23,6 +23,7 @@ final ArgParser parser = ArgParser()
..addOption('target', help: 'The GN target to attach to') ..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('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('device', help: 'The device id to attach to')
..addOption('dev-finder', help: 'The location of the dev_finder binary')
..addFlag('verbose', negatable: true); ..addFlag('verbose', negatable: true);
// Track the original working directory so that the tool can find the // Track the original working directory so that the tool can find the
...@@ -40,7 +41,7 @@ Future<void> main(List<String> args) async { ...@@ -40,7 +41,7 @@ Future<void> main(List<String> args) async {
final String buildDirectory = argResults['build-dir']; 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 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 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 platformKernelDill = fs.file('$buildDirectory/flutter_runner_patched_sdk/platform_strong.dill');
final File flutterPatchedSdk = fs.file('$buildDirectory/flutter_runner_patched_sdk'); final File flutterPatchedSdk = fs.file('$buildDirectory/flutter_runner_patched_sdk');
final String packages = '$buildDirectory/dartlang/gen/$path/${name}_dart_library.packages'; final String packages = '$buildDirectory/dartlang/gen/$path/${name}_dart_library.packages';
...@@ -51,6 +52,19 @@ Future<void> main(List<String> args) async { ...@@ -51,6 +52,19 @@ Future<void> main(List<String> args) async {
originalWorkingDirectory = fs.currentDirectory.path; originalWorkingDirectory = fs.currentDirectory.path;
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. // Check for a package with a lib directory.
final String entrypoint = argResults['entrypoint']; final String entrypoint = argResults['entrypoint'];
String targetFile = 'lib/$entrypoint'; String targetFile = 'lib/$entrypoint';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment