T - Parameter type for the work action. Should be WorkParameters.None if the action does not have parameters.@Incubating public interface WorkAction<T extends WorkParameters>
WorkerExecutor.
A work action implementation is an abstract class implementing the execute() method.
A minimal implementation may look like this:
import org.gradle.workers.WorkParameters;
public abstract class MyWorkAction implements WorkAction<WorkParameters.None> {
private final String greeting;
@Inject
public MyWorkAction() {
this.greeting = "hello";
}
@Override
public void execute() {
System.out.println(greeting);
}
}
Implementations of WorkAction are subject to the following constraints:
getParameters() in your class, the method will be implemented by Gradle.Inject.| Modifier and Type | Method | Description |
|---|---|---|
void |
execute() |
The work to perform when this work item executes.
|
T |
getParameters() |
The parameters associated with a concrete work item.
|
@Inject T getParameters()
void execute()