OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to build Android APKs in a consistent manner. | 6 # to build Android APKs in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'my_package_apk', | 10 # 'target_name': 'my_package_apk', |
(...skipping 20 matching lines...) Expand all Loading... |
31 # and included in the output of this target. | 31 # and included in the output of this target. |
32 # asset_location - The directory where assets are located. | 32 # asset_location - The directory where assets are located. |
33 # generated_src_dirs - Same as additional_src_dirs except used for .java files | 33 # generated_src_dirs - Same as additional_src_dirs except used for .java files |
34 # that are generated at build time. This should be set automatically by a | 34 # that are generated at build time. This should be set automatically by a |
35 # target's dependencies. The .java files in these directories are not | 35 # target's dependencies. The .java files in these directories are not |
36 # included in the 'inputs' list (unlike additional_src_dirs). | 36 # included in the 'inputs' list (unlike additional_src_dirs). |
37 # input_jars_paths - The path to jars to be included in the classpath. This | 37 # input_jars_paths - The path to jars to be included in the classpath. This |
38 # should be filled automatically by depending on the appropriate targets. | 38 # should be filled automatically by depending on the appropriate targets. |
39 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | 39 # is_test_apk - Set to 1 if building a test apk. This prevents resources from |
40 # dependencies from being re-included. | 40 # dependencies from being re-included. |
41 # native_libs_paths - The path to any native library to be included in this | 41 # native_lib_target - The target_name of the target which generates the final |
42 # target. This should be a path in <(SHARED_LIB_DIR). A stripped copy of | 42 # shared library to be included in this apk. A stripped copy of the |
43 # the library will be included in the apk. | 43 # library will be included in the apk. |
44 # resource_dir - The directory for resources. | 44 # resource_dir - The directory for resources. |
45 # R_package - A custom Java package to generate the resource file R.java in. | 45 # R_package - A custom Java package to generate the resource file R.java in. |
46 # By default, the package given in AndroidManifest.xml will be used. | 46 # By default, the package given in AndroidManifest.xml will be used. |
47 # java_strings_grd - The name of the grd file from which to generate localized | 47 # java_strings_grd - The name of the grd file from which to generate localized |
48 # strings.xml files, if any. | 48 # strings.xml files, if any. |
49 # library_manifest_paths'- Paths to additional AndroidManifest.xml files from | 49 # library_manifest_paths'- Paths to additional AndroidManifest.xml files from |
50 # libraries. | 50 # libraries. |
51 | 51 |
52 { | 52 { |
53 'variables': { | 53 'variables': { |
54 'additional_input_paths': [], | 54 'additional_input_paths': [], |
55 'input_jars_paths': [], | 55 'input_jars_paths': [], |
56 'library_dexed_jars_paths': [], | 56 'library_dexed_jars_paths': [], |
57 'additional_src_dirs': [], | 57 'additional_src_dirs': [], |
58 'generated_src_dirs': [], | 58 'generated_src_dirs': [], |
59 'app_manifest_version_name%': '<(android_app_version_name)', | 59 'app_manifest_version_name%': '<(android_app_version_name)', |
60 'app_manifest_version_code%': '<(android_app_version_code)', | 60 'app_manifest_version_code%': '<(android_app_version_code)', |
61 'proguard_enabled%': 'false', | 61 'proguard_enabled%': 'false', |
62 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], | 62 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], |
63 'native_libs_paths': [], | 63 'native_lib_target%': '', |
64 'jar_name': 'chromium_apk_<(_target_name).jar', | 64 'jar_name': 'chromium_apk_<(_target_name).jar', |
65 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', | 65 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
66 'R_package%':'', | 66 'R_package%':'', |
67 'additional_res_dirs': [], | 67 'additional_res_dirs': [], |
68 'additional_res_packages': [], | 68 'additional_res_packages': [], |
69 'is_test_apk%': 0, | 69 'is_test_apk%': 0, |
70 'java_strings_grd%': '', | 70 'java_strings_grd%': '', |
71 'library_manifest_paths' : [], | 71 'library_manifest_paths' : [], |
72 'resource_input_paths': [], | 72 'resource_input_paths': [], |
73 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | 73 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 }], | 119 }], |
120 ['R_package != ""', { | 120 ['R_package != ""', { |
121 'variables': { | 121 'variables': { |
122 # We generate R.java in package R_package (in addition to the package | 122 # We generate R.java in package R_package (in addition to the package |
123 # listed in the AndroidManifest.xml, which is unavoidable). | 123 # listed in the AndroidManifest.xml, which is unavoidable). |
124 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], | 124 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'], |
125 'additional_res_packages': ['<(R_package)'], | 125 'additional_res_packages': ['<(R_package)'], |
126 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'], | 126 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'], |
127 }, | 127 }, |
128 }], | 128 }], |
129 ['native_libs_paths != [] and component == "shared_library"', { | 129 ['native_lib_target != "" and component == "shared_library"', { |
130 'dependencies': [ | 130 'dependencies': [ |
131 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', | 131 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', |
132 ] | 132 ] |
133 }], | 133 }], |
134 ['native_libs_paths != []', { | 134 ['native_lib_target != ""', { |
135 'variables': { | 135 'variables': { |
136 'compile_input_paths': [ '<(native_libraries_java_stamp)' ], | 136 'compile_input_paths': [ '<(native_libraries_java_stamp)' ], |
137 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], | 137 'generated_src_dirs': [ '<(native_libraries_java_dir)' ], |
| 138 'native_libs_paths': ['<(SHARED_LIB_DIR)/<(native_lib_target).>(android_
product_extension)'], |
138 }, | 139 }, |
139 'actions': [ | 140 'actions': [ |
140 { | 141 { |
141 'action_name': 'ordered_libraries_<(_target_name)', | 142 'action_name': 'ordered_libraries_<(_target_name)', |
142 'message': 'Writing dependency ordered libraries for <(_target_name).'
, | 143 'message': 'Writing dependency ordered libraries for <(_target_name).'
, |
143 'inputs': [ | 144 'inputs': [ |
144 '<(DEPTH)/build/android/pylib/build_utils.py', | 145 '<(DEPTH)/build/android/pylib/build_utils.py', |
145 '<(DEPTH)/build/android/gyp/write_ordered_libraries.py', | 146 '<(DEPTH)/build/android/gyp/write_ordered_libraries.py', |
146 '<@(native_libs_paths)', | 147 '<@(native_libs_paths)', |
147 ], | 148 ], |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 ], | 265 ], |
265 }, | 266 }, |
266 ], | 267 ], |
267 }, { | 268 }, { |
268 'variables': { | 269 'variables': { |
269 'apk_libraries_dir': '<(intermediate_dir)/libs/<(android_app_abi)', | 270 'apk_libraries_dir': '<(intermediate_dir)/libs/<(android_app_abi)', |
270 'package_input_paths': [ '<(strip_stamp)' ], | 271 'package_input_paths': [ '<(strip_stamp)' ], |
271 }, | 272 }, |
272 }], | 273 }], |
273 ], | 274 ], |
274 }], # native_libs_paths != [] | 275 }], # native_lib_target != '' |
275 ['java_strings_grd != ""', { | 276 ['java_strings_grd != ""', { |
276 'variables': { | 277 'variables': { |
277 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit
', | 278 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit
', |
278 'additional_res_dirs': ['<(res_grit_dir)'], | 279 'additional_res_dirs': ['<(res_grit_dir)'], |
279 # grit_grd_file is used by grit_action.gypi, included below. | 280 # grit_grd_file is used by grit_action.gypi, included below. |
280 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', | 281 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)', |
281 'resource_input_paths': [ | 282 'resource_input_paths': [ |
282 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir
)" <(grit_grd_file))' | 283 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir
)" <(grit_grd_file))' |
283 ], | 284 ], |
284 }, | 285 }, |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 | 551 |
551 # Add list of inputs to the command line, so if inputs change | 552 # Add list of inputs to the command line, so if inputs change |
552 # (e.g. if a Java file is removed), the command will be re-run. | 553 # (e.g. if a Java file is removed), the command will be re-run. |
553 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 554 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
554 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 555 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
555 | 556 |
556 ] | 557 ] |
557 }, | 558 }, |
558 ], | 559 ], |
559 } | 560 } |
OLD | NEW |