Reduce the amount of Snap-specific code requires to set up Flutter #3292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2853.
@MarcusTomlinson FYI - this is to remove a lot of the snap-specific code that should no longer be required (canonical/flutter-snap#8).
There is still a little code to detect where a user has never invoked
flutter
so it hasn't been initialised, which is in the block here:https://github.com/Dart-Code/Dart-Code/pull/3292/files?diff=split&w=1#diff-a4ef2b6ac3b51b2727e1fdae4a827f588e33df8c71bbad63fde3b96a92b5bfd1R265
It detects when no Flutter SDK is found, but there is a
flutter
binary that is a symlink to the Snap binary (it seems like this is created by Snap initially, so that the first run offlutter
will trigger the initialisation), forces initialisation, and then re-searches for the SDK (since after initialisation, there is a newflutter
binary onPATH
that is a real SDK - the original Snap-symlink seems to remain, further down thePATH
).Unless you have any objections, I'll merge this early next week. The tests that confirm it's located and initialised are still green when they ran on this branch.