Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: tools/gn/docs/reference.md

Issue 1632573002: Support for excluding variable from forwarding via forward_variables_form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_shell
Patch Set: Address comments and expand filter to templates/target_defaults in NonRecursiveMergeTo Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gn/function_forward_variables_from.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/docs/reference.md
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index 97f12f21e1f531d378f612a2d11316798d7e5e7c..85fba666c4f46ad084d01858bbd135b1a22e6446 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -1327,7 +1327,8 @@
## **forward_variables_from**: Copies variables from a different scope.
```
- forward_variables_from(from_scope, variable_list_or_star)
+ forward_variables_from(from_scope, variable_list_or_star,
+ variable_to_not_forward_list = [])
Copies the given variables from the given scope to the local scope
if they exist. This is normally used in the context of templates to
@@ -1354,6 +1355,10 @@
is never applied by this function. It's assumed than any desired
filtering was already done when sources was set on the from_scope.
+ If variables_to_not_forward_list is non-empty, then it must contains
+ a list of variable names that will not be forwarded. This is mostly
+ useful when variable_list_or_star has a value of "*".
+
```
### **Examples**
@@ -1383,7 +1388,19 @@
target(my_wrapper_target_type, target_name) {
forward_variables_from(invoker, "*")
}
- }
+ }
+
+ # A template that wraps another. It adds behavior based on one
+ # variable, and forwards all others to the nested target.
+ template("my_ios_test_app") {
+ ios_test_app(target_name) {
+ forward_variables_from(invoker, "*", ["test_bundle_name"])
+ if (!defined(extra_substitutions)) {
+ extra_substitutions = []
+ }
+ extra_substitutions += [ "BUNDLE_ID_TEST_NAME=$test_bundle_name" ]
+ }
+ }
```
« no previous file with comments | « no previous file | tools/gn/function_forward_variables_from.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698