| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/build_settings.h" | 5 #include "tools/gn/build_settings.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 #include "tools/gn/settings.h" | 8 #include "tools/gn/settings.h" |
| 9 #include "tools/gn/substitution_writer.h" | 9 #include "tools/gn/substitution_writer.h" |
| 10 #include "tools/gn/target.h" | 10 #include "tools/gn/target.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 label.GetUserVisibleName(false) + | 112 label.GetUserVisibleName(false) + |
| 113 "\nwas not found. get_target_outputs() can only be used for targets\n" | 113 "\nwas not found. get_target_outputs() can only be used for targets\n" |
| 114 "previously defined in the current file."); | 114 "previously defined in the current file."); |
| 115 return Value(); | 115 return Value(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Compute the output list. | 118 // Compute the output list. |
| 119 std::vector<SourceFile> files; | 119 std::vector<SourceFile> files; |
| 120 if (target->output_type() == Target::ACTION || | 120 if (target->output_type() == Target::ACTION || |
| 121 target->output_type() == Target::COPY_FILES || | 121 target->output_type() == Target::COPY_FILES || |
| 122 target->output_type() == Target::COPY_BUNDLE_DATA || |
| 122 target->output_type() == Target::ACTION_FOREACH) { | 123 target->output_type() == Target::ACTION_FOREACH) { |
| 123 target->action_values().GetOutputsAsSourceFiles(target, &files); | 124 target->action_values().GetOutputsAsSourceFiles(target, &files); |
| 124 } else { | 125 } else { |
| 125 // Other types of targets are not supported. | 126 // Other types of targets are not supported. |
| 126 *err = Err(args[0], "Target is not an action, action_foreach, or copy.", | 127 *err = Err(args[0], "Target is not an action, action_foreach, or copy.", |
| 127 "Only these target types are supported by get_target_outputs."); | 128 "Only these target types are supported by get_target_outputs."); |
| 128 return Value(); | 129 return Value(); |
| 129 } | 130 } |
| 130 | 131 |
| 131 // Convert to Values. | 132 // Convert to Values. |
| 132 Value ret(function, Value::LIST); | 133 Value ret(function, Value::LIST); |
| 133 ret.list_value().reserve(files.size()); | 134 ret.list_value().reserve(files.size()); |
| 134 for (const auto& file : files) | 135 for (const auto& file : files) |
| 135 ret.list_value().push_back(Value(function, file.value())); | 136 ret.list_value().push_back(Value(function, file.value())); |
| 136 | 137 |
| 137 return ret; | 138 return ret; |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace functions | 141 } // namespace functions |
| OLD | NEW |