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

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

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | ui/base/l10n/l10n_util.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 <sstream> 7 #include <sstream>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return input_stamp_file; 235 return input_stamp_file;
236 } 236 }
237 237
238 void NinjaTargetWriter::WriteStampForTarget( 238 void NinjaTargetWriter::WriteStampForTarget(
239 const std::vector<OutputFile>& files, 239 const std::vector<OutputFile>& files,
240 const std::vector<OutputFile>& order_only_deps) { 240 const std::vector<OutputFile>& order_only_deps) {
241 const OutputFile& stamp_file = target_->dependency_output_file(); 241 const OutputFile& stamp_file = target_->dependency_output_file();
242 242
243 // First validate that the target's dependency is a stamp file. Otherwise, 243 // First validate that the target's dependency is a stamp file. Otherwise,
244 // we shouldn't have gotten here! 244 // we shouldn't have gotten here!
245 CHECK(base::EndsWith(stamp_file.value(), ".stamp", false)) 245 CHECK(base::EndsWith(stamp_file.value(), ".stamp",
246 base::CompareCase::INSENSITIVE_ASCII))
246 << "Output should end in \".stamp\" for stamp file output. Instead got: " 247 << "Output should end in \".stamp\" for stamp file output. Instead got: "
247 << "\"" << stamp_file.value() << "\""; 248 << "\"" << stamp_file.value() << "\"";
248 249
249 out_ << "build "; 250 out_ << "build ";
250 path_output_.WriteFile(out_, stamp_file); 251 path_output_.WriteFile(out_, stamp_file);
251 252
252 out_ << ": " 253 out_ << ": "
253 << GetNinjaRulePrefixForToolchain(settings_) 254 << GetNinjaRulePrefixForToolchain(settings_)
254 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); 255 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP);
255 path_output_.WriteFiles(out_, files); 256 path_output_.WriteFiles(out_, files);
256 257
257 if (!order_only_deps.empty()) { 258 if (!order_only_deps.empty()) {
258 out_ << " ||"; 259 out_ << " ||";
259 path_output_.WriteFiles(out_, order_only_deps); 260 path_output_.WriteFiles(out_, order_only_deps);
260 } 261 }
261 out_ << std::endl; 262 out_ << std::endl;
262 } 263 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_binary_target_writer.cc ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698