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_NINJA_CREATE_BUNDLE_TARGET_WRITER_H_ | 5 #ifndef TOOLS_GN_NINJA_CREATE_BUNDLE_TARGET_WRITER_H_ |
6 #define TOOLS_GN_NINJA_CREATE_BUNDLE_TARGET_WRITER_H_ | 6 #define TOOLS_GN_NINJA_CREATE_BUNDLE_TARGET_WRITER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "tools/gn/ninja_target_writer.h" | 9 #include "tools/gn/ninja_target_writer.h" |
10 | 10 |
11 // Writes a .ninja file for a bundle_data target type. | 11 // Writes a .ninja file for a bundle_data target type. |
12 class NinjaCreateBundleTargetWriter : public NinjaTargetWriter { | 12 class NinjaCreateBundleTargetWriter : public NinjaTargetWriter { |
13 public: | 13 public: |
14 NinjaCreateBundleTargetWriter(const Target* target, std::ostream& out); | 14 NinjaCreateBundleTargetWriter(const Target* target, std::ostream& out); |
15 ~NinjaCreateBundleTargetWriter() override; | 15 ~NinjaCreateBundleTargetWriter() override; |
16 | 16 |
17 void Run() override; | 17 void Run() override; |
18 | 18 |
19 private: | 19 private: |
| 20 // Writes the Ninja rule for invoking the code signing script. |
| 21 // |
| 22 // Returns the name of the custom rule generated for the code signing step if |
| 23 // defined, otherwise returns an empty string. |
| 24 std::string WriteCodeSigningRuleDefinition(); |
| 25 |
| 26 // Writes the rule to copy files into the bundle. |
| 27 // |
| 28 // input_dep is a file expressing the shared dependencies. It will be a |
| 29 // stamp file if there is more than one. |
| 30 void WriteCopyBundleDataRules(const OutputFile& input_dep, |
| 31 std::vector<OutputFile>* output_files); |
| 32 |
| 33 // Writes the rule to compile assets catalogs. |
| 34 // |
| 35 // input_dep is a file expressing the shared dependencies. It will be a |
| 36 // stamp file if there is more than one. |
| 37 void WriteCompileAssetsCatalogRule(const OutputFile& input_dep, |
| 38 std::vector<OutputFile>* output_files); |
| 39 |
| 40 // Writes the code signing rule (if a script is defined). |
| 41 // |
| 42 // input_dep is a file expressing the shared dependencies. It will be a |
| 43 // stamp file if there is more than one. As the code signing may include |
| 44 // a manifest of the file, this will depends on all files in output_files |
| 45 // too. |
| 46 void WriteCodeSigningRules(const std::string& code_signing_rule_name, |
| 47 const OutputFile& input_dep, |
| 48 std::vector<OutputFile>* output_files); |
| 49 |
| 50 // Writes the stamp file for the code signing input dependencies. |
| 51 OutputFile WriteCodeSigningInputDepsStamp( |
| 52 const OutputFile& input_dep, |
| 53 std::vector<OutputFile>* output_files); |
| 54 |
20 DISALLOW_COPY_AND_ASSIGN(NinjaCreateBundleTargetWriter); | 55 DISALLOW_COPY_AND_ASSIGN(NinjaCreateBundleTargetWriter); |
21 }; | 56 }; |
22 | 57 |
23 #endif // TOOLS_GN_NINJA_CREATE_BUNDLE_TARGET_WRITER_H_ | 58 #endif // TOOLS_GN_NINJA_CREATE_BUNDLE_TARGET_WRITER_H_ |
OLD | NEW |