This is spooky. Matt Biddulph has just posted a template for Java projects which is basically a tar ball of a standard project directory structure and an Ant build script to go with it.
In my last couple of lunch hours, after updating eclectic I’ve been tinkering with something very similar which I’d nicknamed “project maker”. Basically its a little language for describing project structures. The language is implemented using XSLT.
This stylesheet generates an Ant project that (currently) contains two targets:
makeDirectories which builds the directory structure and
makeFiles which creates some basic files for the project. Both the directory structure, file location and default contents are described using an XML vocabulary.
Here’s an example “project maker” file, and the generated output.
You can arbitrarily nest the
dir elements to describe the directory structure, and can include
fileelements anywhere to trigger the creation of a file.
file element is empty then its contents will just be the file name (the ant
concat task needs some default content to trigger the file creation), otherwise it’ll be the provided content of the element. This is currently, and for no good reason, limited to plain-text (other elements are stripped).
My next steps were to allow the specification of a default license (I was thinking that the generated Ant script would grab a copy of the license using a provided URL), and construct a default Ant script for working with the newly created project.
I was motivated to do this for similar reasons to Matt: I got fed up with manually creating new directory structures for projects and wanted something quicker. However I’m also tinkering with “little languages” like this, exploring the use of XSLT as a code generation tool. “Project maker” currently generates an Ant script, but could easily be adapted to create a shell script for example.
I’ll maybe do some more work on this in the background (it’s one of a few different little languages that I’d like to try out), and may liberally some ideas from Matt’s Ant script: his
pause target is particularly nice. The only changes I’d make would be to extend the “project maker” language so that the user can specify some extra details about the project, e.g. Is it just java? Are there any EJB tasks to do? XDoclet? Documentation generation, e.g. from JSP tag libraries, Docbook, etc also seems important.
I’ve quoted the name of the tool all the way through this piece because I was never entirely happy with calling it “project maker”. It’s a dull name. Now I’m just going to call it Spooky.
Update I’ve continued work on this, and Spooky now has its own project page.