How do a BuildToolPlugin source to source transformation?

Same as here: BuildToolPlugin: How to explicitly define template files in package manifest?. The .swift input file can be defined within createBuildCommands.