Loading android/bazel_handler.go +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading android/filegroup.go +4 −3 Original line number Diff line number Diff line Loading @@ -15,8 +15,9 @@ package android import ( "android/soong/bazel" "strings" "android/soong/bazel" ) func init() { Loading Loading @@ -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 } Loading @@ -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 } Loading cc/cc.go +2 −13 Original line number Diff line number Diff line Loading @@ -589,17 +589,6 @@ type installer interface { installInRoot() bool } // 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 android.ModuleContext, label string) bool } type xref interface { XrefCcFiles() android.Paths } Loading Loading @@ -796,7 +785,7 @@ type Module struct { compiler compiler linker linker installer installer bazelHandler bazelHandler bazelHandler android.BazelHandler features []feature stl *stl Loading Loading @@ -1696,7 +1685,7 @@ func (c *Module) maybeGenerateBazelActions(actx android.ModuleContext) bool { bazelModuleLabel := c.GetBazelLabel(actx, c) bazelActionsUsed := false if c.MixedBuildsEnabled(actx) && c.bazelHandler != nil { bazelActionsUsed = c.bazelHandler.generateBazelBuildActions(actx, bazelModuleLabel) bazelActionsUsed = c.bazelHandler.GenerateBazelBuildActions(actx, bazelModuleLabel) } return bazelActionsUsed } Loading cc/library.go +2 −2 Original line number Diff line number Diff line Loading @@ -556,7 +556,7 @@ type libraryDecorator struct { } type ccLibraryBazelHandler struct { bazelHandler android.BazelHandler module *Module } Loading Loading @@ -642,7 +642,7 @@ func getTocFile(ctx android.ModuleContext, label string, outputFiles []string) a return android.OptionalPathForPath(android.PathForBazelOut(ctx, tocFile)) } func (handler *ccLibraryBazelHandler) generateBazelBuildActions(ctx android.ModuleContext, label string) bool { func (handler *ccLibraryBazelHandler) GenerateBazelBuildActions(ctx android.ModuleContext, label string) bool { bazelCtx := ctx.Config().BazelContext ccInfo, ok, err := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType) if err != nil { Loading cc/library_headers.go +2 −2 Original line number Diff line number Diff line Loading @@ -44,13 +44,13 @@ func RegisterLibraryHeadersBuildComponents(ctx android.RegistrationContext) { } type libraryHeaderBazelHander struct { bazelHandler android.BazelHandler module *Module library *libraryDecorator } func (h *libraryHeaderBazelHander) generateBazelBuildActions(ctx android.ModuleContext, label string) bool { func (h *libraryHeaderBazelHander) GenerateBazelBuildActions(ctx android.ModuleContext, label string) bool { bazelCtx := ctx.Config().BazelContext ccInfo, ok, err := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType) if err != nil { Loading Loading
android/bazel_handler.go +11 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
android/filegroup.go +4 −3 Original line number Diff line number Diff line Loading @@ -15,8 +15,9 @@ package android import ( "android/soong/bazel" "strings" "android/soong/bazel" ) func init() { Loading Loading @@ -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 } Loading @@ -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 } Loading
cc/cc.go +2 −13 Original line number Diff line number Diff line Loading @@ -589,17 +589,6 @@ type installer interface { installInRoot() bool } // 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 android.ModuleContext, label string) bool } type xref interface { XrefCcFiles() android.Paths } Loading Loading @@ -796,7 +785,7 @@ type Module struct { compiler compiler linker linker installer installer bazelHandler bazelHandler bazelHandler android.BazelHandler features []feature stl *stl Loading Loading @@ -1696,7 +1685,7 @@ func (c *Module) maybeGenerateBazelActions(actx android.ModuleContext) bool { bazelModuleLabel := c.GetBazelLabel(actx, c) bazelActionsUsed := false if c.MixedBuildsEnabled(actx) && c.bazelHandler != nil { bazelActionsUsed = c.bazelHandler.generateBazelBuildActions(actx, bazelModuleLabel) bazelActionsUsed = c.bazelHandler.GenerateBazelBuildActions(actx, bazelModuleLabel) } return bazelActionsUsed } Loading
cc/library.go +2 −2 Original line number Diff line number Diff line Loading @@ -556,7 +556,7 @@ type libraryDecorator struct { } type ccLibraryBazelHandler struct { bazelHandler android.BazelHandler module *Module } Loading Loading @@ -642,7 +642,7 @@ func getTocFile(ctx android.ModuleContext, label string, outputFiles []string) a return android.OptionalPathForPath(android.PathForBazelOut(ctx, tocFile)) } func (handler *ccLibraryBazelHandler) generateBazelBuildActions(ctx android.ModuleContext, label string) bool { func (handler *ccLibraryBazelHandler) GenerateBazelBuildActions(ctx android.ModuleContext, label string) bool { bazelCtx := ctx.Config().BazelContext ccInfo, ok, err := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType) if err != nil { Loading
cc/library_headers.go +2 −2 Original line number Diff line number Diff line Loading @@ -44,13 +44,13 @@ func RegisterLibraryHeadersBuildComponents(ctx android.RegistrationContext) { } type libraryHeaderBazelHander struct { bazelHandler android.BazelHandler module *Module library *libraryDecorator } func (h *libraryHeaderBazelHander) generateBazelBuildActions(ctx android.ModuleContext, label string) bool { func (h *libraryHeaderBazelHander) GenerateBazelBuildActions(ctx android.ModuleContext, label string) bool { bazelCtx := ctx.Config().BazelContext ccInfo, ok, err := bazelCtx.GetCcInfo(label, ctx.Arch().ArchType) if err != nil { Loading