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