Closed cybrox closed 1 year ago
:+1: I'll get the checks passing tomorrow
I think it would be better to add a FLUTTER_ROOT
environment in distribute_options.yaml to specify the flutter path.
env:
+ FLUTTER_ROOT: /Users/lijy91/fvm/default
# PGYER_API_KEY: your api key
output: dist/
releases:
- name: dev
jobs:
- name: android-aab
+ env:
+ FLUTTER_ROOT: /Users/lijy91/fvm/versions/3.3.10
package:
platform: android
target: aab
build_args:
profile: true
target-platform: android-arm,android-arm64
dart-define:
APP_ENV: dev
- name: android-apk
+ env:
+ FLUTTER_ROOT: /Users/lijy91/fvm/versions/3.7.3
package:
platform: android
target: apk
build_args:
# profile: true
target-platform: android-arm,android-arm64
dart-define:
APP_ENV: dev
That's a good idea. I think we should support DART_PATH
as well, since flutter_distributor
uses the Dart command for auto-updating and it might be managed by a version manager as well.
The flutter
and dart
commands are currently used in 3 packages (flutter_app_builder
, flutter_app_packager
, app_package_publisher
). Would you add this in all of these packages separately or to shell_executor
directly?
I think it would also be a good idea to add options to override other commands, e.g.: xcrun
Thanks for the input @ahmednfwela! I "feared" as soon as we add custom flutter/dart paths, there will be need for changing other binary paths as well.
@lijy91 What do you think about supporting FLUTTER_ROOT
and DART_ROOT
from the distribute_options.yaml
, which should suffice for >90% of users and keeping this solution for advanced use-cases?
This would provide an easy solution for most users but we could still have a small hint in the docs for advanced customization for those who really need it.
I'm working on a refactor to support this feature, you can follow it on the develop branch.
This is a suggestion to solve this issue by allowing users to overwrite executables in
shell_executor
from the environment.In short:
Set
SHELL_EXECUTOR_..._COMMAND
to overwrite the executable for a command. E.g.SHELL_EXECUTOR_FLUTTER_COMMAND=/usr/bin/flutter2
Example when using with
flutter_distributor
: