summaryrefslogtreecommitdiff
path: root/java/aar.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/aar.go')
-rw-r--r--java/aar.go22
1 files changed, 12 insertions, 10 deletions
diff --git a/java/aar.go b/java/aar.go
index eba8a4105..6261f2974 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -29,8 +29,8 @@ import (
)
type AndroidLibraryDependency interface {
- LibraryDependency
ExportPackage() android.Path
+ ExportedProguardFlagFiles() android.Paths
ExportedRRODirs() []rroDir
ExportedStaticPackages() android.Paths
ExportedManifests() android.Paths
@@ -498,7 +498,8 @@ type AndroidLibrary struct {
aarFile android.WritablePath
- exportedStaticPackages android.Paths
+ exportedProguardFlagFiles android.Paths
+ exportedStaticPackages android.Paths
}
var _ android.OutputFileProducer = (*AndroidLibrary)(nil)
@@ -513,6 +514,10 @@ func (a *AndroidLibrary) OutputFiles(tag string) (android.Paths, error) {
}
}
+func (a *AndroidLibrary) ExportedProguardFlagFiles() android.Paths {
+ return a.exportedProguardFlagFiles
+}
+
func (a *AndroidLibrary) ExportedStaticPackages() android.Paths {
return a.exportedStaticPackages
}
@@ -561,16 +566,13 @@ func (a *AndroidLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext)
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)