Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd3fd1da authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Populate java_api_libray's IDEInfo" into main

parents c7eb3bda 4ae68018
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -2386,10 +2386,35 @@ func (al *ApiLibrary) MinSdkVersion(ctx android.EarlyModuleContext) android.ApiL
	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
var _ hiddenAPIModule = (*ApiLibrary)(nil)
var _ UsesLibraryDependency = (*ApiLibrary)(nil)

// implement the following interface for IDE completion.
var _ android.IDEInfo = (*ApiLibrary)(nil)

//
// Java prebuilts
//