This is just integrated codegen into the build tool, right? Datadog has a similar project here https://github.com/DataDog/orchestrion that does the same thing.
I think this kind of code gen is very wonky, and hard to debug unless there is some official API support for it. Using a sufficiently advanced build tool to handle this in a separate build step would help as well. But that usually causes problems with IDE support.