public class IncrementalShrinker<T> extends AbstractShrinker<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
IncrementalShrinker.IncrementalRunImpossibleException
Exception thrown when the incremental shrinker detects incompatible changes and requests a
full run instead.
|
AbstractShrinker.CounterSetmExecutor, mGraph, mShrinkerLogger| Constructor and Description |
|---|
IncrementalShrinker(com.android.ide.common.internal.WaitableExecutor executor,
ShrinkerGraph<T> graph,
ShrinkerLogger shrinkerLogger,
BytecodeVersion bytecodeVersion) |
| Modifier and Type | Method and Description |
|---|---|
void |
incrementalRun(java.lang.Iterable<com.android.build.api.transform.TransformInput> inputs,
com.android.build.api.transform.TransformOutputProvider output)
Perform incremental shrinking, in the supported cases (where only code in pre-existing
methods has been modified).
|
protected void |
waitForAllTasks() |
chooseOutputFile, getAllDirectories, getAllJars, incrementCounter, isProgramClass, logTime, resolveReferences, rewrite, setCounters, updateClassFilespublic IncrementalShrinker(@NonNull
com.android.ide.common.internal.WaitableExecutor executor,
@NonNull
ShrinkerGraph<T> graph,
@NonNull
ShrinkerLogger shrinkerLogger,
@Nullable
BytecodeVersion bytecodeVersion)
public void incrementalRun(@NonNull
java.lang.Iterable<com.android.build.api.transform.TransformInput> inputs,
@NonNull
com.android.build.api.transform.TransformOutputProvider output)
throws java.io.IOException,
IncrementalShrinker.IncrementalRunImpossibleException
The general idea is this: for every method in modified classes, remove all outgoing "code reference" edges, add them again based on the current code and then set the counters again (traverse the graph) using the new set of edges.
The counters are re-calculated every time from scratch (starting from known entry points from the config file) to avoid cycles being left in the output.
IncrementalShrinker.IncrementalRunImpossibleException - If incremental shrinking is impossible and a full
run should be done instead.java.io.IOExceptionprotected void waitForAllTasks()
waitForAllTasks in class AbstractShrinker<T>