public class SplitOutputMatcher
extends java.lang.Object
Constructor and Description |
---|
SplitOutputMatcher() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<com.android.build.OutputFile> |
computeBestOutput(java.util.List<? extends com.android.build.VariantOutput> outputs,
java.util.Collection<java.lang.String> variantAbiFilters,
int deviceDensity,
java.util.List<java.lang.String> deviceAbis)
Determines and return the list of APKs to use based on given device density and abis.
|
static java.util.List<java.io.File> |
computeBestOutput(ProcessExecutor processExecutor,
java.io.File splitSelectExe,
com.android.builder.testing.api.DeviceConfigProvider deviceConfigProvider,
java.io.File mainApk,
java.util.Collection<java.lang.String> splitApksPath)
Determines and return the list of APKs to use based on given device density and abis.
|
static java.util.List<java.io.File> |
computeBestOutput(ProcessExecutor processExecutor,
java.io.File splitSelectExe,
com.android.builder.testing.api.DeviceConfigProvider deviceConfigProvider,
java.util.List<? extends com.android.build.VariantOutput> outputs,
java.util.Collection<java.lang.String> variantAbiFilters)
Determines and return the list of APKs to use based on given device density and abis.
|
static java.lang.String |
prepareConfigFormatMccMnc(java.lang.String deviceConfig)
Preparing the configuration string according to the format expected by the split-select
tool.
|
@NonNull public static java.util.List<java.io.File> computeBestOutput(@NonNull ProcessExecutor processExecutor, @Nullable java.io.File splitSelectExe, @NonNull com.android.builder.testing.api.DeviceConfigProvider deviceConfigProvider, @NonNull java.util.List<? extends com.android.build.VariantOutput> outputs, @Nullable java.util.Collection<java.lang.String> variantAbiFilters) throws ProcessException
processExecutor
- an executor to execute native processes.splitSelectExe
- the split select tool optionally.deviceConfigProvider
- the device configuration.outputs
- the tested variant outpts.variantAbiFilters
- a list of abi filters applied to the variant. This is used in place
of the outputs, if there is a single output with no abi filters.
If the list is null or empty, then the variant does not restrict ABI
packaging.ProcessException
@NonNull public static java.util.List<java.io.File> computeBestOutput(@NonNull ProcessExecutor processExecutor, @NonNull java.io.File splitSelectExe, @NonNull com.android.builder.testing.api.DeviceConfigProvider deviceConfigProvider, @NonNull java.io.File mainApk, @NonNull java.util.Collection<java.lang.String> splitApksPath) throws ProcessException
processExecutor
- an executor to execute native processes.splitSelectExe
- the split select tool optionally.deviceConfigProvider
- the device configuration.mainApk
- the main apk file.splitApksPath
- the list of split apks path.ProcessException
@NonNull public static java.util.List<com.android.build.OutputFile> computeBestOutput(@NonNull java.util.List<? extends com.android.build.VariantOutput> outputs, @Nullable java.util.Collection<java.lang.String> variantAbiFilters, int deviceDensity, @NonNull java.util.List<java.lang.String> deviceAbis)
outputs
- the outputs to choose from.variantAbiFilters
- a list of abi filters applied to the variant. This is used in place
of the outputs, if there is a single output with no abi filters.
If the list is null, then the variant does not restrict ABI
packaging.deviceDensity
- the density of the device.deviceAbis
- a list of ABIs supported by the device.public static java.lang.String prepareConfigFormatMccMnc(@NonNull java.lang.String deviceConfig)
Devices having api level 21 have a config format that is not compatible with split-select. The problem is that the split-select tool expects mcc310-mnc260, while the am get-config command will output 310mcc-260mnc-... (mcc is always before mnc, and both are optional). That is why the string is processed to match the expected format for these two dimensions. The rest of the config string is not changed.
deviceConfig
- device configuration to process