You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The keep rule marks all matched classes as "roots". If any keep rules are defined all classes which are not reachable from the roots via dependency analysis are discarded when writing the output jar. This is the last step in the process, after renaming and zapping.
KeepProcessor.java and Shader.scala have diverged from these semantics and now only keep the classes that match a keep rule.
The code to build the dependency graph and compute its transitive closure is still present but the way it is currently used it has no effect:
getExcludes computes the transitive closure but is called before the dependency graph is populated (by depend.put() in KeepProcessor.process() and KeepProcessor.map()), it always returns an empty set. The check here is redundant because excludes is empty, and also because:
KeepProcessor.process() now returns false when keep rules don't match, dropping classes even if they are dependencies (that was not the case in the original implementation).
JJProcessor.strip() is intended to perform another pass to remove all excluded classes (not seen in the transitive closure). That method still exists but is not called from Shader. (It was called in Main.process())
The path forward depends on what are the intended semantics. To me keeping dependencies in the jar seems more useful and robust, but I do not have an immediate need keep rules. Maybe they are only rarely used. Users who would like to perform dead code elimination could prefer another tool that can also do it at a finer grain than the class level.
The text was updated successfully, but these errors were encountered:
From
help.txt
KeepProcessor.java
andShader.scala
have diverged from these semantics and now only keep the classes that match a keep rule.The code to build the dependency graph and compute its transitive closure is still present but the way it is currently used it has no effect:
getExcludes
computes the transitive closure but is called before the dependency graph is populated (bydepend.put()
inKeepProcessor.process()
andKeepProcessor.map()
), it always returns an empty set. The check here is redundant because excludes is empty, and also because:KeepProcessor.process()
now returnsfalse
when keep rules don't match, dropping classes even if they are dependencies (that was not the case in the original implementation).JJProcessor.strip()
is intended to perform another pass to remove all excluded classes (not seen in the transitive closure). That method still exists but is not called fromShader
. (It was called in Main.process())The path forward depends on what are the intended semantics. To me keeping dependencies in the jar seems more useful and robust, but I do not have an immediate need
keep
rules. Maybe they are only rarely used. Users who would like to perform dead code elimination could prefer another tool that can also do it at a finer grain than the class level.The text was updated successfully, but these errors were encountered: