fastlane-plugin-flutter
fastlane-plugin-flutter copied to clipboard
select flutter version
Hi,
Is there a way to select the Flutter Version which is used to build the Project?
In the flutter_bootstrap method is only a flutter_channel parameter available.
flutter_bootstrap(
flutter_channel: 'stable',
)
I would like to have something like in the Flutter-GithubAction. It could look like this:
flutter_bootstrap(
flutter_channel: 'any',
flutter_version: '1.20.2'
)
Thanks in advance.
Yes, that should be doable, but it's also a bit tricky because it would require detecting the OS and downloading specific archive from flutter website -- the trick is that this is undocumented behavior (while channel matching by branch is documented: https://flutter.dev/docs/get-started/install/linux#install-flutter-manually). I really like pinning Flutter version to each project via git submodules. This also makes it easy during development, since dev environment (VSCode or Android Studio) is guaranteed to use the same version as CI without further configuration. If that's something you'd be interested in, I can draft a short tutorial.
An alternative would be to install flutter stable and do flutter(args: ["downgrade", "1.2.3"]) but of course that's going to cost network and computing resources, so I'll keep this FR on my radar (no ETA but pull requests welcome). Thank you!
why does it depend on the OS?
what I saw, is that you checkout the git repo in the bootstrap method. So isn't it just adding the 'tagname' parameter? Something like git checkout v1.2.2?
sounds interesting with the project-based flutter versions like venv's in python. Would be great if you could do a short tutorial. I am definitely interested. Are you talking about fvm? Is your approach also working with fastlane?
yeah, I also found the downgrade argument, but as you said, it costs resources and hence not the optimal solution for CI. thank you for keeping it on your radar. I think I have to gain way more knowledge about fastlane and ruby first, before thinking about improving your plugin.
btw. I just ran fastlane locally and it updated my local flutter version to the latest stable version. is there a way to disable the upgrade to the latest stable if the flutter framework was already found?
thank you very much for your fast and valuable responses.