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

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

Issue 1606553002: Add support for Mac/iOS application bundles to GN tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base_unittests builds and pass all tests with GN Created 4 years, 11 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698