StringTemplate.MSBuild is a MSBuild extension that renders StringTemplate4 templates before compilation. It is recommend you read the ST4 documentation here.
The first step in the process of creating a renderable template is creating a template group. Please note that single template files (.st
) support is currently planned and not implemented. Template groups are pretty cool, they let you define templates to your heart's content while providing a sense of structure. Some features I highly recommend you look at are regions and group inheritance. Letting StringTemplate.MSBuild know what templates to render is pretty simple. The only requirements are a defined render
template within the group accompanied with an ouput file extension. Providing the file extension is best explained using the following examples C#: DbInterface.cs.stg
python: messages.py.stg
text: imrunningoutofideas.txt.stg
.
If you want to see a project that utilizes StringTemplate.MSBuild, I highly recommend you look at Krypton.LibProtocol. The C# target utilizes templates to render a set of structs that share a common set of interfaces.
.st
file support.- Configurable output directories. (as of now rendered files are plopped in the same directory as their template)