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

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: 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
Index: tools/gn/docs/reference.md
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index 97f12f21e1f531d378f612a2d11316798d7e5e7c..9cc04025f30033cdbf55614b4d74ffb390ffd992 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -1329,6 +1329,9 @@
```
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
use the values of variables defined in the template invocation to
@@ -1354,6 +1357,9 @@
is never applied by this function. It's assumed than any desired
filtering was already done when sources was set on the from_scope.
+ The second form of the function allows to give a list of variables not
+ to forward. This is mostly useful when used in combination with "*".
+
```
### **Examples**
@@ -1383,7 +1389,19 @@
target(my_wrapper_target_type, target_name) {
forward_variables_from(invoker, "*")
}
- }
+ }
+
+ # This is a template around another template that uses a variable to
+ # initialize another variable and is only interested in that one.
+ 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') | tools/gn/function_forward_variables_from.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698