Merge "Lift BazelHandler interface into android/" am: ccb6a01324
am: 4e088148d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1793169 Change-Id: I4ed98cbd30139e5c2d91164c3447ef295970ae17
This commit is contained in:
committed by
Automerger Merge Worker
commit
3079d96120
@@ -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
|
||||
|
@@ -15,8 +15,9 @@
|
||||
package android
|
||||
|
||||
import (
|
||||
"android/soong/bazel"
|
||||
"strings"
|
||||
|
||||
"android/soong/bazel"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -108,7 +109,7 @@ func FileGroupFactory() Module {
|
||||
return module
|
||||
}
|
||||
|
||||
func (fg *fileGroup) generateBazelBuildActions(ctx ModuleContext) bool {
|
||||
func (fg *fileGroup) GenerateBazelBuildActions(ctx ModuleContext) bool {
|
||||
if !fg.MixedBuildsEnabled(ctx) {
|
||||
return false
|
||||
}
|
||||
@@ -131,7 +132,7 @@ func (fg *fileGroup) generateBazelBuildActions(ctx ModuleContext) bool {
|
||||
}
|
||||
|
||||
func (fg *fileGroup) GenerateAndroidBuildActions(ctx ModuleContext) {
|
||||
if fg.generateBazelBuildActions(ctx) {
|
||||
if fg.GenerateBazelBuildActions(ctx) {
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user