Rename collectTransitiveHeaderJars and friends to mention R8
collectTransitiveHeaderJarsForR8 visits direct dependencies and collects
all transitive libs and static_libs header jars. The semantics of the
collected jars are odd (it collects combined jars that contain the static
libs, but also the static libs, and it collects transitive libs dependencies
of static_libs), so these are only used to expand the --library arguments
to R8. Rename the method and all the fields it uses with a "ForR8"
suffix to avoid confusion when more transitive header jar collection is
added to support transitive classpaths.
Bug: 308016794
Test: all soong tests pass
Change-Id: I291a86fbbc2e2f088598fb309d1b992080d60941
diff --git a/java/dex.go b/java/dex.go
index 6c739a2..7d42efc 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -108,7 +108,7 @@
resourcesInput android.OptionalPath
resourcesOutput android.OptionalPath
- providesTransitiveHeaderJars
+ providesTransitiveHeaderJarsForR8
}
func (d *dexer) effectiveOptimizeEnabled() bool {
@@ -307,14 +307,14 @@
r8Deps = append(r8Deps, flags.dexClasspath...)
transitiveStaticLibsLookupMap := map[android.Path]bool{}
- if d.transitiveStaticLibsHeaderJars != nil {
- for _, jar := range d.transitiveStaticLibsHeaderJars.ToList() {
+ if d.transitiveStaticLibsHeaderJarsForR8 != nil {
+ for _, jar := range d.transitiveStaticLibsHeaderJarsForR8.ToList() {
transitiveStaticLibsLookupMap[jar] = true
}
}
transitiveHeaderJars := android.Paths{}
- if d.transitiveLibsHeaderJars != nil {
- for _, jar := range d.transitiveLibsHeaderJars.ToList() {
+ if d.transitiveLibsHeaderJarsForR8 != nil {
+ for _, jar := range d.transitiveLibsHeaderJarsForR8.ToList() {
if _, ok := transitiveStaticLibsLookupMap[jar]; ok {
// don't include a lib if it is already packaged in the current JAR as a static lib
continue