| 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_copy_target_writer.h" | 5 #include "tools/gn/ninja_copy_target_writer.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "tools/gn/ninja_utils.h" | 8 #include "tools/gn/ninja_utils.h" |
| 9 #include "tools/gn/output_file.h" | 9 #include "tools/gn/output_file.h" |
| 10 #include "tools/gn/scheduler.h" | 10 #include "tools/gn/scheduler.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 WriteCopyRules(&output_files); | 56 WriteCopyRules(&output_files); |
| 57 out_ << std::endl; | 57 out_ << std::endl; |
| 58 WriteStampForTarget(output_files, std::vector<OutputFile>()); | 58 WriteStampForTarget(output_files, std::vector<OutputFile>()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void NinjaCopyTargetWriter::WriteCopyRules( | 61 void NinjaCopyTargetWriter::WriteCopyRules( |
| 62 std::vector<OutputFile>* output_files) { | 62 std::vector<OutputFile>* output_files) { |
| 63 CHECK(target_->action_values().outputs().list().size() == 1); | 63 CHECK(target_->action_values().outputs().list().size() == 1); |
| 64 const SubstitutionList& output_subst_list = | 64 const SubstitutionList& output_subst_list = |
| 65 target_->action_values().outputs(); | 65 target_->action_values().outputs(); |
| 66 CHECK_EQ(1u, output_subst_list.list().size()) | 66 // Should have one entry exactly. |
| 67 << "Should have one entry exactly."; | 67 CHECK_EQ(1u, output_subst_list.list().size()); |
| 68 const SubstitutionPattern& output_subst = output_subst_list.list()[0]; | 68 const SubstitutionPattern& output_subst = output_subst_list.list()[0]; |
| 69 | 69 |
| 70 std::string tool_name = | 70 std::string tool_name = |
| 71 GetNinjaRulePrefixForToolchain(settings_) + | 71 GetNinjaRulePrefixForToolchain(settings_) + |
| 72 Toolchain::ToolTypeToName(Toolchain::TYPE_COPY); | 72 Toolchain::ToolTypeToName(Toolchain::TYPE_COPY); |
| 73 | 73 |
| 74 OutputFile input_dep = | 74 OutputFile input_dep = |
| 75 WriteInputDepsStampAndGetDep(std::vector<const Target*>()); | 75 WriteInputDepsStampAndGetDep(std::vector<const Target*>()); |
| 76 | 76 |
| 77 // Note that we don't write implicit deps for copy steps. "copy" only | 77 // Note that we don't write implicit deps for copy steps. "copy" only |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 path_output_.WriteFile(out_, output_file); | 110 path_output_.WriteFile(out_, output_file); |
| 111 out_ << ": " << tool_name << " "; | 111 out_ << ": " << tool_name << " "; |
| 112 path_output_.WriteFile(out_, input_file); | 112 path_output_.WriteFile(out_, input_file); |
| 113 if (!input_dep.value().empty()) { | 113 if (!input_dep.value().empty()) { |
| 114 out_ << " || "; | 114 out_ << " || "; |
| 115 path_output_.WriteFile(out_, input_dep); | 115 path_output_.WriteFile(out_, input_dep); |
| 116 } | 116 } |
| 117 out_ << std::endl; | 117 out_ << std::endl; |
| 118 } | 118 } |
| 119 } | 119 } |
| OLD | NEW |