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

Side by Side Diff: tools/gn/ninja_target_writer.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/ninja_target_writer.h ('k') | tools/gn/target_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ninja_target_writer.h" 5 #include "tools/gn/ninja_target_writer.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Extra hard deps passed in. 161 // Extra hard deps passed in.
162 for (size_t i = 0; i < extra_hard_deps.size(); i++) { 162 for (size_t i = 0; i < extra_hard_deps.size(); i++) {
163 out_ << " "; 163 out_ << " ";
164 path_output_.WriteFile(out_, 164 path_output_.WriteFile(out_,
165 helper_.GetTargetOutputFile(extra_hard_deps[i])); 165 helper_.GetTargetOutputFile(extra_hard_deps[i]));
166 } 166 }
167 167
168 out_ << "\n"; 168 out_ << "\n";
169 return " | " + stamp_file_string; 169 return " | " + stamp_file_string;
170 } 170 }
171
172 FileTemplate NinjaTargetWriter::GetOutputTemplate() const {
173 const Target::FileList& outputs = target_->action_values().outputs();
174 std::vector<std::string> output_template_args;
175 for (size_t i = 0; i < outputs.size(); i++) {
176 // All outputs should be in the output dir.
177 output_template_args.push_back(
178 RemovePrefix(outputs[i].value(),
179 settings_->build_settings()->build_dir().value()));
180 }
181 return FileTemplate(target_->settings(), output_template_args);
182 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_target_writer.h ('k') | tools/gn/target_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698