Skip to content

Parameterize source generators #399

@nafg

Description

@nafg

My use case: I have a BleepCodegenScript based on https://github.com/nafg/slick-additions?tab=readme-ov-file#slick-additions-codegen. But I want to generate different things in different modules. So I have in my bleep.yaml

    sourcegen:
      main: bookphone.scripts.SlickCodegen
      project: scripts

Ideally I should be able to include the same snippet in different modules but somehow provide different arguments to pass to them.

Other approaches are branching in the code generator based on the project, or using inheritance (or composition) to provide separate code generator entry point classes while still sharing most of the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions