Archive

Posts Tagged ‘build’

Ant and template based generation.

August 27, 2008 raptros-v76 Leave a comment

Ant, the java based build system, is pretty cool. I’ve been working on a template based project setup system.
Here is how.

  • You’ll need a templates directory to keep all of the templates you want to generate
  • Put together a ant build xml file that has a task to make the directory structure
  • Now for the generation: use the Copy task to copy a template from the template directory to whatever file it should be in the project.
  • Put a filterset subtask inside the copy. For each token, represented by default as @TOKENNAME@ (in the template files), use a filter task (with token=”TOKENNAME” value=”whatever you want”) to replace @TOKENNAME@ with whatever you want to have in there, such as class names, etc.

There you go.

Categories: Uncategorized Tags: , ,