| 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_OBJECT_H_ | 5 #ifndef TOOLS_GN_XCODE_OBJECT_H_ |
| 6 #define TOOLS_GN_XCODE_OBJECT_H_ | 6 #define TOOLS_GN_XCODE_OBJECT_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 class PBXGroup; | 51 class PBXGroup; |
| 52 class PBXNativeTarget; | 52 class PBXNativeTarget; |
| 53 class PBXObject; | 53 class PBXObject; |
| 54 class PBXProject; | 54 class PBXProject; |
| 55 class PBXShellScriptBuildPhase; | 55 class PBXShellScriptBuildPhase; |
| 56 class PBXSourcesBuildPhase; | 56 class PBXSourcesBuildPhase; |
| 57 class PBXTarget; | 57 class PBXTarget; |
| 58 class XCBuildConfiguration; | 58 class XCBuildConfiguration; |
| 59 class XCConfigurationList; | 59 class XCConfigurationList; |
| 60 | 60 |
| 61 using PBXAttributes = std::map<std::string, std::string>; | 61 using PBXAttributes = std::multimap<std::string, std::string>; |
| 62 | 62 |
| 63 // PBXObjectVisitor ----------------------------------------------------------- | 63 // PBXObjectVisitor ----------------------------------------------------------- |
| 64 | 64 |
| 65 class PBXObjectVisitor { | 65 class PBXObjectVisitor { |
| 66 public: | 66 public: |
| 67 PBXObjectVisitor(); | 67 PBXObjectVisitor(); |
| 68 virtual ~PBXObjectVisitor(); | 68 virtual ~PBXObjectVisitor(); |
| 69 virtual void Visit(PBXObject* object) = 0; | 69 virtual void Visit(PBXObject* object) = 0; |
| 70 | 70 |
| 71 private: | 71 private: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 DISALLOW_COPY_AND_ASSIGN(PBXAggregateTarget); | 149 DISALLOW_COPY_AND_ASSIGN(PBXAggregateTarget); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 // PBXBuildFile --------------------------------------------------------------- | 152 // PBXBuildFile --------------------------------------------------------------- |
| 153 | 153 |
| 154 class PBXBuildFile : public PBXObject { | 154 class PBXBuildFile : public PBXObject { |
| 155 public: | 155 public: |
| 156 PBXBuildFile(const PBXFileReference* file_reference, | 156 PBXBuildFile(const PBXFileReference* file_reference, |
| 157 const PBXSourcesBuildPhase* build_phase); | 157 const PBXSourcesBuildPhase* build_phase, |
| 158 const std::string& cflags); |
| 158 ~PBXBuildFile() override; | 159 ~PBXBuildFile() override; |
| 159 | 160 |
| 160 // PXBObject implementation. | 161 // PXBObject implementation. |
| 161 PBXObjectClass Class() const override; | 162 PBXObjectClass Class() const override; |
| 162 std::string Name() const override; | 163 std::string Name() const override; |
| 163 void Print(std::ostream& out, unsigned indent) const override; | 164 void Print(std::ostream& out, unsigned indent) const override; |
| 164 | 165 |
| 165 private: | 166 private: |
| 166 const PBXFileReference* file_reference_; | 167 const PBXFileReference* file_reference_; |
| 167 const PBXSourcesBuildPhase* build_phase_; | 168 const PBXSourcesBuildPhase* build_phase_; |
| 169 std::string cflags_; |
| 168 | 170 |
| 169 DISALLOW_COPY_AND_ASSIGN(PBXBuildFile); | 171 DISALLOW_COPY_AND_ASSIGN(PBXBuildFile); |
| 170 }; | 172 }; |
| 171 | 173 |
| 172 // PBXFileReference ----------------------------------------------------------- | 174 // PBXFileReference ----------------------------------------------------------- |
| 173 | 175 |
| 174 class PBXFileReference : public PBXObject { | 176 class PBXFileReference : public PBXObject { |
| 175 public: | 177 public: |
| 176 PBXFileReference(const std::string& name, | 178 PBXFileReference(const std::string& name, |
| 177 const std::string& path, | 179 const std::string& path, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 public: | 242 public: |
| 241 PBXNativeTarget(const std::string& name, | 243 PBXNativeTarget(const std::string& name, |
| 242 const std::string& shell_script, | 244 const std::string& shell_script, |
| 243 const std::string& config_name, | 245 const std::string& config_name, |
| 244 const PBXAttributes& attributes, | 246 const PBXAttributes& attributes, |
| 245 const std::string& product_type, | 247 const std::string& product_type, |
| 246 const std::string& product_name, | 248 const std::string& product_name, |
| 247 const PBXFileReference* product_reference); | 249 const PBXFileReference* product_reference); |
| 248 ~PBXNativeTarget() override; | 250 ~PBXNativeTarget() override; |
| 249 | 251 |
| 250 void AddFileForIndexing(const PBXFileReference* file_reference); | 252 void AddFileForIndexing(const PBXFileReference* file_reference, |
| 253 const std::string& cflags); |
| 251 | 254 |
| 252 // PBXObject implementation. | 255 // PBXObject implementation. |
| 253 PBXObjectClass Class() const override; | 256 PBXObjectClass Class() const override; |
| 254 void Print(std::ostream& out, unsigned indent) const override; | 257 void Print(std::ostream& out, unsigned indent) const override; |
| 255 | 258 |
| 256 private: | 259 private: |
| 257 const PBXFileReference* product_reference_; | 260 const PBXFileReference* product_reference_; |
| 258 std::string product_type_; | 261 std::string product_type_; |
| 259 std::string product_name_; | 262 std::string product_name_; |
| 260 | 263 |
| 261 DISALLOW_COPY_AND_ASSIGN(PBXNativeTarget); | 264 DISALLOW_COPY_AND_ASSIGN(PBXNativeTarget); |
| 262 }; | 265 }; |
| 263 | 266 |
| 264 // PBXProject ----------------------------------------------------------------- | 267 // PBXProject ----------------------------------------------------------------- |
| 265 | 268 |
| 266 class PBXProject : public PBXObject { | 269 class PBXProject : public PBXObject { |
| 267 public: | 270 public: |
| 268 PBXProject(const std::string& name, | 271 PBXProject(const std::string& name, |
| 269 const std::string& config_name, | 272 const std::string& config_name, |
| 270 const std::string& source_path, | 273 const std::string& source_path, |
| 271 const PBXAttributes& attributes); | 274 const PBXAttributes& attributes); |
| 272 ~PBXProject() override; | 275 ~PBXProject() override; |
| 273 | 276 |
| 274 void AddSourceFile(const std::string& source_path); | 277 static bool SourceFileShouldBeIndexed(const std::string& sourcePath); |
| 278 |
| 279 void AddSourceFile(const std::string& source_path, const std::string& cflags); |
| 275 void AddAggregateTarget(const std::string& name, | 280 void AddAggregateTarget(const std::string& name, |
| 276 const std::string& shell_script); | 281 const std::string& shell_script); |
| 277 void AddNativeTarget(const std::string& name, | 282 void AddNativeTarget(const std::string& name, |
| 278 const std::string& type, | 283 const std::string& type, |
| 279 const std::string& output_name, | 284 const std::string& output_name, |
| 280 const std::string& output_type, | 285 const std::string& output_type, |
| 281 const std::string& shell_script); | 286 const std::string& shell_script); |
| 282 | 287 |
| 283 void SetProjectDirPath(const std::string& project_dir_path); | 288 void SetProjectDirPath(const std::string& project_dir_path); |
| 284 void SetProjectRoot(const std::string& project_root); | 289 void SetProjectRoot(const std::string& project_root); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 void Print(std::ostream& out, unsigned indent) const override; | 390 void Print(std::ostream& out, unsigned indent) const override; |
| 386 | 391 |
| 387 private: | 392 private: |
| 388 std::vector<std::unique_ptr<XCBuildConfiguration>> configurations_; | 393 std::vector<std::unique_ptr<XCBuildConfiguration>> configurations_; |
| 389 const PBXObject* owner_reference_; | 394 const PBXObject* owner_reference_; |
| 390 | 395 |
| 391 DISALLOW_COPY_AND_ASSIGN(XCConfigurationList); | 396 DISALLOW_COPY_AND_ASSIGN(XCConfigurationList); |
| 392 }; | 397 }; |
| 393 | 398 |
| 394 #endif // TOOLS_GN_XCODE_OBJECT_H_ | 399 #endif // TOOLS_GN_XCODE_OBJECT_H_ |
| OLD | NEW |