platform_build_soong/apex
Paul Duffin 573989d821 Prevent ApexInfoMutator from creating unnecessary variants
Adds the AlwaysRequireApexVariantTag interface to enable
ApexInfoMutator to differentiate between a tag that is excluded from
apex contents but still requires an apex variant and a tag that is
excluded from apex contents and does not require an apex variant.

That is needed to support the sdkMemberVersionedDepTag which excludes
the target from being added to the APEX but requires an APEX variant.
A more detailed explanation is in the comments.

The AlwaysRequireApexVariant() method follows the pattern used in
ReplaceSourceWithPrebuilt of having a method that returns a bool to
trigger the behavior and not say ExcludeFromApexContentsTag that simply
relies on the tag implementing an interface to trigger. That is because
the former is more flexible and allows a tag type to parameterize the
behavior if necessary.

The tags that this will exclude from creating an apex variant are:
* PrebuiltDepTag - by the time the apex variant has been created any
  preferred prebuilts will have replaced the sources so there is no
  need to create an APEX variant if the only dependency path from the
  APEX to the prebuilt is via this tag.
* hiddenApiAnnotationsDependencyTag - the target of which is a purely
  build time artifect and MUST NEVER end up in the APEX.

It will also stop calling DepIsInSameApex for any dependency created
by the sdkMemberVersionedDepTag. Which will fix the issue reported in
the bug.

Bug: 182992071
Test: m nothing
Change-Id: I9569e488d6446ca45d3ea8f32a9b74524eb865df
2021-03-18 09:05:28 +00:00
..
Android.bp Add apexFixtureFactory to apex package 2021-03-11 17:25:29 +00:00
OWNERS Remove myself from the OWNERS 2021-03-03 08:21:17 -08:00
TEST_MAPPING Add TEST_MAPPING for build/soong/apex 2019-08-07 17:33:24 +09:00
allowed_deps.txt Merge "Add libruy_static to allowed_deps" 2021-03-12 14:00:45 +00:00
androidmk.go Merge "Revert "Revert "Automated NDK API coverage used by Mainline modules build integration.""" 2021-01-26 00:13:46 +00:00
apex.go Prevent ApexInfoMutator from creating unnecessary variants 2021-03-18 09:05:28 +00:00
apex_singleton.go Add PHONY for apex-allowed-deps check. 2020-11-04 20:50:03 +00:00
apex_test.go Add new compat_configs property to the apex 2021-03-15 23:19:36 +00:00
boot_image_test.go Merge "Remove extra return value from testApex" 2021-03-08 18:16:23 +00:00
builder.go Don't track modules that are only available to APEXes. 2021-03-11 18:13:18 +00:00
deapexer.go Remove deapexer and prebuilt apex select mutators 2021-03-01 17:11:25 +00:00
key.go Extract apex registration code into function for reuse 2021-03-09 23:03:40 +00:00
prebuilt.go Remove deapexer and prebuilt apex select mutators 2021-03-01 17:11:25 +00:00
testing.go Add apexFixtureFactory to apex package 2021-03-11 17:25:29 +00:00
vndk.go Remove global state from VNDK apexes 2021-03-02 12:23:16 -08:00
vndk_test.go Merge "Remove extra return value from testApex" 2021-03-08 18:16:23 +00:00