Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.