Showing posts with label template engine. Show all posts
Showing posts with label template engine. Show all posts

Thursday, April 2, 2015

Pouring Java

I've spent most of today working on some in-house tools for increasing productivity. I got tired of writing out boilerplate code for my Java classes, and using an IDE's class wizards was annoying me to no end, so I ended up writing a little command line utility which I call pour. Get it? You pour java...anyway...

I developed my little tool using Ruby, since it is so great for string manipulation, and easy file handling. Pour is short on features, but works exactly as I expect it to, and only outputs exactly what I want, and is far faster than any class wizard I've found.

I can specify a local template file to pour, and it will use it to create the classes, or, I can create a template in my home directory to use the template globally, or I can use the built-in template. I can specify to generate an entry point function, and I can specify a package. These few features turned a task that normally takes about 3 minutes, and turns it into about a 5 second task.

In addition, I set up gradle and grunt for a very simple auto-build workflow that allows me to focus on the code editing, and not on having to build the project, run tests, build the jar, and execute the program. I can just edit the code, save it, and my auto-build setup does the rest. Very fast workflow. I like it a lot, and I'm going to have to find a similar solution for my C++ development now, because this kicks major ass.