Package com.android.builder.merge
Class IncrementalFileMergerOutputs
java.lang.Object
com.android.builder.merge.IncrementalFileMergerOutputs
Factories for instances of
IncrementalFileMergerOutput.-
Method Summary
Modifier and TypeMethodDescriptionstatic IncrementalFileMergerOutputfromAlgorithmAndWriter(StreamMergeAlgorithm algorithm, MergeOutputWriter writer) Creates a new output that merges files using the provided algorithm and writes the merged file using the provided writer.
-
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
IncrementalFileMergerOutputstates 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 (thef()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
StreamMergeAlgorithmand then performs the actual writing usingMergeOutputWriter. SeeStreamMergeAlgorithmsfor a list of algorithms andMergeOutputWritersfor 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
-