OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 declare_args() { | 5 import("//tools/grit/grit_rule.gni") |
6 # Absolute path to a resource whitelist (generated using | |
7 # //tools/resources/find_used_resources.py). | |
8 repack_whitelist = "" | |
9 } | |
10 | 6 |
11 # This file defines a template to invoke grit repack in a consistent manner. | 7 # This file defines a template to invoke grit repack in a consistent manner. |
12 # | 8 # |
13 # Parameters: | 9 # Parameters: |
14 # sources [required] | 10 # sources [required] |
15 # List of pak files that need to be combined. | 11 # List of pak files that need to be combined. |
16 # | 12 # |
17 # output [required] | 13 # output [required] |
18 # File name (single string) of the output file. | 14 # File name (single string) of the output file. |
19 # | 15 # |
(...skipping 14 matching lines...) Expand all Loading... |
34 assert(defined(invoker.output), "Need output for $target_name") | 30 assert(defined(invoker.output), "Need output for $target_name") |
35 | 31 |
36 script = "//tools/grit/grit/format/repack.py" | 32 script = "//tools/grit/grit/format/repack.py" |
37 | 33 |
38 inputs = invoker.sources | 34 inputs = invoker.sources |
39 outputs = [ | 35 outputs = [ |
40 invoker.output, | 36 invoker.output, |
41 ] | 37 ] |
42 | 38 |
43 args = [] | 39 args = [] |
44 if (repack_whitelist != "") { | 40 if (defined(invoker.repack_whitelist)) { |
45 assert( | 41 inputs += [ invoker.repack_whitelist ] |
46 repack_whitelist == rebase_path(repack_whitelist), | 42 _rebased_whitelist = rebase_path(invoker.repack_whitelist) |
47 "repack_whitelist must be an absolute path. Current value is $repack_w
hitelist") | 43 args += [ "--whitelist=$_rebased_whitelist" ] |
48 args += [ "--whitelist=$repack_whitelist" ] | 44 args += [ "--suppress-removed-key-output" ] |
49 } | 45 } |
50 args += [ rebase_path(invoker.output, root_build_dir) ] | 46 args += [ rebase_path(invoker.output, root_build_dir) ] |
51 args += rebase_path(invoker.sources, root_build_dir) | 47 args += rebase_path(invoker.sources, root_build_dir) |
52 } | 48 } |
53 } | 49 } |
54 | 50 |
55 # This template combines repacking resources and defining a bundle_data target | 51 # This template combines repacking resources and defining a bundle_data target |
56 # to move them to the application bundle. This is mostly useful on iOS. | 52 # to move them to the application bundle. This is mostly useful on iOS. |
57 # | 53 # |
58 # Parameters: | 54 # Parameters: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 outputs = [ | 99 outputs = [ |
104 invoker.bundle_output, | 100 invoker.bundle_output, |
105 ] | 101 ] |
106 } else { | 102 } else { |
107 outputs = [ | 103 outputs = [ |
108 "{{bundle_resources_dir}}/{{source_file_part}}", | 104 "{{bundle_resources_dir}}/{{source_file_part}}", |
109 ] | 105 ] |
110 } | 106 } |
111 } | 107 } |
112 } | 108 } |
OLD | NEW |