apex_key: support default cert dir lookup.

The Soong implementation of apex_key supports looking up the named key
in the DefaultAppCertificate directory if the product variable is specified.

To disambiguate named files from named modules, the bp2build converter
checks if the string is a module, and if so, sets the
{private,public}_key attr. Otherwise, set the {private,public}_key_name attr.

This is similar to what was done for android_app_certificate in aosp/2238695.

The Soong code also validates that the basename minus extension are the
same between the keys, so add that to the rule impl as well.

See Soong impl: https://cs.android.com/android/platform/superproject/+/master:build/soong/apex/key.go;l=75-86;drc=d079e0b2708ce0f4cce470db929f28dd8d2b0e80

Test: presubmits, new tests
Change-Id: Ic6e0473a87c9ff0ef01dd2d7047eaf728d423786
7 files changed
tree: 3d6ceaa92f76ba86668d10cc6b3a4dfceddbce03
  1. ci/
  2. docs/
  3. examples/
  4. json_module_graph/
  5. mk2rbc/
  6. platforms/
  7. product_config/
  8. product_variables/
  9. rules/
  10. scripts/
  11. tests/
  12. vendor/
  13. .gitignore
  14. bazel.BUILD
  15. bazel.sh
  16. bazel.WORKSPACE
  17. buildifier_hook.sh
  18. common.bazelrc
  19. darwin.bazelrc
  20. linux.bazelrc
  21. OWNERS
  22. PREUPLOAD.cfg
  23. README.md
README.md

Bazel

The code in this directory is experimental. Bazel support for Android Platform is undergoing active development and workflow stability is currently not guaranteed.