platform_build_soong/sdk
Spandan Das 3576e769a4 Handle installation rules for co-existing prebuilts
Every module belonging to a single mainline module family will be
hidden from make, except the one which has been flagged using
apex_contributions

Details
- Introduce a new `source_apex_name` property to prebuilt_apex and
  override_apex. This property will be used to identify the source
  equivalent of a prebuilt soong apex module.
- Create an N-ary tree from source to prebuilt(s). The tree wil be
  rooted at the source module.
- In a subsequent mutator, visit every node in the tree(s). Query
  apex_contributions and store the handle of the node which is "active"
  (if any)
- In the same mutator, do another pass over the tree. Invoke
  `HideFromMake` on every node which is not "active". The two-pass
  approach is needed PrebuiltSelectionInfoProvider does not know about
  the inter source-prebuilt dependency, this dependency can only be
  known by doing a graph walk of the N-ary tree.

Some tangential implementation details
- Each prebuilt apex has an internal deapxer module that is responsible
  for generating the deapex ninja rules. The name of this internal
  module uses the BaseModuleName (without the prebuilt_ prefix). Since
  we can have multiple prebuilt soong modules in trunk stable, change
  this to follow the name of the prebuilt module in order to avoid name
  collisions. Update existing unit tests accordingly

Bug: 316179314
Test: go test ./apex -run TestInstallationRulesForMultipleApexPrebuilts
Test: m nothing --no-skip-soong-tests
Test: presubmits

Change-Id: I58aa99d5e6a9859954614e6db9a8e9e2e581642d
2024-01-11 02:02:59 +00:00
..
Android.bp Add sdk_genrule 2023-12-13 14:11:24 -08:00
bootclasspath_fragment_sdk_test.go Handle installation rules for co-existing prebuilts 2024-01-11 02:02:59 +00:00
bp.go don't export systemserverclasspath_fragment if contents are empty 2023-06-30 15:25:16 -04:00
bp_test.go Replace AssertPanic with AssertPanicMessageContains 2021-03-20 12:08:51 +00:00
build_release.go Add UpsideDownCake to the releases for which snapshots can be built 2022-09-30 09:41:08 +01:00
build_release_test.go Add UpsideDownCake to the releases for which snapshots can be built 2022-09-30 09:41:08 +01:00
cc_sdk_test.go Remove support for generating versioned snapshots 2022-05-24 20:10:05 +00:00
compat_config_sdk_test.go Export any platform_compat_config used by apex to sdk snapshot 2022-07-20 14:18:24 +00:00
exports.go Remove support for generating versioned snapshots 2022-05-24 20:10:05 +00:00
exports_test.go Remove support for generating versioned snapshots 2022-05-24 20:10:05 +00:00
genrule.go Add sdk_genrule 2023-12-13 14:11:24 -08:00
genrule_test.go Add sdk_genrule 2023-12-13 14:11:24 -08:00
java_sdk_test.go Generate "exportable" stubs in droidstubs 2024-01-08 07:56:07 +00:00
license_sdk_test.go Remove support for generating versioned snapshots 2022-05-24 20:10:05 +00:00
member_trait.go Reformat build/soong for go 1.19 2022-08-17 10:43:13 -07:00
member_trait_test.go Remove support for generating versioned snapshots 2022-05-24 20:10:05 +00:00
member_type.go Reformat build/soong for go 1.19 2022-08-17 10:43:13 -07:00
sdk.go Add sdk_genrule 2023-12-13 14:11:24 -08:00
sdk_test.go Generate "exportable" stubs in droidstubs 2024-01-08 07:56:07 +00:00
systemserverclasspath_fragment_sdk_test.go partial systemserverclasspath snapshot test 2023-09-05 22:06:22 +00:00
testing.go Add current build release 2022-08-19 17:39:49 +00:00
update.go Convert OtherModuleProvider to generic providers API 2023-12-14 16:12:22 -08:00