groovy - Construct/Destruct custom gradle task -


i'm totally new in gradle/groovy. want create custom task stuff. first problem how when task finishes job? can override dofirst/dolast closures? maybe can override method @ beginning , @ end?

this "task"

import java.nio.file.files  class mycustomtask extends defaulttask {      file builddir     file tempdir      public mycustomtask() {         super()         builddir = project.getbuildfile().getparentfile()         tempdir = files.createtempdirectory(builddir.topath(), "mycustomtask").tofile()     }      @taskaction     def build() {         println("test");     }      // want delete tempdir ater task execution  } 

as says on official gradle forums (where asked same question), should either

  • wrap build() code in try...finally block
  • or write custom task folder build directory gets cleaned when user gradle clean

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -