summaryrefslogtreecommitdiff
path: root/android/module.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2024-10-15 20:45:35 +0000
committer Yu Liu <yudiliu@google.com> 2024-10-15 21:03:29 +0000
commit5640008749795a6ebfb2680e28daa6b067207ce8 (patch)
treed328801cd3f706edfc14d003ba5a942aa1ff2d6a /android/module.go
parent0636fa36fbc7cbe49c75f0864456a5db155ef956 (diff)
Convert cc modules to use AndroidMkInfoProvider.
Bug: 358427516 Test: Unit tests and manually compare generated mk files. Change-Id: I90d8ecb3580d6324ed53212d01d7c24b6e4bb700
Diffstat (limited to 'android/module.go')
-rw-r--r--android/module.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/android/module.go b/android/module.go
index 8415118cb..197953679 100644
--- a/android/module.go
+++ b/android/module.go
@@ -539,6 +539,13 @@ func (t *CommonTestOptions) SetAndroidMkEntries(entries *AndroidMkEntries) {
}
}
+func (t *CommonTestOptions) SetAndroidMkInfoEntries(entries *AndroidMkInfo) {
+ entries.SetBoolIfTrue("LOCAL_IS_UNIT_TEST", Bool(t.Unit_test))
+ if len(t.Tags) > 0 {
+ entries.AddStrings("LOCAL_TEST_OPTIONS_TAGS", t.Tags...)
+ }
+}
+
// The key to use in TaggedDistFiles when a Dist structure does not specify a
// tag property. This intentionally does not use "" as the default because that
// would mean that an empty tag would have a different meaning when used in a dist
@@ -2076,6 +2083,10 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
SetProvider(ctx, HostToolProviderKey, HostToolProviderData{
HostToolPath: h.HostToolPath()})
}
+
+ if p, ok := m.module.(AndroidMkProviderInfoProducer); ok && !shouldSkipAndroidMkProcessing(ctx, m) {
+ SetProvider(ctx, AndroidMkInfoProvider, p.PrepareAndroidMKProviderInfo(ctx.Config()))
+ }
}
func SetJarJarPrefixHandler(handler func(ModuleContext)) {