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

[BUG] build.yaml configuration instead of pubspec.yaml #114

Closed
zs-dima opened this issue Jul 19, 2021 · 7 comments · Fixed by #555
Closed

[BUG] build.yaml configuration instead of pubspec.yaml #114

zs-dima opened this issue Jul 19, 2021 · 7 comments · Fixed by #555
Labels
contributions welcome Welcome contribute
Milestone

Comments

@zs-dima
Copy link

zs-dima commented Jul 19, 2021

build.yaml intended for generators configuration.
So could be nice to use build.yaml configuration instead of pubspec.yaml configuration.

Bad

pubspec.yaml

⭕️ Good

build.yaml
@lcdsmao
Copy link
Member

lcdsmao commented Jul 19, 2021

You can specify the yaml file via:

fluttergen -c path/to/your/yaml/flie.yaml

@zs-dima
Copy link
Author

zs-dima commented Jul 19, 2021

@lcdsmao here build_runner documentation

Builders are configured with a build.yaml

https://pub.dev/packages/build_runner

@lcdsmao
Copy link
Member

lcdsmao commented Jul 19, 2021

@zs-dima
What's your use case here?
Can you give some examples?

@zs-dima
Copy link
Author

zs-dima commented Jul 19, 2021

@lcdsmao I mean default way to configure builders libraries.

Here your documentation:

Configuration file

[FlutterGen] generates dart files based on the key flutter and flutter_gen of pubspec.yaml.
Default configuration can be found here.

# pubspec.yaml
# ...

flutter_gen:

but it have to be:

Configuration file

[FlutterGen] generates dart files based on the key flutter_gen of build.yaml.
Default configuration can be found here.

# build.yaml
# ...
    builders:
# ...
      flutter_gen:
# ...

@wasabeef wasabeef added the contributions welcome Welcome contribute label Jul 19, 2021
@noga-dev
Copy link

noga-dev commented Dec 14, 2022

@zs-dima What's your use case here? Can you give some examples?

I'm guessing to be able to aggregate all codegen builders in the same command via: flutter pub run build_runner watch --delete-conflicting-outputs rather than individually running flutter packages pub run build_runner build or fluttergen and other packages. Since in build.yaml you can specify the commands for each builder like:

targets:
  $default:
    builders:
      slang_build_runner:
        options:
      flutter_gen:
        options:
      etc....

@zs-dima
Copy link
Author

zs-dima commented Dec 14, 2022

@zs-dima What's your use case here? Can you give some examples?

I'm guessing to be able to aggregate all codegen builders in the same command via: flutter pub run build_runner watch --delete-conflicting-outputs rather than individually running flutter packages pub run build_runner build or fluttergen and other packages. Since in build.yaml you can specify the commands for each builder like:

targets:
  $default:
    builders:
      slang_build_runner:
        options:
      flutter_gen:
        options:
      etc....

To move builders configurations out of the pubspec.yaml

@mrverdant13
Copy link

Any plans to support this setup approach?

@AlexV525 AlexV525 added this to the 5.8.0 milestone Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions welcome Welcome contribute
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants