Skip to content

Instantly share code, notes, and snippets.

@SmartDengg
Forked from nikos/GradleTaskTimer.gradle
Created May 13, 2017 05:18
Show Gist options
  • Select an option

  • Save SmartDengg/f49934f83d63633b8a8a0e8a72422dbb to your computer and use it in GitHub Desktop.

Select an option

Save SmartDengg/f49934f83d63633b8a8a0e8a72422dbb to your computer and use it in GitHub Desktop.

Revisions

  1. @nikos nikos created this gist Oct 23, 2012.
    16 changes: 16 additions & 0 deletions GradleTaskTimer.gradle
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    class TaskTimerListener implements TaskExecutionListener {

    private Clock clock

    @Override
    void beforeExecute(Task task) {
    clock = new org.gradle.util.Clock()
    }

    @Override
    void afterExecute(Task task, TaskState taskState) {
    task.project.logger.info "Execution of ${task.name} took ${clock.time}"
    }
    }

    gradle.addListener new TaskTimerListener()