aboutsummaryrefslogtreecommitdiffstats
path: root/genrule
diff options
context:
space:
mode:
authorBrandon Lee <bralee@google.com>2018-08-15 15:35:38 -0700
committerColin Cross <ccross@android.com>2018-09-18 17:44:10 +0000
commit5d45c6f6f83b6a9b360c392b9fdfdeb2b935de7d (patch)
tree5d184abb38bc6ecc7b69510ea07b79a4d2c93917 /genrule
parentcfbea98a57a8d8fd314a3e2ebc08eb53eab328ef (diff)
downloadbuild_soong-5d45c6f6f83b6a9b360c392b9fdfdeb2b935de7d.tar.gz
build_soong-5d45c6f6f83b6a9b360c392b9fdfdeb2b935de7d.tar.bz2
build_soong-5d45c6f6f83b6a9b360c392b9fdfdeb2b935de7d.zip
Collect modules' info to create IDE project file.
- Register a singleton and implement GenerateBuildActions func in java/jdeps.go. - Declare a interface and a struct to collect info in android/module.go. - Implement IDEInfo for Library & Import module in java/jdeps.go. - Implement IDEInfo for Genrule module in genrule/genrule.go. - Implement IDEInfo for fileGroup module in android/filegroup.go. - Test codes for jdeps.go in java/jdeps_test.go. Bug: 111044346 Test: export SOONG_COLLECT_JAVA_DEPS=1;mmm packages/apps/Settings out/soong/module_bp_java_deps.json will be generated Change-Id: If61da77b4d7614c2c5da438b6af4c725ceccc5c3
Diffstat (limited to 'genrule')
-rw-r--r--genrule/genrule.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 8fedc607..e3823c5c 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -344,6 +344,17 @@ func (g *Module) generateSourceFile(ctx android.ModuleContext, task generateTask
g.outputDeps = append(g.outputDeps, task.out[0])
}
+// Collect information for opening IDE project files in java/jdeps.go.
+func (g *Module) IDEInfo(dpInfo *android.IdeInfo) {
+ dpInfo.Srcs = append(dpInfo.Srcs, g.Srcs().Strings()...)
+ for _, src := range g.properties.Srcs {
+ if strings.HasPrefix(src, ":") {
+ src = strings.Trim(src, ":")
+ dpInfo.Deps = append(dpInfo.Deps, src)
+ }
+ }
+}
+
func generatorFactory(taskGenerator taskFunc, props ...interface{}) *Module {
module := &Module{
taskGenerator: taskGenerator,