summaryrefslogtreecommitdiff
path: root/java/droiddoc.go
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2024-04-11 17:37:58 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-04-11 17:37:58 +0000
commit033ffb9533717aa7f73f8cccd7506427f5ce47ba (patch)
treed50714ce95016aac2c86b2e55b72ca382f729c88 /java/droiddoc.go
parent291a4912d148d740790edfac2e7b707070ef1abf (diff)
parent3921f0b3560a0dbbac3f5590dc639caf9492a2e8 (diff)
Merge "Collect aconfig_declarations of the dependent java_aconfig_library modules" into main
Diffstat (limited to 'java/droiddoc.go')
-rw-r--r--java/droiddoc.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/java/droiddoc.go b/java/droiddoc.go
index aec40b312..176779eb4 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -391,12 +391,14 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
} else if dep, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok {
deps.classpath = append(deps.classpath, dep.HeaderJars...)
deps.aidlIncludeDirs = append(deps.aidlIncludeDirs, dep.AidlIncludeDirs...)
+ deps.aconfigProtoFiles = append(deps.aconfigProtoFiles, dep.AconfigIntermediateCacheOutputPaths...)
} else if dep, ok := module.(android.SourceFileProducer); ok {
checkProducesJars(ctx, dep)
deps.classpath = append(deps.classpath, dep.Srcs()...)
} else {
ctx.ModuleErrorf("depends on non-java module %q", otherName)
}
+
case java9LibTag:
if dep, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok {
deps.java9Classpath = append(deps.java9Classpath, dep.HeaderJars...)
@@ -429,6 +431,19 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
srcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Srcs, j.properties.Exclude_srcs)
j.implicits = append(j.implicits, srcFiles...)
+ // Module can depend on a java_aconfig_library module using the ":module_name{.tag}" syntax.
+ // Find the corresponding aconfig_declarations module name for such case.
+ for _, src := range j.properties.Srcs {
+ if moduleName, tag := android.SrcIsModuleWithTag(src); moduleName != "" {
+ otherModule := android.GetModuleFromPathDep(ctx, moduleName, tag)
+ if otherModule != nil {
+ if dep, ok := android.OtherModuleProvider(ctx, otherModule, android.CodegenInfoProvider); ok {
+ deps.aconfigProtoFiles = append(deps.aconfigProtoFiles, dep.IntermediateCacheOutputPaths...)
+ }
+ }
+ }
+ }
+
filterByPackage := func(srcs []android.Path, filterPackages []string) []android.Path {
if filterPackages == nil {
return srcs