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

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

Issue 1430043002: Support script response files in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment, random build fix Created 5 years, 1 month 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
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | 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/variables.h" 5 #include "tools/gn/variables.h"
6 6
7 namespace variables { 7 namespace variables {
8 8
9 // Built-in variables ---------------------------------------------------------- 9 // Built-in variables ----------------------------------------------------------
10 10
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 " # \"super_secret_implementation_details\".\n" 1157 " # \"super_secret_implementation_details\".\n"
1158 " executable(\"a\") {\n" 1158 " executable(\"a\") {\n"
1159 " deps = [ \":b\" ]\n" 1159 " deps = [ \":b\" ]\n"
1160 " }\n" 1160 " }\n"
1161 "\n" 1161 "\n"
1162 " shared_library(\"b\") {\n" 1162 " shared_library(\"b\") {\n"
1163 " deps = [ \":super_secret_implementation_details\" ]\n" 1163 " deps = [ \":super_secret_implementation_details\" ]\n"
1164 " public_deps = [ \":c\" ]\n" 1164 " public_deps = [ \":c\" ]\n"
1165 " }\n"; 1165 " }\n";
1166 1166
1167 const char kResponseFileContents[] = "response_file_contents";
1168 const char kResponseFileContents_HelpShort[] =
1169 "response_file_contents: [string list] Contents of .rsp file for actions.";
1170 const char kResponseFileContents_Help[] =
1171 "response_file_contents: Contents of a response file for actions.\n"
1172 "\n"
1173 " Sometimes the arguments passed to a script can be too long for the\n"
1174 " system's command-line capabilities. This is especially the case on\n"
1175 " Windows where the maximum command-line length is less than 8K. A\n"
1176 " response file allows you to pass an unlimited amount of data to a\n"
1177 " script in a temporary file for an action or action_foreach target.\n"
1178 "\n"
1179 " If the response_file_contents variable is defined and non-empty, the\n"
1180 " list will be treated as script args (including possibly substitution\n"
1181 " patterns) that will be written to a temporary file at build time.\n"
1182 " The name of the temporary file will be substituted for\n"
1183 " \"{{response_file_name}}\" in the script args.\n"
1184 "\n"
1185 " The response file contents will always be quoted and escaped\n"
1186 " according to Unix shell rules. To parse the response file, the Python\n"
1187 " script should use \"shlex.split(file_contents)\".\n"
1188 "\n"
1189 "Example\n"
1190 "\n"
1191 " action(\"process_lots_of_files\") {\n"
1192 " script = \"process.py\",\n"
1193 " inputs = [ ... huge list of files ... ]\n"
1194 "\n"
1195 " # Write all the inputs to a response file for the script. Also,\n"
1196 " # make the paths relative to the script working directory.\n"
1197 " response_file_contents = rebase_path(inputs, root_build_dir)\n"
1198 "\n"
1199 " # The script expects the name of the response file in --file-list.\n"
1200 " args = [\n"
1201 " \"--enable-foo\",\n"
1202 " \"--file-list={{response_file_name}}\",\n"
1203 " ]\n"
1204 " }\n";
1205
1167 const char kScript[] = "script"; 1206 const char kScript[] = "script";
1168 const char kScript_HelpShort[] = 1207 const char kScript_HelpShort[] =
1169 "script: [file name] Script file for actions."; 1208 "script: [file name] Script file for actions.";
1170 const char kScript_Help[] = 1209 const char kScript_Help[] =
1171 "script: Script file for actions.\n" 1210 "script: Script file for actions.\n"
1172 "\n" 1211 "\n"
1173 " An absolute or buildfile-relative file name of a Python script to run\n" 1212 " An absolute or buildfile-relative file name of a Python script to run\n"
1174 " for a action and action_foreach targets (see \"gn help action\" and\n" 1213 " for a action and action_foreach targets (see \"gn help action\" and\n"
1175 " \"gn help action_foreach\").\n"; 1214 " \"gn help action_foreach\").\n";
1176 1215
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 INSERT_VARIABLE(Libs) 1390 INSERT_VARIABLE(Libs)
1352 INSERT_VARIABLE(LibDirs) 1391 INSERT_VARIABLE(LibDirs)
1353 INSERT_VARIABLE(OutputExtension) 1392 INSERT_VARIABLE(OutputExtension)
1354 INSERT_VARIABLE(OutputName) 1393 INSERT_VARIABLE(OutputName)
1355 INSERT_VARIABLE(Outputs) 1394 INSERT_VARIABLE(Outputs)
1356 INSERT_VARIABLE(PrecompiledHeader) 1395 INSERT_VARIABLE(PrecompiledHeader)
1357 INSERT_VARIABLE(PrecompiledSource) 1396 INSERT_VARIABLE(PrecompiledSource)
1358 INSERT_VARIABLE(Public) 1397 INSERT_VARIABLE(Public)
1359 INSERT_VARIABLE(PublicConfigs) 1398 INSERT_VARIABLE(PublicConfigs)
1360 INSERT_VARIABLE(PublicDeps) 1399 INSERT_VARIABLE(PublicDeps)
1400 INSERT_VARIABLE(ResponseFileContents)
1361 INSERT_VARIABLE(Script) 1401 INSERT_VARIABLE(Script)
1362 INSERT_VARIABLE(Sources) 1402 INSERT_VARIABLE(Sources)
1363 INSERT_VARIABLE(Testonly) 1403 INSERT_VARIABLE(Testonly)
1364 INSERT_VARIABLE(Visibility) 1404 INSERT_VARIABLE(Visibility)
1365 } 1405 }
1366 return info_map; 1406 return info_map;
1367 } 1407 }
1368 1408
1369 #undef INSERT_VARIABLE 1409 #undef INSERT_VARIABLE
1370 1410
1371 } // namespace variables 1411 } // namespace variables
OLDNEW
« no previous file with comments | « tools/gn/variables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698