public class MyGenericCustomTask extents Task implements TaskContainer {
private Task task;
boolean isSerious = false;
@Override
public void addTask(Task arg0) {
this.task = arg0;
}
public void setIsSerious(boolean b) {
this.isSerious = b;
}
@Override
public void execute() throws BuildException {
try {
this.task.perform(); // If there is a exception
}catch(BuildException e) {
if(isSerious) {
println("Failure is series");
}
else {
println("Log the failure and Continue for this run.");
}
}
}
How do i achieve the same in gradle custom task ?