-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to inject a bootstrap script #66897
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be tested in packages/flutter_tools/test/integration.shard/command_output_test.dart
Create a test that write a bootstrap file that echos something, run flutter
and then asset that the echo is in the stdout. For example
testWithoutContext('will load bootstrap script before starting', () async {
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
final File bootstrap = fileSystem.file(
fileSystem.path.join(
getFlutterRoot(),
'bin',
'internal',
platform.isWindows ? 'boostrap.bat' : 'bootstap',
));
// Something different per platform., make it executable.
bootstrap.writeAsStringSync('contents');
final ProcessResult result = await processManager.run(<String>[
flutterBin,
...getLocalEngineArguments(),
]);
// Development tools.
expect(result.stdout, contains(''));
});
(Also make sure to delete the bootstrap after the test is done in a finally block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test @MarcusTomlinson !
LGTM
👍 thanks for the contribution - great to see this land! |
Description
This PR adds the ability to inject a custom bootstrap script on Mac, Linux (via
bin/internal/bootstrap.sh
), and Windows (viabin/internal/bootstrap.bat
).The primary purpose for this change is to enable wider IDE support for the flutter snap on Linux by having the snap inject a bootstrap script that sets up the environment required to ensure its build dependancies can be found (See issues linked below).
Related Issues
Resolves: #66414
Resolves: flutter/flutter-intellij#4746
Resolves: canonical/flutter-snap#8
Tests
Added 'will load bootstrap script before starting' test to
command_output_test.dart
.Checklist
///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.