| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/xcode_writer.h" | 5 #include "tools/gn/xcode_writer.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 for (const SourceFile& file : target->sources()) { | 163 for (const SourceFile& file : target->sources()) { |
| 164 if (base::EndsWith(file.GetName(), kEarlGreyFileNameIdentifier, | 164 if (base::EndsWith(file.GetName(), kEarlGreyFileNameIdentifier, |
| 165 base::CompareCase::SENSITIVE) || | 165 base::CompareCase::SENSITIVE) || |
| 166 base::EndsWith(file.GetName(), kXCTestFileNameIdentifier, | 166 base::EndsWith(file.GetName(), kXCTestFileNameIdentifier, |
| 167 base::CompareCase::SENSITIVE)) { | 167 base::CompareCase::SENSITIVE)) { |
| 168 xctest_files.push_back(file); | 168 xctest_files.push_back(file); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 // Call recursively on public and private deps. | 172 // Call recursively on public and private deps. |
| 173 for (const auto& target : target->public_deps()) { | 173 for (const auto& t : target->public_deps()) { |
| 174 SearchXCTestFiles(target.ptr, xctest_files_per_target); | 174 SearchXCTestFiles(t.ptr, xctest_files_per_target); |
| 175 const Target::FileList& deps_xctest_files = | 175 const Target::FileList& deps_xctest_files = |
| 176 (*xctest_files_per_target)[target.ptr]; | 176 (*xctest_files_per_target)[t.ptr]; |
| 177 xctest_files.insert(xctest_files.end(), deps_xctest_files.begin(), | 177 xctest_files.insert(xctest_files.end(), deps_xctest_files.begin(), |
| 178 deps_xctest_files.end()); | 178 deps_xctest_files.end()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 for (const auto& target : target->private_deps()) { | 181 for (const auto& t : target->private_deps()) { |
| 182 SearchXCTestFiles(target.ptr, xctest_files_per_target); | 182 SearchXCTestFiles(t.ptr, xctest_files_per_target); |
| 183 const Target::FileList& deps_xctest_files = | 183 const Target::FileList& deps_xctest_files = |
| 184 (*xctest_files_per_target)[target.ptr]; | 184 (*xctest_files_per_target)[t.ptr]; |
| 185 xctest_files.insert(xctest_files.end(), deps_xctest_files.begin(), | 185 xctest_files.insert(xctest_files.end(), deps_xctest_files.begin(), |
| 186 deps_xctest_files.end()); | 186 deps_xctest_files.end()); |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Sort xctest_files to remove duplicates. | 189 // Sort xctest_files to remove duplicates. |
| 190 std::sort(xctest_files.begin(), xctest_files.end()); | 190 std::sort(xctest_files.begin(), xctest_files.end()); |
| 191 xctest_files.erase(std::unique(xctest_files.begin(), xctest_files.end()), | 191 xctest_files.erase(std::unique(xctest_files.begin(), xctest_files.end()), |
| 192 xctest_files.end()); | 192 xctest_files.end()); |
| 193 | 193 |
| 194 xctest_files_per_target->insert(std::make_pair(target, xctest_files)); | 194 xctest_files_per_target->insert(std::make_pair(target, xctest_files)); |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 for (auto* object : pair.second) { | 654 for (auto* object : pair.second) { |
| 655 object->Print(out, 2); | 655 object->Print(out, 2); |
| 656 } | 656 } |
| 657 out << "/* End " << ToString(pair.first) << " section */\n"; | 657 out << "/* End " << ToString(pair.first) << " section */\n"; |
| 658 } | 658 } |
| 659 | 659 |
| 660 out << "\t};\n" | 660 out << "\t};\n" |
| 661 << "\trootObject = " << project->Reference() << ";\n" | 661 << "\trootObject = " << project->Reference() << ";\n" |
| 662 << "}\n"; | 662 << "}\n"; |
| 663 } | 663 } |
| OLD | NEW |