Class IntermediateProcessor

java.lang.Object
com.cleanroommc.gradle.api.task.IntermediateProcessor

public abstract class IntermediateProcessor extends Object
Toggleable cleanup of intermediate jars/files that exist only to feed a later task.

Each edge is a Delete task. Consumers finalizedBy it, and it mustRunAfter those consumers, so Gradle deletes the files after the last requested consumer finishes. Consumers that were not requested stay out of the graph. Only the project-local cache is ever touched, the shared Gradle Home cache is not.

Register discard edges next to the pipeline that produces the file.

  • Field Details

  • Constructor Details

    • IntermediateProcessor

      @Inject public IntermediateProcessor(org.gradle.api.Project project)
  • Method Details

    • of

      public static IntermediateProcessor of(org.gradle.api.Project project)
    • getDiscardIntermediates

      public abstract org.gradle.api.provider.Property<Boolean> getDiscardIntermediates()
    • discardAfter

      public IntermediateProcessor.Discard discardAfter(org.gradle.api.tasks.TaskProvider<?> consumer, Object... files)
      Deletes files after consumer has run. Skipped when discard is disabled.
      Parameters:
      consumer - the task the deletion waits for
      files - the intermediates to delete
    • discardAfterAll

      public IntermediateProcessor.Discard discardAfterAll(Collection<? extends org.gradle.api.tasks.TaskProvider<?>> consumers, Object... files)
      Deletes files after every requested consumer has run.
      Parameters:
      consumers - the tasks the deletion waits for
      files - the intermediates to delete
    • discardAfterAll

      public IntermediateProcessor.Discard discardAfterAll(String taskName, Collection<? extends org.gradle.api.tasks.TaskProvider<?>> consumers, Object... files)
      Deletes files after every requested consumer has run, using the supplied stable task name.
      Parameters:
      taskName - the name to register the delete task under
      consumers - the tasks the deletion waits for
      files - the intermediates to delete
    • after

      public void after(IntermediateProcessor.Discard discard, org.gradle.api.tasks.TaskProvider<?>... consumers)
      Adds more consumers that have to run before discard deletes its files.
      Parameters:
      discard - the deletion to hold back
      consumers - the tasks to wait for
    • after

      public void after(IntermediateProcessor.Discard discard, Collection<? extends org.gradle.api.tasks.TaskProvider<?>> consumers)