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

Unified Diff: tools/gn/function_get_target_outputs.cc

Issue 334333005: Add directory extraction to GN path handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
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 370fee9cb2275518bce4a0617341024e2db1dc2a..be014f26b3965909fe6afc38ab33f9be445a202a 100644
--- a/tools/gn/function_get_target_outputs.cc
+++ b/tools/gn/function_get_target_outputs.cc
@@ -15,7 +15,7 @@ namespace functions {
namespace {
-void GetOutputsForTarget(const BuildSettings* build_settings,
+void GetOutputsForTarget(const Settings* settings,
const Target* target,
std::vector<std::string>* ret) {
switch (target->output_type()) {
@@ -31,10 +31,10 @@ void GetOutputsForTarget(const BuildSettings* build_settings,
case Target::ACTION_FOREACH: {
// Action_foreach: return the result of the template in the outputs.
- FileTemplate file_template(target->action_values().outputs());
+ FileTemplate file_template(settings, target->action_values().outputs());
const std::vector<SourceFile>& sources = target->sources();
for (size_t i = 0; i < sources.size(); i++)
- file_template.ApplyString(sources[i].value(), ret);
+ file_template.Apply(sources[i], ret);
break;
}
@@ -50,11 +50,12 @@ void GetOutputsForTarget(const BuildSettings* build_settings,
case Target::GROUP:
case Target::SOURCE_SET: {
// These return the stamp file, which is computed by the NinjaHelper.
- NinjaHelper helper(build_settings);
+ NinjaHelper helper(settings->build_settings());
OutputFile output_file = helper.GetTargetOutputFile(target);
// The output file is relative to the build dir.
- std::string absolute_output_file = build_settings->build_dir().value();
+ std::string absolute_output_file =
+ settings->build_settings()->build_dir().value();
absolute_output_file.append(output_file.value());
ret->push_back(absolute_output_file);
@@ -168,7 +169,7 @@ Value RunGetTargetOutputs(Scope* scope,
}
std::vector<std::string> files;
- GetOutputsForTarget(scope->settings()->build_settings(), target, &files);
+ GetOutputsForTarget(scope->settings(), target, &files);
Value ret(function, Value::LIST);
ret.list_value().reserve(files.size());

Powered by Google App Engine
This is Rietveld 408576698