Acorn
Acorn is a simple file tree template engine inspired by lazybones project.
The Acorn lets you create archetypes for any kind of project or file structures.
Getting Started
The Acorn has two version: Groovy (Java) library and CLI for it.
Get library from Maven Central Repo
CLI App can be downloaded from GitHub Release page
Features
Content parametrisation
Replace placeholders with given data
simple.txt.tmpl
Dear ${user}. You have ${count} thing${count > 1 ? 's' : ''} in your cart.
Total price is \$${totalPrice}
Template scripting
You can use groovy for scripting inside file templates because they are GStringTemplateEngine
advanced.txt.tmpl
Dear <%= user%>. You have <% out << count %> thing<%
if (count > 1) {
out << 's'
}
%> in your cart.
Total price is \$${totalPrice}
File name parametrisation
Placeholders can be used in plain file and template names
./src
└── ${nameVar}-file.txt
└── ${nameVar}.txt.tmpl
Generate folder path with placeholders
You can generate nested hierarchy by templating folder names
./src
├── ${emptyValue}
│ └── file-in-root.txt
├── ${folderVar}
│ └── nested-file.txt
└── ${nameVar}-file.txt
params: [nameVar: 'named', folderVar: 'one/two/three', emptyValue: '']
./dest
├── file-in-root.txt
├── named-file.txt
└── one
└── two
└── three
└── nested-file.txt