Skip to content

The "templates" configuration file

srizzo edited this page Sep 13, 2010 · 4 revisions

The “templates” configuration file tells the plugin where each template will be generated.

Ex.:

#yourProject/generators/Your Generator/templates.ftl

templates/template1.txt.ftl=src/destination1.txt
templates/template2.txt.ftl=src/someFolder/destination2.txt

Each destination value will be processed by the template engine suggested by the templates file extension. So you can have dynamic destinations, based on generation params:

#yourProject/generators/Your Generator/templates.ftl

templates/template1.txt.ftl=src/${aDynamicDestination}/${someParam}.txt

If the destination is empty, the result will be displayed on the console. This is useful for small code snippets, or small xml configurations entries, which are supposed to be copy and pasted on an existing file.

Clone this wiki locally