Currently, the OMS CAL includes tests & examples in the generated code. I don’t know the specifics for OMS, whether this is required for a complete OMS CAL or if it’s just something Tangram decided to do. However, the same doesn’t exist for LMCP at least, and probably not STANAG either.
This topic begs the question “Should we deliver code examples”, and my answer is of course “yes”.
But where should that happen?
To a brand-new user of Tangram or of a particular CSI, the first thing they’ll probably do is look at the generated code. For that user, having examples built-in (like OMS), as well as a solid README, is probably a must-have.
For a user ready to generate production code, there’s no reason to include extra code or other files in the generated output.
It’s also certainly possible that we could provide some obvious pointers to the user, directing them to a different section of the site which provides downloads for example code.
My personal opinion is that we should build in a code-gen flag for example/test components, and have that option exposed to the user as a plugin option. The option defaults to true, so the new user sees what they need to see when they download code. The experienced user can just uncheck the box when they’re ready. I prefer this to having examples downloaded in a different place, because it reduces complexity and allows examples/tests to more easily link with the generated code & libs.
What are your thoughts? Is there a better way? Is the overarching question misguided?