| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_QT_CREATOR_WRITER_H_ | 5 #ifndef TOOLS_GN_QT_CREATOR_WRITER_H_ |
| 6 #define TOOLS_GN_QT_CREATOR_WRITER_H_ | 6 #define TOOLS_GN_QT_CREATOR_WRITER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "tools/gn/err.h" | 13 #include "tools/gn/err.h" |
| 14 #include "tools/gn/target.h" | 14 #include "tools/gn/target.h" |
| 15 | 15 |
| 16 class Builder; | 16 class Builder; |
| 17 class BuildSettings; | 17 class BuildSettings; |
| 18 | 18 |
| 19 class QtCreatorWriter { | 19 class QtCreatorWriter { |
| 20 public: | 20 public: |
| 21 static bool RunAndWriteFile(const BuildSettings* build_settings, | 21 static bool RunAndWriteFile(const BuildSettings* build_settings, |
| 22 const Builder* builder, | 22 const Builder& builder, |
| 23 Err* err, | 23 Err* err, |
| 24 const std::string& root_target); | 24 const std::string& root_target); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 QtCreatorWriter(const BuildSettings* build_settings, | 27 QtCreatorWriter(const BuildSettings* build_settings, |
| 28 const Builder* builder, | 28 const Builder& builder, |
| 29 const base::FilePath& project_prefix, | 29 const base::FilePath& project_prefix, |
| 30 const std::string& root_target_name); | 30 const std::string& root_target_name); |
| 31 ~QtCreatorWriter(); | 31 ~QtCreatorWriter(); |
| 32 | 32 |
| 33 void Run(); | 33 void Run(); |
| 34 | 34 |
| 35 bool DiscoverTargets(); | 35 bool DiscoverTargets(); |
| 36 void HandleTarget(const Target* target); | 36 void HandleTarget(const Target* target); |
| 37 | 37 |
| 38 void CollectDeps(const Target* target); | 38 void CollectDeps(const Target* target); |
| 39 void AddToSources(const Target::FileList& files); | 39 void AddToSources(const Target::FileList& files); |
| 40 void GenerateFile(const base::FilePath::CharType* suffix, | 40 void GenerateFile(const base::FilePath::CharType* suffix, |
| 41 const std::set<std::string>& items); | 41 const std::set<std::string>& items); |
| 42 | 42 |
| 43 const BuildSettings* build_settings_; | 43 const BuildSettings* build_settings_; |
| 44 const Builder* builder_; | 44 const Builder& builder_; |
| 45 base::FilePath project_prefix_; | 45 base::FilePath project_prefix_; |
| 46 std::string root_target_name_; | 46 std::string root_target_name_; |
| 47 std::set<const Target*> targets_; | 47 std::set<const Target*> targets_; |
| 48 std::set<std::string> sources_; | 48 std::set<std::string> sources_; |
| 49 std::set<std::string> includes_; | 49 std::set<std::string> includes_; |
| 50 std::set<std::string> defines_; | 50 std::set<std::string> defines_; |
| 51 Err err_; | 51 Err err_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(QtCreatorWriter); | 53 DISALLOW_COPY_AND_ASSIGN(QtCreatorWriter); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // TOOLS_GN_QT_CREATOR_WRITER_H_ | 56 #endif // TOOLS_GN_QT_CREATOR_WRITER_H_ |
| OLD | NEW |