Sunday, February 8, 2015

Gradle shadow plugin

Gradle has a very convinent shadow plugin.  all you really have to do is to apply the plugin and you can build with ./gradlew shadowJar.

then i found an example of adding all the build information to the jar's manifest, and turns out that forces me to rebuild the jar every time it build as i simply put new Date() to the build date!  gradle will smart enough to know the manifest has change!!  (as new Date() will output not only the current date, but the time!)

here's what i do to avoid it.

well, we could add a property and only on the CI server, it'll include the time for release (if we needed that) and all local dev, should have no reason to build it everytime!  every second counts!