| 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 #ifndef TOOLS_GN_XCODE_WRITER_H_ | 5 #ifndef TOOLS_GN_XCODE_WRITER_H_ |
| 6 #define TOOLS_GN_XCODE_WRITER_H_ | 6 #define TOOLS_GN_XCODE_WRITER_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 | 15 |
| 16 class Builder; | 16 class Builder; |
| 17 class BuildSettings; | 17 class BuildSettings; |
| 18 class Err; | 18 class Err; |
| 19 class SourceDir; | 19 class SourceDir; |
| 20 class Target; | 20 class Target; |
| 21 | 21 |
| 22 using PBXAttributes = std::map<std::string, std::string>; | 22 using PBXAttributes = std::map<std::string, std::string>; |
| 23 class PBXProject; | 23 class PBXProject; |
| 24 | 24 |
| 25 namespace base { |
| 26 class FilePath; |
| 27 } |
| 28 |
| 25 class XcodeWriter { | 29 class XcodeWriter { |
| 26 public: | 30 public: |
| 27 enum TargetOsType { | 31 enum TargetOsType { |
| 28 WRITER_TARGET_OS_IOS, | 32 WRITER_TARGET_OS_IOS, |
| 29 WRITER_TARGET_OS_MACOS, | 33 WRITER_TARGET_OS_MACOS, |
| 30 }; | 34 }; |
| 31 | 35 |
| 32 // Writes Xcode workspace and project files. | 36 // Writes Xcode workspace and project files. |
| 33 // | 37 // |
| 34 // |workspace_name| is the optional name of the workspace file name ("all" | 38 // |workspace_name| is the optional name of the workspace file name ("all" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 62 | 66 |
| 63 // Generate the "products.xcodeproj" project that reference all products | 67 // Generate the "products.xcodeproj" project that reference all products |
| 64 // (i.e. targets that have a build artefact usable from Xcode, mostly | 68 // (i.e. targets that have a build artefact usable from Xcode, mostly |
| 65 // application bundles). | 69 // application bundles). |
| 66 void CreateProductsProject(const std::vector<const Target*>& targets, | 70 void CreateProductsProject(const std::vector<const Target*>& targets, |
| 67 const PBXAttributes& attributes, | 71 const PBXAttributes& attributes, |
| 68 const std::string& source_path, | 72 const std::string& source_path, |
| 69 const std::string& config_name, | 73 const std::string& config_name, |
| 70 const std::string& root_target, | 74 const std::string& root_target, |
| 71 const std::string& ninja_extra_args, | 75 const std::string& ninja_extra_args, |
| 76 const BuildSettings* build_settings, |
| 72 TargetOsType target_os); | 77 TargetOsType target_os); |
| 73 | 78 |
| 74 // Generates the "sources.xcodeproj" project that reference all source | 79 // Generates the "sources.xcodeproj" project that reference all source |
| 75 // files to allow Xcode to index them. | 80 // files to allow Xcode to index them. |
| 76 void CreateSourcesProject(const std::vector<const Target*>& targets, | 81 void CreateSourcesProject(const std::vector<const Target*>& targets, |
| 77 const SourceDir& root_build_dir, | 82 const SourceDir& root_build_dir, |
| 78 const PBXAttributes& attributes, | 83 const PBXAttributes& attributes, |
| 79 const std::string& source_path, | 84 const std::string& source_path, |
| 80 const std::string& config_name, | 85 const std::string& config_name, |
| 81 TargetOsType target_os); | 86 TargetOsType target_os); |
| 82 | 87 |
| 83 bool WriteFiles(const BuildSettings* build_settings, Err* err); | 88 bool WriteFiles(const BuildSettings* build_settings, Err* err); |
| 84 bool WriteProjectFile(const BuildSettings* build_settings, | 89 bool WriteProjectFile(const BuildSettings* build_settings, |
| 85 PBXProject* project, | 90 PBXProject* project, |
| 86 Err* err); | 91 Err* err); |
| 87 | 92 |
| 88 void WriteWorkspaceContent(std::ostream& out); | 93 void WriteWorkspaceContent(std::ostream& out); |
| 89 void WriteProjectContent(std::ostream& out, PBXProject* project); | 94 void WriteProjectContent(std::ostream& out, PBXProject* project); |
| 90 | 95 |
| 91 std::string name_; | 96 std::string name_; |
| 92 std::vector<std::unique_ptr<PBXProject>> projects_; | 97 std::vector<std::unique_ptr<PBXProject>> projects_; |
| 93 | 98 |
| 94 DISALLOW_COPY_AND_ASSIGN(XcodeWriter); | 99 DISALLOW_COPY_AND_ASSIGN(XcodeWriter); |
| 95 }; | 100 }; |
| 96 | 101 |
| 97 #endif // TOOLS_GN_XCODE_WRITER_H_ | 102 #endif // TOOLS_GN_XCODE_WRITER_H_ |
| OLD | NEW |