Use all_apex_contributions for source/prebuilts selection

This flattened singleton module explicitly lists by module name whether source or
prebuilt version of a module should be used. If a module appears in this
metadata module, it supersedes all other source vs prebuilts selection
mechanism

Implementation details
- Update the module dep chain from <source> --> <prebuilt> to <source>
  --> <prebuilt> --> all_apex_contributions
- all_apex_contributions sets a provider which is bubbled up
  to the source module. This requires changing `prebuilt_select` to a
  bottom up mutator
- Update `usePrebuilt` to consult the new provider before falling back
  to existing source vs selection mechanisms. If (foo|prebuilt_foo) is
  listed in the selected `apex_contributions` modules, it
  will be used superseding any other selection mechanisms.
- Update this depTag to IsMetaDepTag so that bootclasspath_fragment's
  validation ignores this new dependency.

Test: Added unit tests to assert that this new mechanism supersedes
`use_source_config_var`

Bug: 308174768
Change-Id: I39a85639642711f3c96b6f18b94d626b55e80c66
This commit is contained in:
Spandan Das
2023-10-26 22:38:34 +00:00
parent e3fcb41ff7
commit 1c4d94dccf
3 changed files with 117 additions and 3 deletions

View File

@@ -3231,6 +3231,8 @@ func IsMetaDependencyTag(tag blueprint.DependencyTag) bool {
return true
} else if tag == licensesTag {
return true
} else if tag == acDepTag {
return true
}
return false
}