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

Side by Side Diff: tools/gn/function_process_file_template.cc

Issue 270613006: GN documentation updates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/gn/function_template.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/file_template.h" 5 #include "tools/gn/file_template.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 8
9 namespace functions { 9 namespace functions {
10 10
11 const char kProcessFileTemplate[] = "process_file_template"; 11 const char kProcessFileTemplate[] = "process_file_template";
12 const char kProcessFileTemplate_HelpShort[] = 12 const char kProcessFileTemplate_HelpShort[] =
13 "process_file_template: Do template expansion over a list of files."; 13 "process_file_template: Do template expansion over a list of files.";
14 const char kProcessFileTemplate_Help[] = 14 const char kProcessFileTemplate_Help[] =
15 "process_file_template: Do template expansion over a list of files.\n" 15 "process_file_template: Do template expansion over a list of files.\n"
16 "\n" 16 "\n"
17 " process_file_template(source_list, template)\n" 17 " process_file_template(source_list, template)\n"
18 "\n" 18 "\n"
19 " process_file_template applies a template list to a source file list,\n" 19 " process_file_template applies a template list to a source file list,\n"
20 " returning the result of applying each template to each source. This is\n" 20 " returning the result of applying each template to each source. This is\n"
21 " typically used for computing output file names from input files.\n" 21 " typically used for computing output file names from input files.\n"
22 "\n" 22 "\n"
23 " In most cases, get_target_outputs() will give the same result with\n"
24 " shorter, more maintainable code. This function should only be used\n"
25 " when that function can't be used (like there's no target or the target\n"
26 " is defined in another build file).\n"
27 "\n"
23 "Arguments:\n" 28 "Arguments:\n"
24 "\n" 29 "\n"
25 " The source_list is a list of file names.\n" 30 " The source_list is a list of file names.\n"
26 "\n" 31 "\n"
27 " The template can be a string or a list. If it is a list, multiple\n" 32 " The template can be a string or a list. If it is a list, multiple\n"
28 " output strings are generated for each input.\n" 33 " output strings are generated for each input.\n"
29 "\n" 34 "\n"
30 " The following template substrings are used in the template arguments\n" 35 " The following template substrings are used in the template arguments\n"
31 " and are replaced with the corresponding part of the input file name:\n" 36 " and are replaced with the corresponding part of the input file name:\n"
32 "\n" 37 "\n"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 FileTemplate file_template(args[1], err); 70 FileTemplate file_template(args[1], err);
66 if (err->has_error()) 71 if (err->has_error())
67 return Value(); 72 return Value();
68 73
69 Value ret(function, Value::LIST); 74 Value ret(function, Value::LIST);
70 file_template.Apply(args[0], function, &ret.list_value(), err); 75 file_template.Apply(args[0], function, &ret.list_value(), err);
71 return ret; 76 return ret;
72 } 77 }
73 78
74 } // namespace functions 79 } // namespace functions
OLDNEW
« no previous file with comments | « no previous file | tools/gn/function_template.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698