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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // Sort sources to ensure determinisn of the project file generation and | 346 // Sort sources to ensure determinisn of the project file generation and |
347 // remove duplicate reference to the source files (can happen due to the | 347 // remove duplicate reference to the source files (can happen due to the |
348 // bundle_data targets). | 348 // bundle_data targets). |
349 std::sort(sources.begin(), sources.end()); | 349 std::sort(sources.begin(), sources.end()); |
350 sources.erase(std::unique(sources.begin(), sources.end()), sources.end()); | 350 sources.erase(std::unique(sources.begin(), sources.end()), sources.end()); |
351 | 351 |
352 SourceDir source_dir("//"); | 352 SourceDir source_dir("//"); |
353 for (const SourceFile& source : sources) { | 353 for (const SourceFile& source : sources) { |
354 std::string source_file = | 354 std::string source_file = |
355 RebasePath(source.value(), source_dir, absolute_source_path); | 355 RebasePath(source.value(), source_dir, absolute_source_path); |
356 sources_for_indexing->AddSourceFile(source_file); | 356 sources_for_indexing->AddSourceFile(source_file, source_file); |
357 } | 357 } |
358 | 358 |
359 projects_.push_back(std::move(sources_for_indexing)); | 359 projects_.push_back(std::move(sources_for_indexing)); |
360 } | 360 } |
361 | 361 |
362 bool XcodeWriter::WriteFiles(const BuildSettings* build_settings, Err* err) { | 362 bool XcodeWriter::WriteFiles(const BuildSettings* build_settings, Err* err) { |
363 for (const auto& project : projects_) { | 363 for (const auto& project : projects_) { |
364 if (!WriteProjectFile(build_settings, project.get(), err)) | 364 if (!WriteProjectFile(build_settings, project.get(), err)) |
365 return false; | 365 return false; |
366 } | 366 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 for (auto* object : pair.second) { | 427 for (auto* object : pair.second) { |
428 object->Print(out, 2); | 428 object->Print(out, 2); |
429 } | 429 } |
430 out << "/* End " << ToString(pair.first) << " section */\n"; | 430 out << "/* End " << ToString(pair.first) << " section */\n"; |
431 } | 431 } |
432 | 432 |
433 out << "\t};\n" | 433 out << "\t};\n" |
434 << "\trootObject = " << project->Reference() << ";\n" | 434 << "\trootObject = " << project->Reference() << ";\n" |
435 << "}\n"; | 435 << "}\n"; |
436 } | 436 } |
OLD | NEW |