Revert "Include proguard flag files from transitive java_library deps"
This reverts commit 9c54f032b9dbef63b9ef235c2219a4e9124f8891.
Reason for revert: b/262940536
Bug: b/262940536
Change-Id: I8140eacc7ca8716f799561412cb5cef29df35d29
diff --git a/java/aar.go b/java/aar.go
index eba8a41..6261f29 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -29,8 +29,8 @@
)
type AndroidLibraryDependency interface {
- LibraryDependency
ExportPackage() android.Path
+ ExportedProguardFlagFiles() android.Paths
ExportedRRODirs() []rroDir
ExportedStaticPackages() android.Paths
ExportedManifests() android.Paths
@@ -498,7 +498,8 @@
aarFile android.WritablePath
- exportedStaticPackages android.Paths
+ exportedProguardFlagFiles android.Paths
+ exportedStaticPackages android.Paths
}
var _ android.OutputFileProducer = (*AndroidLibrary)(nil)
@@ -513,6 +514,10 @@
}
}
+func (a *AndroidLibrary) ExportedProguardFlagFiles() android.Paths {
+ return a.exportedProguardFlagFiles
+}
+
func (a *AndroidLibrary) ExportedStaticPackages() android.Paths {
return a.exportedStaticPackages
}
@@ -561,16 +566,13 @@
a.exportedProguardFlagFiles = append(a.exportedProguardFlagFiles,
android.PathsForModuleSrc(ctx, a.dexProperties.Optimize.Proguard_flags_files)...)
ctx.VisitDirectDeps(func(m android.Module) {
- if ctx.OtherModuleDependencyTag(m) == staticLibTag {
- if lib, ok := m.(LibraryDependency); ok {
- a.exportedProguardFlagFiles = append(a.exportedProguardFlagFiles, lib.ExportedProguardFlagFiles()...)
- }
- if alib, ok := m.(AndroidLibraryDependency); ok {
- a.exportedStaticPackages = append(a.exportedStaticPackages, alib.ExportPackage())
- a.exportedStaticPackages = append(a.exportedStaticPackages, alib.ExportedStaticPackages()...)
- }
+ if lib, ok := m.(AndroidLibraryDependency); ok && ctx.OtherModuleDependencyTag(m) == staticLibTag {
+ a.exportedProguardFlagFiles = append(a.exportedProguardFlagFiles, lib.ExportedProguardFlagFiles()...)
+ a.exportedStaticPackages = append(a.exportedStaticPackages, lib.ExportPackage())
+ a.exportedStaticPackages = append(a.exportedStaticPackages, lib.ExportedStaticPackages()...)
}
})
+
a.exportedProguardFlagFiles = android.FirstUniquePaths(a.exportedProguardFlagFiles)
a.exportedStaticPackages = android.FirstUniquePaths(a.exportedStaticPackages)