| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/gn/err.h" | 5 #include "tools/gn/err.h" |
| 6 #include "tools/gn/functions.h" | 6 #include "tools/gn/functions.h" |
| 7 #include "tools/gn/parse_tree.h" | 7 #include "tools/gn/parse_tree.h" |
| 8 #include "tools/gn/scope.h" | 8 #include "tools/gn/scope.h" |
| 9 | 9 |
| 10 namespace functions { | 10 namespace functions { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 " }\n" | 126 " }\n" |
| 127 "\n" | 127 "\n" |
| 128 " # This is a template around either a target whose type depends on a\n" | 128 " # This is a template around either a target whose type depends on a\n" |
| 129 " # global variable. It forwards all values from the invoker.\n" | 129 " # global variable. It forwards all values from the invoker.\n" |
| 130 " template(\"my_wrapper\") {\n" | 130 " template(\"my_wrapper\") {\n" |
| 131 " target(my_wrapper_target_type, target_name) {\n" | 131 " target(my_wrapper_target_type, target_name) {\n" |
| 132 " forward_variables_from(invoker, \"*\")\n" | 132 " forward_variables_from(invoker, \"*\")\n" |
| 133 " }\n" | 133 " }\n" |
| 134 " }\n" | 134 " }\n" |
| 135 "\n" | 135 "\n" |
| 136 " # A template that wraps another. It adds behavior based on one \n" | 136 " # A template that wraps another. It adds behavior based on one\n" |
| 137 " # variable, and forwards all others to the nested target.\n" | 137 " # variable, and forwards all others to the nested target.\n" |
| 138 " template(\"my_ios_test_app\") {\n" | 138 " template(\"my_ios_test_app\") {\n" |
| 139 " ios_test_app(target_name) {\n" | 139 " ios_test_app(target_name) {\n" |
| 140 " forward_variables_from(invoker, \"*\", [\"test_bundle_name\"])\n" | 140 " forward_variables_from(invoker, \"*\", [\"test_bundle_name\"])\n" |
| 141 " if (!defined(extra_substitutions)) {\n" | 141 " if (!defined(extra_substitutions)) {\n" |
| 142 " extra_substitutions = []\n" | 142 " extra_substitutions = []\n" |
| 143 " }\n" | 143 " }\n" |
| 144 " extra_substitutions += [ \"BUNDLE_ID_TEST_NAME=$test_bundle_name\" " | 144 " extra_substitutions += [ \"BUNDLE_ID_TEST_NAME=$test_bundle_name\" " |
| 145 "]\n" | 145 "]\n" |
| 146 " }\n" | 146 " }\n" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 } | 219 } |
| 220 | 220 |
| 221 // Not the right type of argument. | 221 // Not the right type of argument. |
| 222 *err = Err(what_value, "Not a valid list of variables to copy.", | 222 *err = Err(what_value, "Not a valid list of variables to copy.", |
| 223 "Expecting either the string \"*\" or a list of strings."); | 223 "Expecting either the string \"*\" or a list of strings."); |
| 224 return Value(); | 224 return Value(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace functions | 227 } // namespace functions |
| OLD | NEW |