I wonder if I can make it with SPM easily (out of the box or extended with custom code). I want to generate Swift sources from templates in a web app project. There would be a special target that encapsulates this step. Template files are compiled with a 3rd party tool into a temporary folder probably under .build folder and they will take part of the whole build process.
In my case template files are HTML fragments and 3rd compiler turns them to renderer functions (like JSP -> Java servlet).
Before I dig deep into SPM source I ask the community if it is feasible or forget SPM and do the pre-compilation step via scripting.