summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2025-02-25 12:55:33 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-02-25 12:55:33 -0800
commitd272a622e908736b01bf731dc653aadc47c64971 (patch)
tree35ddbe0592ca3f0a703c2d39b8747729590e809d /android/module.go
parent89dab88cc55d9ab0ff85d0a30780ad182cdaf214 (diff)
parent2a815b6d8ea8f29b54f780b1219c28b0c8c977aa (diff)
Merge "Convert the following singletons to use ModuleProxy:" into main
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/android/module.go b/android/module.go
index d387c2cf3..f0520c7d7 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1928,6 +1928,7 @@ type CommonModuleInfo struct {
TargetRequiredModuleNames []string
VintfFragmentModuleNames []string
Dists []Dist
+ ExportedToMake bool
}
type ApiLevelOrPlatform struct {
@@ -2287,6 +2288,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
TargetRequiredModuleNames: m.module.TargetRequiredModuleNames(),
VintfFragmentModuleNames: m.module.VintfFragmentModuleNames(ctx),
Dists: m.Dists(),
+ ExportedToMake: m.ExportedToMake(),
}
if mm, ok := m.module.(interface {
MinSdkVersion(ctx EarlyModuleContext) ApiLevel
@@ -2357,6 +2359,10 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
GeneratedDeps: s.GeneratedDeps(),
})
}
+
+ if v, ok := m.module.(ModuleMakeVarsProvider); m.Enabled(ctx) && ok {
+ SetProvider(ctx, ModuleMakeVarsInfoProvider, v.MakeVars(ctx))
+ }
}
func SetJarJarPrefixHandler(handler func(ModuleContext)) {
@@ -2873,6 +2879,8 @@ func OutputFilesForModule(ctx PathContext, module Module, tag string) Paths {
// OutputFileForModule returns the output file paths with the given tag. On error, including if the
// module produced zero or multiple paths, it reports errors to the ctx and returns nil.
+// TODO(b/397766191): Change the signature to take ModuleProxy
+// Please only access the module's internal data through providers.
func OutputFileForModule(ctx PathContext, module Module, tag string) Path {
paths, err := outputFilesForModule(ctx, module, tag)
if err != nil {
@@ -2913,6 +2921,8 @@ type OutputFilesProviderModuleContext interface {
EqualModules(m1, m2 Module) bool
}
+// TODO(b/397766191): Change the signature to take ModuleProxy
+// Please only access the module's internal data through providers.
func outputFilesForModule(ctx PathContext, module Module, tag string) (Paths, error) {
outputFilesFromProvider, err := outputFilesForModuleFromProvider(ctx, module, tag)
if outputFilesFromProvider != nil || err != OutputFilesProviderNotSet {
@@ -3058,7 +3068,7 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx SingletonContext) {
modulesInDir := make(map[string]Paths)
- ctx.VisitAllModules(func(module Module) {
+ ctx.VisitAllModuleProxies(func(module ModuleProxy) {
info := OtherModuleProviderOrDefault(ctx, module, FinalModuleBuildTargetsProvider)
if info.CheckbuildTarget != nil {