Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame] | 1 | # Copyright 2015 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 | # Creates a resources.zip with locale.pak files placed into appropriate |
| 6 | # resource configs (e.g. en-GB.pak -> res/raw-en/en_gb.pak). Also generates |
| 7 | # a locale_paks TypedArray so that resource files can be enumerated at runtime. |
| 8 | # |
| 9 | # If this target is included in the deps of an android resources/library/apk, |
| 10 | # the resources will be included with that target. |
| 11 | # |
| 12 | # Variables: |
| 13 | # locale_pak_files - List of .pak files to process. |
| 14 | # Names must be of the form "en.pak" or "en-US.pak". |
| 15 | # resource_zip_path - the path of generated zip file, optional, normally, you |
| 16 | # don't need to set this variable. |
| 17 | # |
| 18 | # Example |
| 19 | # { |
| 20 | # 'target_name': 'my_locale_resources', |
| 21 | # 'type': 'none', |
| 22 | # 'variables': { |
| 23 | # 'locale_paks_files': ['path1/fr.pak'], |
| 24 | # }, |
| 25 | # 'includes': [ '../build/android/locale_pak_resources.gypi' ], |
| 26 | # }, |
| 27 | # |
| 28 | { |
| 29 | 'variables': { |
| 30 | 'resources_zip_path%': '<(PRODUCT_DIR)/res.java/<(_target_name).zip', |
| 31 | }, |
| 32 | 'all_dependent_settings': { |
| 33 | 'variables': { |
| 34 | 'additional_locale_input_paths': ['<(resources_zip_path)'], |
| 35 | 'dependencies_locale_zip_paths': ['<(resources_zip_path)'], |
| 36 | }, |
| 37 | }, |
| 38 | 'actions': [{ |
| 39 | 'action_name': '<(_target_name)_locale_pak_resources', |
| 40 | 'inputs': [ |
| 41 | '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 42 | '<(DEPTH)/build/android/gyp/locale_pak_resources.py', |
| 43 | '<@(locale_pak_files)', |
| 44 | ], |
| 45 | 'outputs': [ |
| 46 | '<(resources_zip_path)', |
| 47 | ], |
| 48 | 'action': [ |
| 49 | 'python', '<(DEPTH)/build/android/gyp/locale_pak_resources.py', |
| 50 | '--locale-paks', '<(locale_pak_files)', |
| 51 | '--resources-zip', '<(resources_zip_path)', |
| 52 | ], |
| 53 | }], |
| 54 | } |