diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-20 17:59:15 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-20 17:59:15 +0000 |
commit | 2fbe101fd45323476bc2f25a7abd29af9da22b5c (patch) | |
tree | 6183b33d4d762c5d6c33a47b7f99550d9df230cb /tools/gn/file_template.cc | |
parent | 8a17386774ce97470f7f001b0527f70c8125e0b5 (diff) | |
download | chromium_src-2fbe101fd45323476bc2f25a7abd29af9da22b5c.zip chromium_src-2fbe101fd45323476bc2f25a7abd29af9da22b5c.tar.gz chromium_src-2fbe101fd45323476bc2f25a7abd29af9da22b5c.tar.bz2 |
GN: Split custom into action and action_foreach
Previously the custom target type implemented two modes: iterate over a list of sources, and run a script once with a set of inputs. This proved a bit confusing since to differentiate these cases you had to either fill in sources or not.
This patch splits that apart into two targets: an action for running a script once, and an action_foreach for running a script over a set of inputs. This makes the differentiation explicit and allows more clear error reporting when you mess it up. I also added additional checks.
BUG=
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/200923007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258342 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/file_template.cc')
-rw-r--r-- | tools/gn/file_template.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/gn/file_template.cc b/tools/gn/file_template.cc index 92a44a9..ec34993 100644 --- a/tools/gn/file_template.cc +++ b/tools/gn/file_template.cc @@ -19,7 +19,7 @@ const char FileTemplate::kSourceFilePart[] = "{{source_file_part}}"; const char kSourceExpansion_Help[] = "How Source Expansion Works\n" "\n" - " Source expansion is used for the custom script and copy target types\n" + " Source expansion is used for the action_foreach and copy target types\n" " to map source file names to output file names or arguments.\n" "\n" " To perform source expansion in the outputs, GN maps every entry in the\n" @@ -34,8 +34,8 @@ const char kSourceExpansion_Help[] = " as a static list of literal file names that do not depend on the\n" " sources.\n" "\n" - " See \"gn help copy\" and \"gn help custom\" for more on how this is\n" - " applied.\n" + " See \"gn help copy\" and \"gn help action_foreach\" for more on how\n" + " this is applied.\n" "\n" "Placeholders\n" "\n" @@ -59,7 +59,7 @@ const char kSourceExpansion_Help[] = "Examples\n" "\n" " Non-varying outputs:\n" - " script(\"hardcoded_outputs\") {\n" + " action(\"hardcoded_outputs\") {\n" " sources = [ \"input1.idl\", \"input2.idl\" ]\n" " outputs = [ \"$target_out_dir/output1.dat\",\n" " \"$target_out_dir/output2.dat\" ]\n" @@ -67,7 +67,7 @@ const char kSourceExpansion_Help[] = " The outputs in this case will be the two literal files given.\n" "\n" " Varying outputs:\n" - " script(\"varying_outputs\") {\n" + " action_foreach(\"varying_outputs\") {\n" " sources = [ \"input1.idl\", \"input2.idl\" ]\n" " outputs = [ \"$target_out_dir/{{source_name_part}}.h\",\n" " \"$target_out_dir/{{source_name_part}}.cc\" ]\n" @@ -96,7 +96,7 @@ FileTemplate::~FileTemplate() { // static FileTemplate FileTemplate::GetForTargetOutputs(const Target* target) { - const Target::FileList& outputs = target->script_values().outputs(); + const Target::FileList& outputs = target->action_values().outputs(); std::vector<std::string> output_template_args; for (size_t i = 0; i < outputs.size(); i++) output_template_args.push_back(outputs[i].value()); |