Package com.sidneysimmons.kimber.util
Class TaskAvoidanceUtil
java.lang.Object
com.sidneysimmons.kimber.util.TaskAvoidanceUtil
Service class for working with gradle's task avoidance and input/output functionality. Task timestamps can be used as
task outputs to help gradle know the task is UP-TO-DATE and doesn't need to run again until something changes. This
is useful for tasks that build or deploy docker images when the task output isn't a simple file that can be found on
the file system.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteTaskTimestamp(File file) Delete the task timestamp.static FilegetTaskTimestampFile(String buildDirectory, String taskName) Get the task timestamp file for the given task name.static org.gradle.api.provider.Provider<org.gradle.api.file.RegularFile> getTaskTimestampFileProvider(org.gradle.api.Project project, String taskName) Get the task timestamp file provider for the given task name.static voidsaveTaskTimestamp(File file) Save the task timestamp.
-
Method Details
-
getTaskTimestampFileProvider
public static org.gradle.api.provider.Provider<org.gradle.api.file.RegularFile> getTaskTimestampFileProvider(org.gradle.api.Project project, String taskName) Get the task timestamp file provider for the given task name.- Parameters:
project- the projecttaskName- the task name- Returns:
- the file provider
-
getTaskTimestampFile
Get the task timestamp file for the given task name.- Parameters:
buildDirectory- the build directorytaskName- the task name- Returns:
- the file
-
saveTaskTimestamp
Save the task timestamp.- Parameters:
file- the file
-
deleteTaskTimestamp
Delete the task timestamp.- Parameters:
file- the file
-