• Andrew Grieve's avatar
    Improve GN templates use of "visibility" and "testonly" · 1b290e4a
    Andrew Grieve authored
    Many spots using forward_variables_from(invoker, "*") were not
    allowing these two variables to be set in outer scopes.
    
    * Introduce a helper variable "EXPLICIT_FORWARDS" for use with the
    recommended pattern of:
      forward_variables_from(invoker, "*", [ "testonly", "visibility" ])
      forward_variables_from(invoker, [ "testonly", "visibility" ])
    * Ensures this pattern is used in android templates, test.gni,
      and BUILDCONFIG.gn
    * Documents this pattern in writing_gn_templates.md
    * Adds a PRESUBMIT.py for it
    * Fixes visibility of a few blink targets now that test()
      respects it.
    
    Bug: 862232
    Change-Id: Ib71dbf34be76131fc749c721aea856e1146bc69a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454427
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
    Cr-Commit-Position: refs/heads/master@{#830678}
    1b290e4a
generate_wrapper.gni 3.23 KB