Pre Dexing cache. Since we cannot yet have a single task for each library that needs to be pre-dexed (because there is no task-level parallelization), this class allows reusing the output of the pre-dexing of a library in a project to write the output of the pre-dexing of the same library in a different project. Because different project could use different build-tools, both the library to pre-dex and the version of the build tools are used as keys in the cache. The API is fairly simple, just call preDexLibrary(java.io.File, java.io.File, boolean, com.android.builder.core.DexOptions, com.android.sdklib.BuildToolInfo, boolean, com.android.ide.common.internal.CommandLineRunner) The call will be blocking until the pre-dexing happened, either through actual pre-dexing or through copying the output of a previous pre-dex run. After a build a call to clear(java.io.File, com.android.utils.ILogger) with a file will allow saving the known pre-dexed libraries for future reuse.
Type | Name and description |
---|---|
protected Node |
createItemNode(Document document, DexKey itemKey, BaseItem item) |
static PreDexCache |
getCache() |
protected KeyFactory<DexKey> |
getKeyFactory() |
void |
preDexLibrary(File inputFile, File outFile, boolean multiDex, DexOptions dexOptions, com.android.sdklib.BuildToolInfo buildToolInfo, boolean verbose, com.android.ide.common.internal.CommandLineRunner commandLineRunner) Pre-dex a given library to a given output with a specific version of the build-tools. |
Methods inherited from class | Name |
---|---|
class PreProcessCache |
clear, createItemNode, getItem, getKeyFactory, incrementHits, incrementMisses, load, saveItems |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Pre-dex a given library to a given output with a specific version of the build-tools.
inputFile
- the jar to pre-dexoutFile
- the output file or folder (if multi-dex is enabled). must existmultiDex
- whether mutli-dex is enabled.dexOptions
- the dex options to run pre-dexbuildToolInfo
- the build tools infoverbose
- verbose flagcommandLineRunner
- the command line runner.