| 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 "tools/gn/action_target_generator.h" | 5 #include "tools/gn/action_target_generator.h" |
| 6 | 6 |
| 7 #include "tools/gn/build_settings.h" | 7 #include "tools/gn/build_settings.h" |
| 8 #include "tools/gn/err.h" | 8 #include "tools/gn/err.h" |
| 9 #include "tools/gn/filesystem_utils.h" | 9 #include "tools/gn/filesystem_utils.h" |
| 10 #include "tools/gn/parse_tree.h" | 10 #include "tools/gn/parse_tree.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 SUBSTITUTION_RSP_FILE_NAME) != | 78 SUBSTITUTION_RSP_FILE_NAME) != |
| 79 required_args_substitutions.end(); | 79 required_args_substitutions.end(); |
| 80 if (target_->action_values().uses_rsp_file() && !has_rsp_file_name) { | 80 if (target_->action_values().uses_rsp_file() && !has_rsp_file_name) { |
| 81 *err_ = Err(function_call_, "Missing {{response_file_name}} in args.", | 81 *err_ = Err(function_call_, "Missing {{response_file_name}} in args.", |
| 82 "This target defines response_file_contents but doesn't use\n" | 82 "This target defines response_file_contents but doesn't use\n" |
| 83 "{{response_file_name}} in the args, which means the response file\n" | 83 "{{response_file_name}} in the args, which means the response file\n" |
| 84 "will be unused."); | 84 "will be unused."); |
| 85 return; | 85 return; |
| 86 } | 86 } |
| 87 if (!target_->action_values().uses_rsp_file() && has_rsp_file_name) { | 87 if (!target_->action_values().uses_rsp_file() && has_rsp_file_name) { |
| 88 *err_ = Err(function_call_, "Missing response_file_content definition.", | 88 *err_ = Err(function_call_, "Missing response_file_contents definition.", |
| 89 "This target uses {{response_file_name}} in the args, but does not\n" | 89 "This target uses {{response_file_name}} in the args, but does not\n" |
| 90 "define response_file_content which means the response file\n" | 90 "define response_file_contents which means the response file\n" |
| 91 "will be empty."); | 91 "will be empty."); |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool ActionTargetGenerator::FillScript() { | 96 bool ActionTargetGenerator::FillScript() { |
| 97 // If this gets called, the target type requires a script, so error out | 97 // If this gets called, the target type requires a script, so error out |
| 98 // if it doesn't have one. | 98 // if it doesn't have one. |
| 99 const Value* value = scope_->GetValue(variables::kScript, true); | 99 const Value* value = scope_->GetValue(variables::kScript, true); |
| 100 if (!value) { | 100 if (!value) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 *err_ = Err(function_call_, | 176 *err_ = Err(function_call_, |
| 177 "action_foreach should have a pattern in the output.", | 177 "action_foreach should have a pattern in the output.", |
| 178 "An action_foreach target should have a source expansion pattern in\n" | 178 "An action_foreach target should have a source expansion pattern in\n" |
| 179 "it to map source file to unique output file name. Otherwise, the\n" | 179 "it to map source file to unique output file name. Otherwise, the\n" |
| 180 "build system can't determine when your script needs to be run."); | 180 "build system can't determine when your script needs to be run."); |
| 181 return false; | 181 return false; |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 return true; | 184 return true; |
| 185 } | 185 } |
| OLD | NEW |