OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 # Generates the final .pak file whitelist that can be used by repack()'s |
| 6 # repack_whitelist parameter. Used resources are tracked by the toolchain when |
| 7 # enable_resource_whitelist_generation = true, and per-.o and per-.so .whitelist |
| 8 # files are generated. However, there are a couple of IDs (IDS_VERSION_UI_32BIT |
| 9 # and IDS_VERSION_UI_64BIT) that should always be included, and which are not |
| 10 # referenced in code. This action adds in these two ids to an existing |
| 11 # .so.whitelist. |
| 12 # |
| 13 # Variables |
| 14 # input: Path to the .whitelist created by the toolchain. |
| 15 # output: Path to write the output whitelist to. |
| 16 # |
| 17 # Example |
| 18 # generate_resource_whitelist("pak_whitelist") { |
| 19 # deps = [ ":my_shared_library" ] |
| 20 # input = "$root_out_dir/libmy_shared_library$shlib_extension.whitelist" |
| 21 # output = "$target_gen_dir/pak_whitelist.txt" |
| 22 # } |
| 23 template("generate_resource_whitelist") { |
| 24 action(target_name) { |
| 25 forward_variables_from(invoker, [ "deps" ]) |
| 26 assert(is_android, |
| 27 "Resource whitelist currently implemented only on Android") |
| 28 |
| 29 script = "//tools/resources/generate_resource_whitelist.py" |
| 30 |
| 31 inputs = [ |
| 32 invoker.input, |
| 33 ] |
| 34 |
| 35 outputs = [ |
| 36 invoker.output, |
| 37 ] |
| 38 |
| 39 args = [ |
| 40 "-i", |
| 41 rebase_path(invoker.input, root_build_dir), |
| 42 "-o", |
| 43 rebase_path(invoker.output, root_build_dir), |
| 44 "--out-dir=.", |
| 45 "--use-existing-resource-ids", |
| 46 ] |
| 47 } |
| 48 } |
OLD | NEW |