public static class ManifestMerger2.Invoker<T extends ManifestMerger2.Invoker<T>>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ManifestMerger2.Invoker.Feature
Optional behavior of the merging tool can be turned on by setting these Feature.
|
| Modifier and Type | Field and Description |
|---|---|
protected com.android.utils.ILogger |
mLogger |
protected java.io.File |
mMainManifestFile |
protected com.google.common.collect.ImmutableMap.Builder<java.lang.String,java.lang.Object> |
mPlaceholders |
protected com.google.common.collect.ImmutableMap.Builder<ManifestSystemProperty,java.lang.Object> |
mSystemProperties |
| Modifier and Type | Method and Description |
|---|---|
ManifestMerger2.Invoker |
addBundleManifests(java.util.List<com.android.utils.Pair<java.lang.String,java.io.File>> namesAndFiles)
Deprecated.
use addLibraryManifest or addAndroidBundleManifests
|
ManifestMerger2.Invoker |
addFlavorAndBuildTypeManifest(java.io.File file)
Add a flavor or build type manifest file last in the list.
|
ManifestMerger2.Invoker |
addFlavorAndBuildTypeManifests(java.io.File... files)
Add several flavor or build type manifest files last in the list.
|
ManifestMerger2.Invoker |
addLibraryManifest(java.io.File file)
Add one library file manifest, will be added last in the list of library files which will
make the parameter the lowest priority library manifest file.
|
ManifestMerger2.Invoker |
addLibraryManifest(java.lang.String name,
java.io.File file)
Add one library file manifest, will be added last in the list of library files which will
make the parameter the lowest priority library manifest file.
|
ManifestMerger2.Invoker |
addLibraryManifests(java.io.File... files)
Add several library file manifests at then end of the list which will make them the
lowest priority manifest files.
|
ManifestMerger2.Invoker |
addManifestProviders(java.lang.Iterable<? extends ManifestProvider> providers)
Sets manifest providers for this merging activity.
|
ManifestMerger2.Invoker |
asType(XmlDocument.Type type)
Specify if the file being merged is an overlay (flavor).
|
MergingReport |
merge()
Perform the merging and return the result.
|
ManifestMerger2.Invoker |
setFeatureName(java.lang.String featureName)
Specify the feature name for feature merging.
|
ManifestMerger2.Invoker |
setMergeReportFile(java.io.File mergeReport)
Sets the file to use to write the merging report.
|
ManifestMerger2.Invoker |
setOverride(ManifestSystemProperty override,
java.lang.String value)
Sets a value for a
ManifestSystemProperty |
ManifestMerger2.Invoker |
setPlaceHolderValue(java.lang.String placeHolderName,
java.lang.String value)
Adds a new placeholder name and value for substitution.
|
ManifestMerger2.Invoker |
setPlaceHolderValues(java.util.Map<java.lang.String,java.lang.Object> keyValuePairs)
Adds placeholders names and associated values for substitution.
|
ManifestMerger2.Invoker |
withFeatures(ManifestMerger2.Invoker.Feature... features)
Sets some optional features for the merge tool.
|
ManifestMerger2.Invoker |
withFileStreamProvider(ManifestMerger2.FileStreamProvider provider)
Sets a file stream provider which allows the client of the manifest merger to provide
arbitrary content lookup for files.
|
protected final java.io.File mMainManifestFile
protected final com.google.common.collect.ImmutableMap.Builder<ManifestSystemProperty,java.lang.Object> mSystemProperties
@NonNull protected final com.android.utils.ILogger mLogger
@NonNull protected final com.google.common.collect.ImmutableMap.Builder<java.lang.String,java.lang.Object> mPlaceholders
@NonNull public ManifestMerger2.Invoker setOverride(@NonNull ManifestSystemProperty override, @NonNull java.lang.String value)
ManifestSystemPropertyoverride - the property to setvalue - the value for the property@NonNull public ManifestMerger2.Invoker setPlaceHolderValues(@NonNull java.util.Map<java.lang.String,java.lang.Object> keyValuePairs)
@NonNull public ManifestMerger2.Invoker setPlaceHolderValue(@NonNull java.lang.String placeHolderName, @NonNull java.lang.String value)
@NonNull public ManifestMerger2.Invoker setMergeReportFile(@Nullable java.io.File mergeReport)
mergeReport - the file to write the report in.@NonNull public ManifestMerger2.Invoker addLibraryManifest(@NonNull java.io.File file)
file - the library manifest file to add.@NonNull public ManifestMerger2.Invoker addLibraryManifest(@NonNull java.lang.String name, @NonNull java.io.File file)
file - the library manifest file to add.name - the library name.@NonNull @Deprecated public ManifestMerger2.Invoker addBundleManifests(@NonNull java.util.List<com.android.utils.Pair<java.lang.String,java.io.File>> namesAndFiles)
namesAndFiles - the list of library dependencies.@NonNull public ManifestMerger2.Invoker addManifestProviders(@NonNull java.lang.Iterable<? extends ManifestProvider> providers)
providers - the list of manifest providers.@NonNull public ManifestMerger2.Invoker addLibraryManifests(@NonNull java.io.File... files)
files - library manifest files to add last.@NonNull public ManifestMerger2.Invoker addFlavorAndBuildTypeManifest(@NonNull java.io.File file)
file - build type or flavor manifest file@NonNull public ManifestMerger2.Invoker addFlavorAndBuildTypeManifests(java.io.File... files)
files - build type of flavor manifest files to add.@NonNull public ManifestMerger2.Invoker withFeatures(ManifestMerger2.Invoker.Feature... features)
features - one to many features to set.@NonNull public ManifestMerger2.Invoker withFileStreamProvider(@Nullable ManifestMerger2.FileStreamProvider provider)
NOTE: There should only be one.
provider - the provider to use@NonNull public ManifestMerger2.Invoker setFeatureName(@Nullable java.lang.String featureName)
featureName - the feature name to use.@NonNull public ManifestMerger2.Invoker asType(XmlDocument.Type type)
@NonNull public MergingReport merge() throws ManifestMerger2.MergeFailureException
MergingReport that will give
access to all the logging and merging records.
This method can be invoked several time and will re-do the file merges.ManifestMerger2.MergeFailureException - if the merging
cannot be completed successfully.