I'm using a code generator which has the following workflow:
- Configure stuff
- Generate code
- Modify generated code with user code at specifically annotated positions.
If changes are required to the configuration, the user code will remain after generating the code again because the annotated positions are untouched by the code generator.
My problem is, how do I properly put this into version control and into a build process?
Put configuration and generated code with user changes into version control. This is the easiest to integrate with the current build tools. However, the configuration and generated code might diverge. To mitigate that, the build process might generate the code again and verify that it's the same as the committed code.
Put just configuration and user changes into version control. This way, no generated files are stored in version control. The user code should then somehow be developed separately and automatically integrated into the generated code later.
For the curious, the code generator is Dave 2, although it's not really relevant for the question.
In my opinion, this question is ontopic, because it is about using a Tool in a Software Development Workflow.