Skip to content
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

[assets] The asset builder system should compile hook/{build,link}.dart once. #1578

Open
mkustermann opened this issue Sep 18, 2024 · 0 comments

Comments

@mkustermann
Copy link
Member

It seems a flutter build apk --release will compile the hook/build.dart script 3 times. Though a hook/build.dart compiled to build.dill doesn't depend on the build config and therefore shouldn't be in the build-config specific folder.

These are two separate concepts:

  • Caching of kernels of dart scripts to make hook invocations faster
  • Running build/link hooks with different build configurations

One could even argue that the native asset builder system should use dart run to invoke hooks (as the hook source code may transitively use assets on it's own) and the dart run tool should be responsible for optimizing repeated runs of the same script with same Dart SDK version.

But if we do it ourselves - we should avoid compiling it several times and putting it in a location that cannot be shared across runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant