OLD | NEW |
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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/process/kill.h" | 8 #include "base/process/kill.h" |
9 #include "base/process/launch.h" | 9 #include "base/process/launch.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 " (Optional) A list of files that this script reads or otherwise\n" | 271 " (Optional) A list of files that this script reads or otherwise\n" |
272 " depends on. These dependencies will be added to the build result\n" | 272 " depends on. These dependencies will be added to the build result\n" |
273 " such that if any of them change, the build will be regenerated and\n" | 273 " such that if any of them change, the build will be regenerated and\n" |
274 " the script will be re-run.\n" | 274 " the script will be re-run.\n" |
275 "\n" | 275 "\n" |
276 " The script itself will be an implicit dependency so you do not\n" | 276 " The script itself will be an implicit dependency so you do not\n" |
277 " need to list it.\n" | 277 " need to list it.\n" |
278 "\n" | 278 "\n" |
279 "Example:\n" | 279 "Example:\n" |
280 "\n" | 280 "\n" |
281 " all_lines = exec_script(\"myscript.py\", [some_input], \"list lines\",\n" | 281 " all_lines = exec_script(\n" |
282 " [ rebase_path(\"data_file.txt\", \".\"," | 282 " \"myscript.py\", [some_input], \"list lines\",\n" |
283 " root_build_dir) ])\n" | 283 " [ rebase_path(\"data_file.txt\", root_build_dir) ])\n" |
284 "\n" | 284 "\n" |
285 " # This example just calls the script with no arguments and discards\n" | 285 " # This example just calls the script with no arguments and discards\n" |
286 " # the result.\n" | 286 " # the result.\n" |
287 " exec_script(\"//foo/bar/myscript.py\")\n"; | 287 " exec_script(\"//foo/bar/myscript.py\")\n"; |
288 | 288 |
289 Value RunExecScript(Scope* scope, | 289 Value RunExecScript(Scope* scope, |
290 const FunctionCallNode* function, | 290 const FunctionCallNode* function, |
291 const std::vector<Value>& args, | 291 const std::vector<Value>& args, |
292 Err* err) { | 292 Err* err) { |
293 if (args.size() < 1 || args.size() > 4) { | 293 if (args.size() < 1 || args.size() > 4) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 msg); | 406 msg); |
407 return Value(); | 407 return Value(); |
408 } | 408 } |
409 | 409 |
410 // Default to None value for the input conversion if unspecified. | 410 // Default to None value for the input conversion if unspecified. |
411 return ConvertInputToValue(output, function, | 411 return ConvertInputToValue(output, function, |
412 args.size() >= 3 ? args[2] : Value(), err); | 412 args.size() >= 3 ? args[2] : Value(), err); |
413 } | 413 } |
414 | 414 |
415 } // namespace functions | 415 } // namespace functions |
OLD | NEW |