diff options
author | 2019-07-15 13:35:21 -0700 | |
---|---|---|
committer | 2019-07-16 09:52:23 -0700 | |
commit | 527f3e5511061568e9b98cecd1299f490f836ee8 (patch) | |
tree | 1c3a4be487b1f5cc5a00b6cdd8637120a2f9c019 /android/path_properties.go | |
parent | ae1131863338f8b5d9d0f58eab302514b6f78654 (diff) |
Dedup path properties across property structs
Listing a property in multiple property structs would cause it to
add multiple dependencies with the same dependency tag, which would
trip the panic in getDirectDepInternal when calling
PathForModuleSrc. Dedup the properties with the android:"path"
struct tag across all property structs.
Test: path_properties_test.go
Change-Id: Ib6c0e7789443d340ee7551721df0135c5ee64c0f
Diffstat (limited to 'android/path_properties.go')
-rw-r--r-- | android/path_properties.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/android/path_properties.go b/android/path_properties.go index af7af5940..6b1cdb308 100644 --- a/android/path_properties.go +++ b/android/path_properties.go @@ -35,16 +35,17 @@ func pathDepsMutator(ctx BottomUpMutatorContext) { props := m.base().generalProperties + var pathProperties []string for _, ps := range props { - pathProperties := pathPropertiesForPropertyStruct(ctx, ps) - pathProperties = FirstUniqueStrings(pathProperties) + pathProperties = append(pathProperties, pathPropertiesForPropertyStruct(ctx, ps)...) + } - for _, s := range pathProperties { - if m, t := SrcIsModuleWithTag(s); m != "" { - ctx.AddDependency(ctx.Module(), sourceOrOutputDepTag(t), m) - } - } + pathProperties = FirstUniqueStrings(pathProperties) + for _, s := range pathProperties { + if m, t := SrcIsModuleWithTag(s); m != "" { + ctx.AddDependency(ctx.Module(), sourceOrOutputDepTag(t), m) + } } } |