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

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

Issue 2387763002: Support for source_target_relative expansion in GN (Closed)
Patch Set: Reimplemented as source_target_relative Created 4 years, 2 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 (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/functions.h" 5 #include "tools/gn/functions.h"
6 #include "tools/gn/parse_tree.h" 6 #include "tools/gn/parse_tree.h"
7 #include "tools/gn/scope.h" 7 #include "tools/gn/scope.h"
8 #include "tools/gn/settings.h" 8 #include "tools/gn/settings.h"
9 #include "tools/gn/substitution_list.h" 9 #include "tools/gn/substitution_list.h"
10 #include "tools/gn/substitution_writer.h" 10 #include "tools/gn/substitution_writer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 list.push_back(template_arg.string_value()); 84 list.push_back(template_arg.string_value());
85 if (!subst.Parse(list, template_arg.origin(), err)) 85 if (!subst.Parse(list, template_arg.origin(), err))
86 return Value(); 86 return Value();
87 } else if (template_arg.type() == Value::LIST) { 87 } else if (template_arg.type() == Value::LIST) {
88 if (!subst.Parse(template_arg, err)) 88 if (!subst.Parse(template_arg, err))
89 return Value(); 89 return Value();
90 } else { 90 } else {
91 *err = Err(template_arg, "Not a string or a list."); 91 *err = Err(template_arg, "Not a string or a list.");
92 return Value(); 92 return Value();
93 } 93 }
94 94
brettw 2016/10/05 19:47:50 Here can you check that subst.required_types() doe
Petr Hosek 2016/10/11 00:59:49 Done.
95 SubstitutionWriter::ApplyListToSourcesAsString( 95 SubstitutionWriter::ApplyListToSourcesAsString(
96 scope->settings(), subst, input_files, &result_files); 96 nullptr, scope->settings(), subst, input_files, &result_files);
97 97
98 // Convert the list of strings to the return Value. 98 // Convert the list of strings to the return Value.
99 Value ret(function, Value::LIST); 99 Value ret(function, Value::LIST);
100 ret.list_value().reserve(result_files.size()); 100 ret.list_value().reserve(result_files.size());
101 for (const auto& file : result_files) 101 for (const auto& file : result_files)
102 ret.list_value().push_back(Value(function, file)); 102 ret.list_value().push_back(Value(function, file));
103 103
104 return ret; 104 return ret;
105 } 105 }
106 106
107 } // namespace functions 107 } // namespace functions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698