| 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_BUNDLE_DATA_H_ | 5 #ifndef TOOLS_GN_BUNDLE_DATA_H_ |
| 6 #define TOOLS_GN_BUNDLE_DATA_H_ | 6 #define TOOLS_GN_BUNDLE_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "tools/gn/action_values.h" |
| 11 #include "tools/gn/bundle_file_rule.h" | 12 #include "tools/gn/bundle_file_rule.h" |
| 12 #include "tools/gn/source_dir.h" | 13 #include "tools/gn/source_dir.h" |
| 14 #include "tools/gn/source_file.h" |
| 15 #include "tools/gn/substitution_list.h" |
| 13 #include "tools/gn/unique_vector.h" | 16 #include "tools/gn/unique_vector.h" |
| 14 | 17 |
| 15 class OutputFile; | 18 class OutputFile; |
| 16 class SourceFile; | |
| 17 class Settings; | 19 class Settings; |
| 18 class Target; | 20 class Target; |
| 19 | 21 |
| 20 // Returns true if |source| correspond to the path of a file in an asset | 22 // Returns true if |source| correspond to the path of a file in an asset |
| 21 // catalog. If defined |asset_catalog| is set to its path. | 23 // catalog. If defined |asset_catalog| is set to its path. |
| 22 // | 24 // |
| 23 // An asset catalog is an OS X bundle with the ".xcassets" extension. It | 25 // An asset catalog is an OS X bundle with the ".xcassets" extension. It |
| 24 // contains one directory per assets each of them with the ".imageset" | 26 // contains one directory per assets each of them with the ".imageset" |
| 25 // extension. | 27 // extension. |
| 26 // | 28 // |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 99 |
| 98 SourceDir& executable_dir() { return executable_dir_; } | 100 SourceDir& executable_dir() { return executable_dir_; } |
| 99 const SourceDir& executable_dir() const { return executable_dir_; } | 101 const SourceDir& executable_dir() const { return executable_dir_; } |
| 100 | 102 |
| 101 SourceDir& plugins_dir() { return plugins_dir_; } | 103 SourceDir& plugins_dir() { return plugins_dir_; } |
| 102 const SourceDir& plugins_dir() const { return plugins_dir_; } | 104 const SourceDir& plugins_dir() const { return plugins_dir_; } |
| 103 | 105 |
| 104 std::string& product_type() { return product_type_; } | 106 std::string& product_type() { return product_type_; } |
| 105 const std::string& product_type() const { return product_type_; } | 107 const std::string& product_type() const { return product_type_; } |
| 106 | 108 |
| 109 void set_code_signing_script(const SourceFile& script_file) { |
| 110 code_signing_script_ = script_file; |
| 111 } |
| 112 const SourceFile& code_signing_script() const { return code_signing_script_; } |
| 113 |
| 114 std::vector<SourceFile>& code_signing_sources() { |
| 115 return code_signing_sources_; |
| 116 } |
| 117 const std::vector<SourceFile>& code_signing_sources() const { |
| 118 return code_signing_sources_; |
| 119 } |
| 120 |
| 121 SubstitutionList& code_signing_outputs() { return code_signing_outputs_; } |
| 122 const SubstitutionList& code_signing_outputs() const { |
| 123 return code_signing_outputs_; |
| 124 } |
| 125 |
| 126 SubstitutionList& code_signing_args() { return code_signing_args_; } |
| 127 const SubstitutionList& code_signing_args() const { |
| 128 return code_signing_args_; |
| 129 } |
| 130 |
| 107 // Recursive collection of all bundle_data that the target depends on. | 131 // Recursive collection of all bundle_data that the target depends on. |
| 108 const UniqueTargets& bundle_deps() const { return bundle_deps_; } | 132 const UniqueTargets& bundle_deps() const { return bundle_deps_; } |
| 109 | 133 |
| 110 private: | 134 private: |
| 111 SourceFiles asset_catalog_sources_; | 135 SourceFiles asset_catalog_sources_; |
| 112 BundleFileRules file_rules_; | 136 BundleFileRules file_rules_; |
| 113 UniqueTargets bundle_deps_; | 137 UniqueTargets bundle_deps_; |
| 114 | 138 |
| 115 // All those values are subdirectories relative to root_build_dir, and apart | 139 // All those values are subdirectories relative to root_build_dir, and apart |
| 116 // from root_dir, they are either equal to root_dir_ or subdirectories of it. | 140 // from root_dir, they are either equal to root_dir_ or subdirectories of it. |
| 117 SourceDir root_dir_; | 141 SourceDir root_dir_; |
| 118 SourceDir resources_dir_; | 142 SourceDir resources_dir_; |
| 119 SourceDir executable_dir_; | 143 SourceDir executable_dir_; |
| 120 SourceDir plugins_dir_; | 144 SourceDir plugins_dir_; |
| 121 | 145 |
| 122 // This is the target type as known to Xcode. This is only used to generate | 146 // This is the target type as known to Xcode. This is only used to generate |
| 123 // the Xcode project file when using --ide=xcode. | 147 // the Xcode project file when using --ide=xcode. |
| 124 std::string product_type_; | 148 std::string product_type_; |
| 125 | 149 |
| 150 // Holds the values (script name, sources, outputs, script arguments) for the |
| 151 // code signing step if defined. |
| 152 SourceFile code_signing_script_; |
| 153 std::vector<SourceFile> code_signing_sources_; |
| 154 SubstitutionList code_signing_outputs_; |
| 155 SubstitutionList code_signing_args_; |
| 156 |
| 126 DISALLOW_COPY_AND_ASSIGN(BundleData); | 157 DISALLOW_COPY_AND_ASSIGN(BundleData); |
| 127 }; | 158 }; |
| 128 | 159 |
| 129 #endif // TOOLS_GN_BUNDLE_DATA_H_ | 160 #endif // TOOLS_GN_BUNDLE_DATA_H_ |
| OLD | NEW |