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

Use build runner from source instead of calling it via a subprocess #17

Open
sbordeyne opened this issue Jan 19, 2024 · 0 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@sbordeyne
Copy link

The current implementation relies on flutter being in the path. This is an issue since there might be constraints where flutter cannot be found.

final process = Process.runSync(
'flutter',
[
'pub',
'run',
'build_runner',
'build',
'--build-filter',
_getBuildFilterList(files),
'--delete-conflicting-outputs'
],
workingDirectory: Utils.projectDirectory,
);

This also means that this package is flutter specific. Though that is the most notable use of dart, the language starts being used in the backend as well (serverpod for instance) and that also implies code gen sometimes.

Using dart run instead of flutter pub run would be a good temp fix, but the long term solution would be to import the build_runner package and use its library of functions as much as possible to perform the code gen instead of calling it in a subprocess.

This also would remove the need to specify build_runner as a dependency explicitely in the pubspec of the packages to build.

@tenhobi tenhobi added the enhancement New feature or request label Jan 19, 2024
@tenhobi tenhobi added this to the v2 milestone Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants