Skip to content

Instantly share code, notes, and snippets.

@huxi
Created June 30, 2015 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huxi/3e4ddb7d6c3b5666fb9c to your computer and use it in GitHub Desktop.
Save huxi/3e4ddb7d6c3b5666fb9c to your computer and use it in GitHub Desktop.
Simple Gradle build listener to print a "Finished at: " similarly to Maven after the build has finished. Put this file into the ~/.gradle/init.d directory.
import org.gradle.BuildAdapter
import java.text.SimpleDateFormat
class FinishedAtBuildListener extends BuildAdapter {
private SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS")
void buildFinished(BuildResult result) {
println "Finished at: "+formatter.format(new Date())
}
}
gradle.addListener(new FinishedAtBuildListener())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment