Constructor and Description |
---|
TaskUtils() |
Modifier and Type | Method and Description |
---|---|
static Action<Task> |
configureDependsOn(Object path,
Object... paths)
Returns an action that will configure
Task.dependsOn(Object...) . |
static Action<Task> |
configureGroup(String group)
Returns an action that configures the
Task.setGroup(String) . |
static String |
temporaryDirectoryPath(Task task)
Returns the relative path from
ProjectLayout.getBuildDirectory() (or Project.getBuildDir() ) to the specified task temporary directory. |
public static String temporaryDirectoryPath(Task task)
ProjectLayout.getBuildDirectory()
(or Project.getBuildDir()
) to the specified task temporary directory.
Calling Task.getTemporaryDir()
creates the directory immediately.
To avoid unnecessary directory creation during the configuration phase, we can use this method together with ProjectLayout.getBuildDirectory()
to create a side-effect free path to the task's temporary directory.task
- the task to return the temporary directory path.public static Action<Task> configureDependsOn(Object path, Object... paths)
Task.dependsOn(Object...)
.path
- a task dependency path as describe by Task.dependsOn(Object...)
.paths
- an array of task dependency path as describe by Task.dependsOn(Object...)
.public static Action<Task> configureGroup(String group)
Task.setGroup(String)
.group
- a task group string.