Wrap blueprint_go_binary and bootstrap_go_package into android.Modules
Depending on a blueprint_go_binary from a Soong module requires hacks
that allow Soong to support both blueprint.Module and android.Module.
Wrap the blueprint Go module types with ones that implement
android.Module, and delete all the related hacks.
Bug: 319288033
Test: m checkbuild
Flag: EXEMPT refactor
Change-Id: I9b62b450de09bd10288333fbc66aa71c867ae0b3
diff --git a/android/module_context.go b/android/module_context.go
index 54fe0be..2bf2a8f 100644
--- a/android/module_context.go
+++ b/android/module_context.go
@@ -85,7 +85,9 @@
type ModuleContext interface {
BaseModuleContext
- blueprintModuleContext() blueprint.ModuleContext
+ // BlueprintModuleContext returns the blueprint.ModuleContext that the ModuleContext wraps. It may only be
+ // used by the golang module types that need to call into the bootstrap module types.
+ BlueprintModuleContext() blueprint.ModuleContext
// Deprecated: use ModuleContext.Build instead.
ModuleBuild(pctx PackageContext, params ModuleBuildParams)
@@ -779,7 +781,7 @@
m.uncheckedModule = true
}
-func (m *moduleContext) blueprintModuleContext() blueprint.ModuleContext {
+func (m *moduleContext) BlueprintModuleContext() blueprint.ModuleContext {
return m.bp
}