Revert^2 "Convert cc modules to use AndroidMkInfoProvider."
This reverts commit 37e6794ad44926e64c1f733dbe32bbf5a40efe77.
Reason for revert: reland with fix to the test
Bug: 358427516
Test: Unit tests and manually compare generated mk files.
Change-Id: Iddc34471f15cfe0c8ed863d05a1344e295925565
diff --git a/android/module.go b/android/module.go
index 6ef5c6a..1148430 100644
--- a/android/module.go
+++ b/android/module.go
@@ -549,6 +549,13 @@
}
}
+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
@@ -2091,6 +2098,10 @@
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)) {