Lift BazelHandler interface into android/

Because it's commonly useful and not cc/ specific
Also export GenerateBazelBuildActions and update uses

Test: Existing tests pass
Change-Id: Ibc6858bb1129afba181a7686dda432defe33b00d
This commit is contained in:
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
2021-08-11 16:46:13 +00:00
parent adffbe9166
commit 0d99045b69
8 changed files with 29 additions and 27 deletions

View File

@@ -57,6 +57,17 @@ type cqueryKey struct {
archType ArchType
}
// bazelHandler is the interface for a helper object related to deferring to Bazel for
// processing a module (during Bazel mixed builds). Individual module types should define
// their own bazel handler if they support deferring to Bazel.
type BazelHandler interface {
// Issue query to Bazel to retrieve information about Bazel's view of the current module.
// If Bazel returns this information, set module properties on the current module to reflect
// the returned information.
// Returns true if information was available from Bazel, false if bazel invocation still needs to occur.
GenerateBazelBuildActions(ctx ModuleContext, label string) bool
}
type BazelContext interface {
// The below methods involve queuing cquery requests to be later invoked
// by bazel. If any of these methods return (_, false), then the request