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
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user