This change fixes a bug that android:path attribute is ignored when
annotated field is in a slice of struct.
blueprint now traverses fields whose type is slice of struct and
provides the index list in the case. Soong is modified so that it checks
whether the field being referenced is a slice of struct or not. If that
is the case, it gathers field values from each of the elements. If not,
it follows the original path.
Bug: 181018147
Test: m nothing
Change-Id: I220efb6feaa525a00939654459b2998e98e7ad56
The documentation java_genrule_host states that it creates a single
variant, which would make it work with the single variant fallback
in AddDependency used by the data property, but it actually has a host
and a host-cross windows variant. Modify osMutator to take the
OS-specific enabled properties into account to skip creating variants
that will immediately be disabled so there is a single variant.
Test: m checkbuild
Change-Id: Ic2daab29f4fa3a3797d7a08348fbfcf1036ec5dc
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
There are cases where a module needs to refer to an intermediate
output of another module instead of its final output. For example,
a module may want to use the .jar containing .class files from
another module whose final output is a .jar containing classes.dex
files. Support a new ":module{.tag}" format in any property that
is annotated with `android:"path"`, which will query the target
module for its ".tag" output(s).
Test: path_properties_test.go, paths_test.go
Test: no unexpected changes in build.ninja
Change-Id: Icd3c9b0d83ff125771767c04046fcffb9fc3f65a
When extracting dependencies from properties tagged with
`android:"path"`, only look at the general property structs
and not the arch-specific ones. The necessary arch-specific
values will be appended into the general property structs.
Fixes: 128377112
Test: path_properties_test.go
Change-Id: I35e35555d5b15473229a7458fcfc2c7dacaec889
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