Skip to content

[native_assets_cli] Expose flavor #1359

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

Open
HosseinYousefi opened this issue Jul 19, 2024 · 4 comments
Open

[native_assets_cli] Expose flavor #1359

HosseinYousefi opened this issue Jul 19, 2024 · 4 comments

Comments

@HosseinYousefi
Copy link
Member

HosseinYousefi commented Jul 19, 2024

Flutter applications can have different flavors like: staging/prod, or free/premium: https://docs.flutter.dev/deployment/flavors

It also supports conditionally bundling assets based on the specified flavor. We should support the same by exposing the flavor in the hooks.

@dcharkes

@dcharkes
Copy link
Collaborator

And flavor can influence what assets are build?

Flavor is a single string argument?

@dcharkes dcharkes added this to the Native Assets v1.x milestone Aug 30, 2024
@dcharkes dcharkes changed the title Expose flavor [native_assets_cli] Expose flavor Aug 30, 2024
@mkustermann
Copy link
Member

Flutter applications can have different flavors like: staging/prod, or free/premium:
...
Then it must be part of the HookConfig and introduce a different build directory.

If "flavors" are a flutter specific concept then we may not want to make it part of the core build/link infrastructure. A great opportunity to start modularizing the build infrastructure!

flutter build / flutter run could provide a extension to the build/link APIs e.g. via extension methods on BuildConfig that expose a FlutterBuildConfig object.

@dcharkes
Copy link
Collaborator

dcharkes commented Sep 3, 2024

A great opportunity to start modularizing the build infrastructure!

I can see the argument of why we not only want to make the asset types extensible. 🤓

If "flavors" are a flutter specific concept then we may not want to make it part of the core build/link infrastructure. A great opportunity to start modularizing the build infrastructure!

That modularity would only work for the build hook of the root package (a flutter app). Presumably the dependencies should be packages that work in Dart standalone. We could conceivably optionally depend in the Dart standalone packages if the package:flutter_hook does not depend on the Flutter SDK itself. Conditional import style. (But I believe conditional build hooks is an anti pattern.)

@mkustermann
Copy link
Member

mkustermann commented Sep 3, 2024

That modularity would only work for the build hook of the root package (a flutter app). Presumably the dependencies should be packages that work in Dart standalone. We could conceivably optionally depend in the Dart standalone packages if the package:flutter_hook does not depend on the Flutter SDK itself. Conditional import style. (But I believe conditional build hooks is an anti pattern.)

It's not about root package. Any package that is flutter specific (e.g. flutter plugin package) may want to use flutter-specific features of the build system (e.g. bundle proguard rules, java code, rely on flutter-specific configuration - be it "flavor"s or gradle versions etc)

Yes if a package wants to be independent of flutter, then it shouldn't require flutter configs / asset types to be available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants