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:
Brandon Lee
2018-08-15 15:35:38 -07:00
committed by Colin Cross
parent cfbea98a57
commit 5d45c6f6f8
6 changed files with 278 additions and 0 deletions

View File

@@ -1547,3 +1547,27 @@ func (s AndroidModulesByName) Less(i, j int) bool {
}
}
func (s AndroidModulesByName) Swap(i, j int) { s.slice[i], s.slice[j] = s.slice[j], s.slice[i] }
// Collect information for opening IDE project files in java/jdeps.go.
type IDEInfo interface {
IDEInfo(ideInfo *IdeInfo)
BaseModuleName() string
}
// Extract the base module name from the Import name.
// Often the Import name has a prefix "prebuilt_".
// Remove the prefix explicitly if needed
// until we find a better solution to get the Import name.
type IDECustomizedModuleName interface {
IDECustomizedModuleName() string
}
type IdeInfo struct {
Deps []string `json:"dependencies,omitempty"`
Srcs []string `json:"srcs,omitempty"`
Aidl_include_dirs []string `json:"aidl_include_dirs,omitempty"`
Jarjar_rules []string `json:"jarjar_rules,omitempty"`
Jars []string `json:"jars,omitempty"`
Classes []string `json:"class,omitempty"`
Installed_paths []string `json:"installed,omitempty"`
}