cool-easter-32542
05/31/2024, 2:29 PMgenerated_target_cls. It is even used here and a few other places to generate a _generator_sources_helper target. However, certain features such as __defaults__ and maybe parametrize are limited to a single target type based on the code here.
Describe the solution you'd like
Fully supporting target generators generating multiple different target types that are defaults-compatible.
Describe alternatives you've considered
One alternate solution that I'm not positive would work is using a base target generator to generate additional target generators that each generate targets of a single type. However, this feels like a hack given that multi-type target generators are already in use in pants core code.
Additional context
This is part of the open-source pants dbt backend plugin I am creating. Originally I had separate target generators for each component of a dbt project (models, macros, tests, etc). However, given that dbt already enforces a project structure defined in its root project file dbt_project.yml I think an even better solution would be just to have a single dbt_project target generator that generates all of the targets downstream.
pantsbuild/pants