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
3 # found in the LICENSE file.
5 # This file is meant to be included into a target to provide a rule
6 # to generate localized strings.xml from a grd file.
8 # To use this, create a gyp target with the following form:
10 # 'target_name': 'my-package_strings_grd',
13 # 'grd_file': 'path/to/grd/file',
15 # 'includes': ['path/to/this/gypi/file'],
19 # grd_file - The path to the grd file to use.
22 'res_grit_dir': '<(INTERMEDIATE_DIR)/<(_target_name)/res_grit',
23 'grit_grd_file': '<(grd_file)',
24 'resource_zip_path': '<(PRODUCT_DIR)/res.java/<(_target_name).zip',
25 'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'],
26 'grit_out_dir': '<(res_grit_dir)',
27 # resource_ids is unneeded since we don't generate .h headers.
28 'grit_resource_ids': '',
30 '<!@pymod_do_main(grit_info <@(grit_defines) <@(grit_additional_defines) '
31 '--outputs \'<(grit_out_dir)\' '
32 '<(grit_grd_file) -f "<(grit_resource_ids)")',
35 'all_dependent_settings': {
37 'additional_input_paths': ['<(resource_zip_path)'],
38 'dependencies_res_zip_paths': ['<(resource_zip_path)'],
43 'action_name': 'generate_localized_strings_xml',
44 'includes': ['../build/grit_action.gypi'],
47 'action_name': 'create_resources_zip',
49 '<(DEPTH)/build/android/gyp/zip.py',
53 '<(resource_zip_path)',
56 'python', '<(DEPTH)/build/android/gyp/zip.py',
57 '--input-dir', '<(res_grit_dir)',
58 '--output', '<(resource_zip_path)',