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

Unified Diff: tools/gn/file_template.cc

Issue 80463004: GN generator for GYP actions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/file_template.h ('k') | tools/gn/filesystem_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/file_template.cc
diff --git a/tools/gn/file_template.cc b/tools/gn/file_template.cc
index 1616c52b9d3ff7aa8bfc6465dd7646463fc6aacd..995bb01621dd44a755b110dc68ac430c07575234 100644
--- a/tools/gn/file_template.cc
+++ b/tools/gn/file_template.cc
@@ -9,6 +9,8 @@
#include "tools/gn/escape.h"
#include "tools/gn/filesystem_utils.h"
+#include "tools/gn/string_utils.h"
+#include "tools/gn/target.h"
const char FileTemplate::kSource[] = "{{source}}";
const char FileTemplate::kSourceNamePart[] = "{{source_name_part}}";
@@ -92,6 +94,15 @@ FileTemplate::FileTemplate(const std::vector<std::string>& t)
FileTemplate::~FileTemplate() {
}
+// static
+FileTemplate FileTemplate::GetForTargetOutputs(const Target* target) {
+ const Target::FileList& outputs = target->script_values().outputs();
+ std::vector<std::string> output_template_args;
+ for (size_t i = 0; i < outputs.size(); i++)
+ output_template_args.push_back(outputs[i].value());
+ return FileTemplate(output_template_args);
+}
+
bool FileTemplate::IsTypeUsed(Subrange::Type type) const {
DCHECK(type > Subrange::LITERAL && type < Subrange::NUM_TYPES);
return types_required_[type];
« no previous file with comments | « tools/gn/file_template.h ('k') | tools/gn/filesystem_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698