cc bazel handlers: use better interface checking
This is a far better approach for ensuring that bazel handlers implement the BazelHandler interface, as it causes a compile error if they do not implement the appropriate interface methods. Test: Manually verified no change in ninja file Change-Id: I63a4f8b57e3aedd4c0915c2fd2eb7029e9a993aa
This commit is contained in:
@@ -563,11 +563,11 @@ func (binary *binaryDecorator) verifyHostBionicLinker(ctx ModuleContext, in, lin
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ccBinaryBazelHandler struct {
|
type ccBinaryBazelHandler struct {
|
||||||
BazelHandler
|
|
||||||
|
|
||||||
module *Module
|
module *Module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ BazelHandler = (*ccBinaryBazelHandler)(nil)
|
||||||
|
|
||||||
func (handler *ccBinaryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
func (handler *ccBinaryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
||||||
bazelCtx := ctx.Config().BazelContext
|
bazelCtx := ctx.Config().BazelContext
|
||||||
bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKey(ctx))
|
bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKey(ctx))
|
||||||
|
@@ -642,11 +642,11 @@ type libraryDecorator struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ccLibraryBazelHandler struct {
|
type ccLibraryBazelHandler struct {
|
||||||
BazelHandler
|
|
||||||
|
|
||||||
module *Module
|
module *Module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ BazelHandler = (*ccLibraryBazelHandler)(nil)
|
||||||
|
|
||||||
// generateStaticBazelBuildActions constructs the StaticLibraryInfo Soong
|
// generateStaticBazelBuildActions constructs the StaticLibraryInfo Soong
|
||||||
// provider from a Bazel shared library's CcInfo provider.
|
// provider from a Bazel shared library's CcInfo provider.
|
||||||
func (handler *ccLibraryBazelHandler) generateStaticBazelBuildActions(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) {
|
func (handler *ccLibraryBazelHandler) generateStaticBazelBuildActions(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) {
|
||||||
|
@@ -49,12 +49,12 @@ func RegisterLibraryHeadersBuildComponents(ctx android.RegistrationContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type libraryHeaderBazelHandler struct {
|
type libraryHeaderBazelHandler struct {
|
||||||
BazelHandler
|
|
||||||
|
|
||||||
module *Module
|
module *Module
|
||||||
library *libraryDecorator
|
library *libraryDecorator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ BazelHandler = (*libraryHeaderBazelHandler)(nil)
|
||||||
|
|
||||||
func (handler *libraryHeaderBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
func (handler *libraryHeaderBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
||||||
bazelCtx := ctx.Config().BazelContext
|
bazelCtx := ctx.Config().BazelContext
|
||||||
bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
|
bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
|
||||||
|
@@ -47,11 +47,11 @@ type objectLinker struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type objectBazelHandler struct {
|
type objectBazelHandler struct {
|
||||||
BazelHandler
|
|
||||||
|
|
||||||
module *Module
|
module *Module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ BazelHandler = (*objectBazelHandler)(nil)
|
||||||
|
|
||||||
func (handler *objectBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
func (handler *objectBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
||||||
bazelCtx := ctx.Config().BazelContext
|
bazelCtx := ctx.Config().BazelContext
|
||||||
bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKey(ctx))
|
bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKey(ctx))
|
||||||
|
@@ -407,12 +407,12 @@ type prebuiltObjectLinker struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type prebuiltStaticLibraryBazelHandler struct {
|
type prebuiltStaticLibraryBazelHandler struct {
|
||||||
BazelHandler
|
|
||||||
|
|
||||||
module *Module
|
module *Module
|
||||||
library *libraryDecorator
|
library *libraryDecorator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ BazelHandler = (*prebuiltStaticLibraryBazelHandler)(nil)
|
||||||
|
|
||||||
func (h *prebuiltStaticLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
func (h *prebuiltStaticLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
||||||
bazelCtx := ctx.Config().BazelContext
|
bazelCtx := ctx.Config().BazelContext
|
||||||
bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
|
bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
|
||||||
@@ -458,12 +458,12 @@ func (h *prebuiltStaticLibraryBazelHandler) ProcessBazelQueryResponse(ctx androi
|
|||||||
}
|
}
|
||||||
|
|
||||||
type prebuiltSharedLibraryBazelHandler struct {
|
type prebuiltSharedLibraryBazelHandler struct {
|
||||||
BazelHandler
|
|
||||||
|
|
||||||
module *Module
|
module *Module
|
||||||
library *libraryDecorator
|
library *libraryDecorator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var _ BazelHandler = (*prebuiltSharedLibraryBazelHandler)(nil)
|
||||||
|
|
||||||
func (h *prebuiltSharedLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
func (h *prebuiltSharedLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
|
||||||
bazelCtx := ctx.Config().BazelContext
|
bazelCtx := ctx.Config().BazelContext
|
||||||
bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
|
bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
|
||||||
|
Reference in New Issue
Block a user