mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
update fuchsia-attach (#29764)
This commit is contained in:
parent
40cbdd11cd
commit
6701bbc528
@ -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<void> main(List<String> 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<void> main(List<String> 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';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user