public class FullRunShrinker<T> extends AbstractShrinker<T>
ShrinkerGraph to keep state and persist it for later
incremental runs.| Modifier and Type | Class and Description |
|---|---|
class |
FullRunShrinker.Result
Result of the shrinker run.
|
AbstractShrinker.CounterSetmExecutor, mGraph, mShrinkerLogger| Constructor and Description |
|---|
FullRunShrinker(com.android.ide.common.internal.WaitableExecutor executor,
ShrinkerGraph<T> graph,
java.util.Set<java.io.File> platformJars,
ShrinkerLogger shrinkerLogger,
BytecodeVersion bytecodeVersion) |
| Modifier and Type | Method and Description |
|---|---|
FullRunShrinker.Result |
run(java.util.Collection<com.android.build.api.transform.TransformInput> inputs,
java.util.Collection<com.android.build.api.transform.TransformInput> referencedClasses,
com.android.build.api.transform.TransformOutputProvider output,
com.google.common.collect.ImmutableMap<AbstractShrinker.CounterSet,KeepRules> keepRules,
KeepRules whyAreYouKeepingRules,
boolean saveState)
Performs the full shrinking run.
|
chooseOutputFile, getAllDirectories, getAllJars, incrementCounter, isProgramClass, logTime, resolveReferences, rewrite, setCounters, updateClassFiles, waitForAllTaskspublic FullRunShrinker(@NonNull
com.android.ide.common.internal.WaitableExecutor executor,
@NonNull
ShrinkerGraph<T> graph,
@NonNull
java.util.Set<java.io.File> platformJars,
@NonNull
ShrinkerLogger shrinkerLogger,
@Nullable
BytecodeVersion bytecodeVersion)
public FullRunShrinker.Result run(@NonNull java.util.Collection<com.android.build.api.transform.TransformInput> inputs, @NonNull java.util.Collection<com.android.build.api.transform.TransformInput> referencedClasses, @NonNull com.android.build.api.transform.TransformOutputProvider output, @NonNull com.google.common.collect.ImmutableMap<AbstractShrinker.CounterSet,KeepRules> keepRules, @Nullable KeepRules whyAreYouKeepingRules, boolean saveState) throws java.io.IOException
ShrinkerGraph and fills it with data read from the platform JARs as well as input classes.
Then we find "entry points" that match -keep rules from the config file, and walk the
graph, setting the counters and finding reachable classes and members. In the last step we
rewrite all reachable class files to only contain kept class members and put them in the
matching output directories.java.io.IOException