• David 'Digit' Turner's avatar
    android: build: Simplify chrome/monochrome GN templates. · 90944747
    David 'Digit' Turner authored
    This CL simplifies and refactors a bit the GN templates
    used to build the [mono]chrome[_modern]_public_XXX templates
    (including APKs and bundles).
    
    - Add build/android/docs/android_app_bundles.md to better
      explain what is going on here.
    
    - Unsynchronized proguarding of application bundles was
      broken by the CL that introduced synchronized proguarding.
      This CL fixes it by simply making synchronized proguarding
      the default for all app bundles (when proguard_enabled is
      true). It doesn't really make sense to support regular
      proguarding, since the chances that something wrong will
      happen are too high.
    
      This also reduces the number of build state variants that
      need to be supported for an individual bundle module.
    
    - The chrome_public_apk_tmpl_shared() GN template defined in
      chrome/android/BUILD.gn was not very useful and only serves
      to add some dependencies. Remove it and adjust all callers
      to add the equivalent dependency list to their |deps|
      variable instead, to simplify things.
    
    - Remove chrome_modern_public_apk_or_module_tmpl() entirely.
      Instead, add an |is_modern| variable to
      chrome_public_apk_or_module_tmpl() that takes care of adding
      the necessary declarations corresponding to modern builds
      to the template.
    
    - Hard-code version_name to chrome_version in
      chrome_public_apk_or_module_tmpl() since all callers define
      it to |chrome_version| anyway.
    
    - rules.gni: Add missing variable forward, required for
      the clank/ targets only.
    
    - Rename chrome_public_apk_tmpl() to
      chrome_public_common_apk_or_module_tmpl() to match its
      intended usage. Note that chrome_public_apk_tmpl()
      wrappers are still available to ensure the clank/ build
      doesn't break.
    
      Similarly, define monochrome_public_common_apk_or_module_tmpl()
      (yes, a bit long, but really only internal).
    
    - Add documentation to various intermediate GN templates to
      make it easier to understand what's going on.
    
    BUG=865108
    R=agrieve@chromium.org, tiborg@chromium.org, yfriedman@chromium.org
    
    Change-Id: Ia4f79429a8e32c97630c90ce126362eb7534252c
    Reviewed-on: https://chromium-review.googlesource.com/1154979
    Commit-Queue: David Turner <digit@chromium.org>
    Reviewed-by: default avataragrieve <agrieve@chromium.org>
    Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#580522}
    90944747
chrome_public_apk_tmpl.gni 10.7 KB