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