summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-10-17 00:19:16 +0000
committer Spandan Das <spandandas@google.com> 2024-10-17 17:36:05 +0000
commit5e63b25c57e055136468d46a7064ae96104fc7ea (patch)
tree9485a2744579f3c9b38507a7caea0e04cfd7274b
parente228f8e9c98a14e93a075f9fe6633f98308ae62e (diff)
Add filegroup modules to module_bp_java_deps.json
This adds all filegroup modules to java_deps.json, since java modules can have filegroups in their srcs via :<filegroup> One possible optimization here could be to filter out filegroups that do not contain .java files when creating module_bp_java_deps.json. This CL does not do that since the increase in .json file is not significant. In aosp/main, it increases from ~40MB to ~50MB. Test: verified that `mime.types.minimized` exists in module_bp_java_deps.json Bug: 373837953 Change-Id: I8a89d8b454a12c251ff2262b0e507cf322ce0a5f
-rw-r--r--android/filegroup.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/android/filegroup.go b/android/filegroup.go
index ff0f74e99..a8b4f004d 100644
--- a/android/filegroup.go
+++ b/android/filegroup.go
@@ -139,3 +139,15 @@ func FileGroupDefaultsFactory() Module {
return module
}
+
+// Collect information for opening IDE project files in java/jdeps.go.
+// Copied from build/soong/genrule/genrule.go
+func (fg *fileGroup) IDEInfo(ctx BaseModuleContext, dpInfo *IdeInfo) {
+ dpInfo.Srcs = append(dpInfo.Srcs, fg.Srcs().Strings()...)
+ for _, src := range fg.properties.Srcs.GetOrDefault(ctx, nil) {
+ if mod, _ := SrcIsModuleWithTag(src); mod != "" {
+ // Register the module name without any tags in `Deps`
+ dpInfo.Deps = append(dpInfo.Deps, mod)
+ }
+ }
+}