Populate java_api_libray's IDEInfo
Adding the srcjar to module_bp_java_deps.json is useful for IDE autocompletion of rdeps. Bug: 353806911 Test: cat out/soong/module_bp_java_deps.json | jq '."core.current.stubs.from-text"' { "dependencies": [ "stub-annotations" ], "srcjars": [ "out/soong/.intermediates/build/soong/java/core-libraries/core.current.stubs.from-text/android_common/metalava/core.current.stubs.from-text-stubs.srcjar" ], "path": [ "build/soong/java/core-libraries" ], "libs": [ "stub-annotations" ] } Change-Id: Ie4ad985a7da40b478453735dfdb10d0ac63ab8f4
This commit is contained in:
25
java/java.go
25
java/java.go
@@ -2386,10 +2386,35 @@ func (al *ApiLibrary) MinSdkVersion(ctx android.EarlyModuleContext) android.ApiL
|
|||||||
return android.FutureApiLevel
|
return android.FutureApiLevel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (al *ApiLibrary) IDEInfo(i *android.IdeInfo) {
|
||||||
|
i.Deps = append(i.Deps, al.ideDeps()...)
|
||||||
|
i.Libs = append(i.Libs, al.properties.Libs...)
|
||||||
|
i.Static_libs = append(i.Static_libs, al.properties.Static_libs...)
|
||||||
|
i.SrcJars = append(i.SrcJars, al.stubsSrcJar.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
// deps of java_api_library for module_bp_java_deps.json
|
||||||
|
func (al *ApiLibrary) ideDeps() []string {
|
||||||
|
ret := []string{}
|
||||||
|
ret = append(ret, al.properties.Libs...)
|
||||||
|
ret = append(ret, al.properties.Static_libs...)
|
||||||
|
if al.properties.System_modules != nil {
|
||||||
|
ret = append(ret, proptools.String(al.properties.System_modules))
|
||||||
|
}
|
||||||
|
if al.properties.Full_api_surface_stub != nil {
|
||||||
|
ret = append(ret, proptools.String(al.properties.Full_api_surface_stub))
|
||||||
|
}
|
||||||
|
// Other non java_library dependencies like java_api_contribution are ignored for now.
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
// implement the following interfaces for hiddenapi processing
|
// implement the following interfaces for hiddenapi processing
|
||||||
var _ hiddenAPIModule = (*ApiLibrary)(nil)
|
var _ hiddenAPIModule = (*ApiLibrary)(nil)
|
||||||
var _ UsesLibraryDependency = (*ApiLibrary)(nil)
|
var _ UsesLibraryDependency = (*ApiLibrary)(nil)
|
||||||
|
|
||||||
|
// implement the following interface for IDE completion.
|
||||||
|
var _ android.IDEInfo = (*ApiLibrary)(nil)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Java prebuilts
|
// Java prebuilts
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user