Class TaskAvoidanceUtil

java.lang.Object
com.sidneysimmons.kimber.util.TaskAvoidanceUtil

public class TaskAvoidanceUtil extends Object
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 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 project
      taskName - the task name
      Returns:
      the file provider
    • getTaskTimestampFile

      public static File getTaskTimestampFile(String buildDirectory, String taskName)
      Get the task timestamp file for the given task name.
      Parameters:
      buildDirectory - the build directory
      taskName - the task name
      Returns:
      the file
    • saveTaskTimestamp

      public static void saveTaskTimestamp(File file)
      Save the task timestamp.
      Parameters:
      file - the file
    • deleteTaskTimestamp

      public static void deleteTaskTimestamp(File file)
      Delete the task timestamp.
      Parameters:
      file - the file