Add path properties mutator
Add a mutator pass after DepsMutator that visits every property
struct in every module looking for properties that have a tag
`android:"path"`, and automatically add a SourceDepTag dependency
on any module references (":module-name") found. Uses a cache to
store the mapping of property struct type to locations of
properties with the tag.
Test: android/path_properties_test.go
Change-Id: I38c0497843dde4890e9342c3a6f0b402c0720742
diff --git a/android/module.go b/android/module.go
index 218df22..1e6cc83 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1437,7 +1437,7 @@
if m := SrcIsModule(e); m != "" {
module := ctx.GetDirectDepWithTag(m, SourceDepTag)
if module == nil {
- // Error will have been handled by ExtractSourcesDeps
+ ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
continue
}
if srcProducer, ok := module.(SourceFileProducer); ok {
@@ -1454,7 +1454,7 @@
if m := SrcIsModule(s); m != "" {
module := ctx.GetDirectDepWithTag(m, SourceDepTag)
if module == nil {
- // Error will have been handled by ExtractSourcesDeps
+ ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
continue
}
if srcProducer, ok := module.(SourceFileProducer); ok {