| OLD | NEW |
| 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 Loading... |
| 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(EndsWith(stamp_file.value(), ".stamp", false)) | 245 CHECK(base::EndsWith(stamp_file.value(), ".stamp", false)) |
| 246 << "Output should end in \".stamp\" for stamp file output. Instead got: " | 246 << "Output should end in \".stamp\" for stamp file output. Instead got: " |
| 247 << "\"" << stamp_file.value() << "\""; | 247 << "\"" << stamp_file.value() << "\""; |
| 248 | 248 |
| 249 out_ << "build "; | 249 out_ << "build "; |
| 250 path_output_.WriteFile(out_, stamp_file); | 250 path_output_.WriteFile(out_, stamp_file); |
| 251 | 251 |
| 252 out_ << ": " | 252 out_ << ": " |
| 253 << GetNinjaRulePrefixForToolchain(settings_) | 253 << GetNinjaRulePrefixForToolchain(settings_) |
| 254 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 254 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
| 255 path_output_.WriteFiles(out_, files); | 255 path_output_.WriteFiles(out_, files); |
| 256 | 256 |
| 257 if (!order_only_deps.empty()) { | 257 if (!order_only_deps.empty()) { |
| 258 out_ << " ||"; | 258 out_ << " ||"; |
| 259 path_output_.WriteFiles(out_, order_only_deps); | 259 path_output_.WriteFiles(out_, order_only_deps); |
| 260 } | 260 } |
| 261 out_ << std::endl; | 261 out_ << std::endl; |
| 262 } | 262 } |
| OLD | NEW |