gradle-velocity-plugin is a gradle plugin for the Velocity template engine. It integrates the Apache velocity template engine into gradle, and solves your Version.java or version.h needs. You can also preprocess resources, if you like.
Information regarding Project Releases and Project Resources. Note that the information here is a quote from Freecode.com page, and the downloads themselves may not be hosted on OSDN.