platform_build_soong/android
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
..
soongconfig Fix nested properties in soong config structs 2021-03-05 17:26:37 -08:00
Android.bp Merge "Refactor and cleanup of cquery processing" 2021-03-16 21:12:01 +00:00
android_test.go Add test fixture support 2021-02-26 23:01:50 +00:00
androidmk.go Add preparer for test to use AndroidMk 2021-03-11 15:04:43 +00:00
androidmk_test.go Add ctx to AndroidMkExtraEntriesFunc 2021-02-19 23:05:40 +00:00
apex.go Prevent ApexInfoMutator from creating unnecessary variants 2021-03-18 09:05:28 +00:00
apex_test.go Export dex implementation jars from prebuilt_apex 2021-01-15 18:14:10 +00:00
api_levels.go cc: fix version macro for stubs 2021-02-05 11:27:57 +09:00
arch.go bp2build: add configurable attribute (select) support. 2021-02-26 05:17:54 -05:00
arch_list.go [arm64] Build NDK with PAuth and BTI 2021-01-26 08:15:07 +01:00
arch_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
bazel.go Support autoconverted modules in mixed builds 2021-03-16 15:11:49 -04:00
bazel_handler.go Embed minibp into soong_ui. 2021-03-17 08:35:52 +01:00
config.go Fix writing soong.variables . 2021-03-17 16:35:13 +01:00
config_test.go Fix writing soong.variables . 2021-03-17 16:35:13 +01:00
csuite_config.go Add ctx to AndroidMkExtraEntriesFunc 2021-02-19 23:05:40 +00:00
csuite_config_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
deapexer.go Export dex implementation jars from prebuilt_apex 2021-01-15 18:14:10 +00:00
defaults.go Revert^2 "Add ability to declare licenses in soong." 2021-01-06 20:48:24 -08:00
defaults_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
defs.go Make common dependencies of lint use restat 2021-03-04 10:00:09 -08:00
depset_generic.go Reimplement DepSet as a wrapper around a generic implementation 2020-12-07 12:27:50 -08:00
depset_paths.go Reimplement DepSet as a wrapper around a generic implementation 2020-12-07 12:27:50 -08:00
depset_test.go Reimplement DepSet as a wrapper around a generic implementation 2020-12-07 12:27:50 -08:00
deptag.go Annotate dependency tags for dependencies of installed files 2020-11-23 18:06:08 -08:00
deptag_test.go Annotate dependency tags for dependencies of installed files 2020-11-23 18:06:08 -08:00
env.go Make it possible to debug soong_ui. 2021-03-08 08:27:58 +01:00
expand.go
expand_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
filegroup.go Add test fixture support 2021-02-26 23:01:50 +00:00
fixture.go Use test specific build dir when needed 2021-03-16 12:35:04 +00:00
fixture_test.go Stop android package depending on testing.T being embedded in TestResult 2021-03-12 14:26:04 +00:00
hooks.go
image.go Add vendor-ramdisk image to Soong. 2020-10-22 10:26:26 -07:00
license.go Reformat license code to comply with preupload checks 2021-03-04 22:35:29 +00:00
license_kind.go Revert^2 "Add ability to declare licenses in soong." 2021-01-06 20:48:24 -08:00
license_kind_test.go Convert license tests to use test fixtures 2021-03-09 21:19:22 +00:00
license_test.go Convert license tests to use test fixtures 2021-03-09 21:19:22 +00:00
licenses.go Reformat license code to comply with preupload checks 2021-03-04 22:35:29 +00:00
licenses_test.go Stop android package depending on testing.T being embedded in TestResult 2021-03-12 14:26:04 +00:00
makefile_goal.go Remove AndroidMkExtraFootersFunc entries param. 2020-12-07 10:23:54 -08:00
makevars.go Add a new SingletonModule type 2021-01-07 17:19:27 -08:00
metrics.go
module.go init_rc and vintf_fragments appear in PackagingSpecs() 2021-03-03 22:31:09 +09:00
module_test.go Expand dist property checks to cover dists 2020-11-27 15:17:44 +00:00
mutator.go Separate the collation of mutators from registration 2021-03-07 12:33:07 +00:00
mutator_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
namespace.go getNamespacesToSearchForModule to use blueprint.Namespace 2020-12-21 18:40:53 +00:00
namespace_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
neverallow.go Allow service-media-s in apex 2021-01-21 02:21:23 +00:00
neverallow_test.go Allow service-media-s in apex 2021-01-21 02:21:23 +00:00
ninja_deps.go Store ninja file deps from PackageVarContext in the config 2020-11-17 10:50:19 -08:00
ninja_deps_test.go Store ninja file deps from PackageVarContext in the config 2020-11-17 10:50:19 -08:00
notices.go
onceper.go
onceper_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
override_module.go Run "prebuilt_postdeps" mutator again 2021-03-09 11:23:46 +09:00
package.go Add error handling to test fixtures 2021-03-02 20:17:19 +00:00
package_ctx.go Store ninja file deps from PackageVarContext in the config 2020-11-17 10:50:19 -08:00
package_test.go Revert^2 "Add ability to declare licenses in soong." 2021-01-06 20:48:24 -08:00
packaging.go Merge changes I0f746a11,I08e61a24 2021-02-03 10:01:39 +00:00
packaging_test.go Merge changes I0f746a11,I08e61a24 2021-02-03 10:01:39 +00:00
path_properties.go Lineage properties support module references. 2021-03-09 15:14:34 -08:00
path_properties_test.go Lineage properties support module references. 2021-03-09 15:14:34 -08:00
paths.go Support autoconverted modules in mixed builds 2021-03-16 15:11:49 -04:00
paths_test.go Add (String)Path(s)RelativeToTop and assert functions 2021-03-16 12:23:56 +00:00
phony.go Refactor 'in_make' to mean Kati is not skipped. 2020-11-23 00:29:18 -05:00
prebuilt.go Remove deapexer and prebuilt apex select mutators 2021-03-01 17:11:25 +00:00
prebuilt_build_tool.go SOONG_* variables are emitted only for the BuildOS variants 2020-12-17 19:31:17 +09:00
prebuilt_test.go Add error handling to test fixtures 2021-03-02 20:17:19 +00:00
proto.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
queryview.go Really fix queryview. 2021-03-09 09:37:53 +01:00
register.go Separate the collation of singletons from registration 2021-03-08 22:40:32 +00:00
rule_builder.go Remove unescaped spans support from RuleBuilder 2021-03-16 16:53:20 -07:00
rule_builder_test.go Remove unescaped spans support from RuleBuilder 2021-03-16 16:53:20 -07:00
sandbox.go cd to / before running soong_build . 2021-03-03 09:14:22 +01:00
sdk.go Export implementation class jars for java_boot_libs 2021-02-05 13:35:25 +00:00
singleton.go Add symlink_outputs support to Soong. 2020-10-19 01:26:50 -04:00
singleton_module.go Add a new SingletonModule type 2021-01-07 17:19:27 -08:00
singleton_module_test.go Add a new SingletonModule type 2021-01-07 17:19:27 -08:00
soong_config_modules.go Add conditions_default for soong config variables. 2021-01-21 14:25:20 -05:00
soong_config_modules_test.go Add conditions_default for soong config variables. 2021-01-21 14:25:20 -05:00
test_asserts.go Add AssertIntEquals 2021-03-17 17:55:00 +00:00
test_suites.go Add explicit rspfile argument to RuleBuilderCommand.FlagWithRspFileInputList 2021-03-16 16:52:56 -07:00
testing.go Add (String)Path(s)RelativeToTop and assert functions 2021-03-16 12:23:56 +00:00
util.go Change default DEFAULT_TIDY_HEADER_DIRS to empty 2021-02-12 13:50:38 -08:00
util_test.go Reimplement DepSet as a wrapper around a generic implementation 2020-12-07 12:27:50 -08:00
variable.go Fix writing soong.variables . 2021-03-17 16:35:13 +01:00
variable_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
visibility.go Simplify preparers now that tests use consistent registration order 2021-03-09 14:14:48 +00:00
visibility_test.go Stop android package depending on testing.T being embedded in TestResult 2021-03-12 14:26:04 +00:00
writedocs.go Fix writedocs. 2021-03-11 08:37:01 +01:00