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

Unified Diff: tools/gn/function_get_target_outputs.cc

Issue 387663003: Improve GN handling of directory templates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/filesystem_utils_unittest.cc ('k') | tools/gn/function_get_target_outputs_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_get_target_outputs.cc
diff --git a/tools/gn/function_get_target_outputs.cc b/tools/gn/function_get_target_outputs.cc
index be014f26b3965909fe6afc38ab33f9be445a202a..aeb057f9b4f6080bc936d2f6da3bbf2d1708876f 100644
--- a/tools/gn/function_get_target_outputs.cc
+++ b/tools/gn/function_get_target_outputs.cc
@@ -19,19 +19,20 @@ void GetOutputsForTarget(const Settings* settings,
const Target* target,
std::vector<std::string>* ret) {
switch (target->output_type()) {
- case Target::ACTION:
- case Target::COPY_FILES: {
- // Actions and copy targets: return the outputs specified.
- const std::vector<SourceFile>& outs = target->action_values().outputs();
+ case Target::ACTION: {
+ // Actions: return the outputs specified.
+ const std::vector<std::string>& outs = target->action_values().outputs();
ret->reserve(outs.size());
for (size_t i = 0; i < outs.size(); i++)
- ret->push_back(outs[i].value());
+ ret->push_back(outs[i]);
break;
}
+ case Target::COPY_FILES:
case Target::ACTION_FOREACH: {
- // Action_foreach: return the result of the template in the outputs.
- FileTemplate file_template(settings, target->action_values().outputs());
+ // Copy/action_foreach: return the result of the template in the outputs.
+ FileTemplate file_template(settings, target->action_values().outputs(),
+ FileTemplate::OUTPUT_ABSOLUTE, SourceDir());
const std::vector<SourceFile>& sources = target->sources();
for (size_t i = 0; i < sources.size(); i++)
file_template.Apply(sources[i], ret);
« no previous file with comments | « tools/gn/filesystem_utils_unittest.cc ('k') | tools/gn/function_get_target_outputs_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698