build
build copied to clipboard
Can two builders from the same package share options?
A common pattern with code-generators is to define project-level configurations in the build.yaml.
At the same time, an implementation detail of some code-generators may be to split their generation in multiple builders.
In that scenario, it is possible to have all builders use the same options without having to duplicate the configuration?
What I'd like to avoid:
targets:
$default:
builders:
my_generator|a:
options:
my_option: true
my_generator|b:
options:
my_option: true
What I'd like:
targets:
$default:
builders:
my_generator: # no builder name specified, all builders use the same option
options:
my_option: true
That's certainly something I can look at.
What are the advantages of using multiple builders vs just bundling everything as a single builder?
Thanks.
That's certainly something I can look at.
What are the advantages of using multiple builders vs just bundling everything as a single builder?
Thanks.
Nice example of multiple builders is Drift and its different strategies for code generation https://drift.simonbinder.eu/generation_options/modular/?h=modular
@davidmorgan They share user-defined options, but their configuration is different
Like one builder could use SharedPartBuilder and another uses LibraryBuilder, but both are configured using the same options.