Class IncrementalFileMergerOutputs

java.lang.Object
com.android.builder.merge.IncrementalFileMergerOutputs

public final class IncrementalFileMergerOutputs extends Object
Factories for instances of IncrementalFileMergerOutput.
  • Method Details

    • fromAlgorithmAndWriter

      @NonNull public static IncrementalFileMergerOutput fromAlgorithmAndWriter(@NonNull StreamMergeAlgorithm algorithm, @NonNull MergeOutputWriter writer)
      Creates a new output that merges files using the provided algorithm and writes the merged file using the provided writer. This output decouples the actual file-merging algorithm (how to merge files) from file writing.

      While the general definition of IncrementalFileMergerOutput states that the merge will result in a file being written to output coming from a list of inputs, in practice, the step is two-process: first the file is merged (the f() function as described in the package documentation is applied) and then it is written to an output tree.

      This factory method creates an output that first decides what data needs to be written by using a StreamMergeAlgorithm and then performs the actual writing using MergeOutputWriter. See StreamMergeAlgorithms for a list of algorithms and MergeOutputWriters for a list of writers.

      Parameters:
      algorithm - the algorithm to merge files (not used for files that are removed)
      writer - the writer that builds the output
      Returns:
      the output