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
3 # found in the LICENSE file.
5 # This file is meant to be included into a target to provide a rule
6 # to build Android APKs in a consistent manner.
8 # To use this, create a gyp target with the following form:
10 # 'target_name': 'my_package_apk',
13 # 'apk_name': 'MyPackage',
14 # 'java_in_dir': 'path/to/package/root',
15 # 'resource_dir': 'path/to/package/root/res',
17 # 'includes': ['path/to/this/gypi/file'],
21 # apk_name - The final apk will be named <apk_name>.apk
22 # java_in_dir - The top-level java directory. The src should be in
24 # Optional/automatic variables:
25 # additional_input_paths - These paths will be included in the 'inputs' list to
26 # ensure that this target is rebuilt when one of these paths changes.
27 # additional_res_packages - Package names of R.java files generated in addition
28 # to the default package name defined in AndroidManifest.xml.
29 # additional_src_dirs - Additional directories with .java files to be compiled
30 # and included in the output of this target.
31 # additional_bundled_libs - Additional libraries what will be stripped and
33 # asset_location - The directory where assets are located.
34 # create_density_splits - Whether to create density-based apk splits. Splits
35 # are supported only for minSdkVersion >= 21.
36 # generated_src_dirs - Same as additional_src_dirs except used for .java files
37 # that are generated at build time. This should be set automatically by a
38 # target's dependencies. The .java files in these directories are not
39 # included in the 'inputs' list (unlike additional_src_dirs).
40 # input_jars_paths - The path to jars to be included in the classpath. This
41 # should be filled automatically by depending on the appropriate targets.
42 # is_test_apk - Set to 1 if building a test apk. This prevents resources from
43 # dependencies from being re-included.
44 # native_lib_target - The target_name of the target which generates the final
45 # shared library to be included in this apk. A stripped copy of the
46 # library will be included in the apk.
47 # resource_dir - The directory for resources.
48 # shared_resources - Make a resource package that can be loaded by a different
49 # application at runtime to access the package's resources.
50 # R_package - A custom Java package to generate the resource file R.java in.
51 # By default, the package given in AndroidManifest.xml will be used.
52 # include_all_resources - Set to 1 to include all resource IDs in all generated
54 # use_chromium_linker - Enable the content dynamic linker that allows sharing the
55 # RELRO section of the native libraries between the different processes.
56 # load_library_from_zip - When using the dynamic linker, load the library
57 # directly out of the zip file.
58 # use_relocation_packer - Enable relocation packing. Relies on the chromium
59 # linker, so use_chromium_linker must also be enabled.
60 # enable_chromium_linker_tests - Enable the content dynamic linker test support
61 # code. This allows a test APK to inject a Linker.TestRunner instance at
62 # runtime. Should only be used by the chromium_linker_test_apk target!!
63 # never_lint - Set to 1 to not run lint on this target.
64 # java_in_dir_suffix - To override the /src suffix on java_in_dir.
65 # app_manifest_version_name - set the apps 'human readable' version number.
66 # app_manifest_version_code - set the apps version number.
69 'tested_apk_obfuscated_jar_path%': '/',
70 'tested_apk_dex_path%': '/',
71 'additional_input_paths': [],
72 'create_density_splits%': 0,
73 'input_jars_paths': [],
74 'library_dexed_jars_paths': [],
75 'additional_src_dirs': [],
76 'generated_src_dirs': [],
77 'app_manifest_version_name%': '<(android_app_version_name)',
78 'app_manifest_version_code%': '<(android_app_version_code)',
79 # aapt generates this proguard.txt.
80 'generated_proguard_file': '<(intermediate_dir)/proguard.txt',
81 'proguard_enabled%': 'false',
82 'proguard_flags_paths': ['<(generated_proguard_file)'],
83 'jar_name': 'chromium_apk_<(_target_name).jar',
84 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
86 'include_all_resources%': 0,
87 'additional_R_text_files': [],
88 'dependencies_res_zip_paths': [],
89 'additional_res_packages': [],
90 'additional_bundled_libs%': [],
92 'extensions_to_not_compress%': '',
93 'resource_input_paths': [],
94 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
95 'asset_location%': '<(intermediate_dir)/assets',
96 'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
97 'package_input_paths': [],
98 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
99 'additional_ordered_libraries_file': '<(intermediate_dir)/additional_native_libraries.json',
100 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLibraries.template',
101 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
102 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java',
103 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp',
104 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/',
105 'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h',
106 'native_libraries_template_version_file': '<(native_libraries_template_data_dir)/native_libraries_version.h',
107 'compile_stamp': '<(intermediate_dir)/compile.stamp',
108 'lint_stamp': '<(intermediate_dir)/lint.stamp',
109 'lint_result': '<(intermediate_dir)/lint_result.xml',
110 'lint_config': '<(intermediate_dir)/lint_config.xml',
112 'findbugs_stamp': '<(intermediate_dir)/findbugs.stamp',
114 'java_in_dir_suffix%': '/src',
115 'instr_stamp': '<(intermediate_dir)/instr.stamp',
116 'jar_stamp': '<(intermediate_dir)/jar.stamp',
117 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
118 'pack_arm_relocations_stamp': '<(intermediate_dir)/pack_arm_relocations.stamp',
119 'strip_stamp': '<(intermediate_dir)/strip.stamp',
120 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries',
121 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp',
122 'version_stamp': '<(intermediate_dir)/version.stamp',
123 'javac_includes': [],
124 'jar_excluded_classes': [],
125 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar',
126 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
127 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
128 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
129 'dex_path': '<(intermediate_dir)/classes.dex',
130 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
131 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
132 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(android_app_abi)/AndroidManifest.xml',
133 'push_stamp': '<(intermediate_dir)/push.stamp',
134 'link_stamp': '<(intermediate_dir)/link.stamp',
135 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip',
136 'shared_resources%': 0,
137 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
138 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)',
139 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_app_abi).apk',
140 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
141 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp',
142 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_target_name)/<(CONFIGURATION_NAME)',
143 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
144 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
145 'create_standalone_apk%': 1,
149 'native_lib_target%': '',
150 'native_lib_version_name%': '',
151 'use_chromium_linker%' : 0,
152 'use_relocation_packer%' : 0,
153 'enable_chromium_linker_tests%': 0,
155 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
156 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(android_app_abi)-unsigned.apk',
157 'create_abi_split%': 0,
159 'unsigned_apk_path': '<(unsigned_apk_path)',
160 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)',
161 'create_abi_split%': '<(create_abi_split)',
163 ['gyp_managed_install == 1 and native_lib_target != ""', {
165 ['create_abi_split == 0', {
166 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk',
168 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(android_app_abi)-standalone-unsigned.apk',
172 'unsigned_standalone_apk_path': '<(unsigned_apk_path)',
174 ['gyp_managed_install == 1', {
175 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
177 'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
179 ['is_test_apk == 0 and emma_coverage != 0', {
180 'emma_instrument%': 1,
182 'emma_instrument%': 0,
184 # When using abi splits, the abi split is modified by
185 # gyp_managed_install rather than the main .apk
186 ['create_abi_split == 1', {
187 'managed_input_apk_path': '<(unsigned_abi_split_apk_path)',
189 'managed_input_apk_path': '<(unsigned_apk_path)',
193 'native_lib_target%': '',
194 'native_lib_version_name%': '',
195 'use_chromium_linker%' : 0,
196 'load_library_from_zip%' : 0,
197 'use_relocation_packer%' : 0,
198 'enable_chromium_linker_tests%': 0,
199 'emma_instrument%': '<(emma_instrument)',
200 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)',
201 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
202 'unsigned_apk_path': '<(unsigned_apk_path)',
203 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)',
204 'create_abi_split%': '<(create_abi_split)',
205 'managed_input_apk_path': '<(managed_input_apk_path)',
206 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_extension)',
207 'extra_native_libs': [],
208 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_app_abi)/native_lib_placeholder.stamp',
209 'native_lib_placeholders': [],
210 'main_apk_name': '<(apk_name)',
212 # Pass the jar path to the apk's "fake" jar target. This would be better as
213 # direct_dependent_settings, but a variable set by a direct_dependent_settings
214 # cannot be lifted in a dependent to all_dependent_settings.
215 'all_dependent_settings': {
217 ['proguard_enabled == "true"', {
219 'proguard_enabled': 'true',
224 'apk_output_jar_path': '<(jar_path)',
225 'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)',
226 'tested_apk_dex_path': '<(dex_path)',
230 ['resource_dir!=""', {
232 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
235 ['R_package != ""', {
237 # We generate R.java in package R_package (in addition to the package
238 # listed in the AndroidManifest.xml, which is unavoidable).
239 'additional_res_packages': ['<(R_package)'],
240 'additional_R_text_files': ['<(intermediate_dir)/R.txt'],
243 ['native_lib_target != "" and component == "shared_library"', {
245 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
248 ['use_chromium_linker == 1', {
250 '<(DEPTH)/base/base.gyp:chromium_android_linker',
253 ['native_lib_target != ""', {
256 ['use_chromium_linker == 1', {
258 'chromium_linker_path': [
259 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)',
264 'chromium_linker_path': [],
268 'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
269 'native_libs_paths': [
270 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)',
271 '<@(chromium_linker_path)'
273 'package_input_paths': [
274 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
279 # gdbserver is always copied into the APK's native libs dir. The ant
280 # build scripts (apkbuilder task) will only include it in a debug
282 'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)',
284 '<(android_gdbserver)',
292 '<@(native_libs_paths)',
293 '<@(extra_native_libs)',
296 'includes': ['../build/android/write_ordered_libraries.gypi'],
299 'action_name': 'native_libraries_<(_target_name)',
302 ['use_chromium_linker == 1', {
304 'linker_gcc_preprocess_defines': [
305 '--defines', 'ENABLE_CHROMIUM_LINKER',
310 'linker_gcc_preprocess_defines': [],
313 ['load_library_from_zip == 1', {
315 'linker_load_from_zip_file_preprocess_defines': [
316 '--defines', 'ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE',
321 'linker_load_from_zip_file_preprocess_defines': [],
324 ['enable_chromium_linker_tests == 1', {
326 'linker_tests_gcc_preprocess_defines': [
327 '--defines', 'ENABLE_CHROMIUM_LINKER_TESTS',
332 'linker_tests_gcc_preprocess_defines': [],
336 'gcc_preprocess_defines': [
337 '<@(linker_load_from_zip_file_preprocess_defines)',
338 '<@(linker_gcc_preprocess_defines)',
339 '<@(linker_tests_gcc_preprocess_defines)',
342 'message': 'Creating NativeLibraries.java for <(_target_name)',
344 '<(DEPTH)/build/android/gyp/util/build_utils.py',
345 '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
346 '<(ordered_libraries_file)',
347 '<(native_libraries_template)',
350 '<(native_libraries_java_stamp)',
353 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
355 '--output=<(native_libraries_java_file)',
356 '--template=<(native_libraries_template)',
357 '--stamp=<(native_libraries_java_stamp)',
358 '--defines', 'NATIVE_LIBRARIES_LIST=@FileArg(<(ordered_libraries_file):java_libraries_list)',
359 '--defines', 'NATIVE_LIBRARIES_VERSION_NUMBER="<(native_lib_version_name)"',
360 '<@(gcc_preprocess_defines)',
364 'action_name': 'strip_native_libraries',
366 'ordered_libraries_file%': '<(ordered_libraries_file)',
367 'stripped_libraries_dir%': '<(stripped_libraries_dir)',
369 '<@(native_libs_paths)',
370 '<@(extra_native_libs)',
372 'stamp': '<(strip_stamp)'
374 'includes': ['../build/android/strip_native_libraries.gypi'],
377 'action_name': 'insert_chromium_version',
379 'ordered_libraries_file%': '<(ordered_libraries_file)',
380 'stripped_libraries_dir%': '<(stripped_libraries_dir)',
381 'version_string': '<(native_lib_version_name)',
385 'stamp': '<(version_stamp)'
387 'includes': ['../build/android/insert_chromium_version.gypi'],
390 'action_name': 'pack_arm_relocations',
393 ['use_chromium_linker == 1 and use_relocation_packer == 1 and profiling != 1', {
399 'exclude_packing_list': [
400 '<(libchromium_android_linker)',
402 'ordered_libraries_file%': '<(ordered_libraries_file)',
403 'stripped_libraries_dir%': '<(stripped_libraries_dir)',
404 'packed_libraries_dir': '<(libraries_source_dir)',
408 'stamp': '<(pack_arm_relocations_stamp)',
410 'includes': ['../build/android/pack_arm_relocations.gypi'],
415 '<@(additional_bundled_libs)',
417 'ordered_libraries_file': '<(additional_ordered_libraries_file)',
418 'subtarget': '_additional_libraries',
420 'includes': ['../build/android/write_ordered_libraries.gypi'],
423 'action_name': 'strip_additional_libraries',
425 'ordered_libraries_file': '<(additional_ordered_libraries_file)',
426 'stripped_libraries_dir': '<(libraries_source_dir)',
428 '<@(additional_bundled_libs)',
431 'stamp': '<(strip_additional_stamp)'
433 'includes': ['../build/android/strip_native_libraries.gypi'],
436 'action_name': 'Create native lib placeholder files for previous releases',
438 'placeholders': ['<@(native_lib_placeholders)'],
440 ['gyp_managed_install == 1', {
441 # This "library" just needs to be put in the .apk. It is not loaded
443 'placeholders': ['libfix.crbug.384638.so'],
448 '<(DEPTH)/build/android/gyp/create_placeholder_files.py',
451 '<(native_lib_placeholder_stamp)',
454 'python', '<(DEPTH)/build/android/gyp/create_placeholder_files.py',
455 '--dest-lib-dir=<(apk_package_native_libs_dir)/<(android_app_abi)/',
456 '--stamp=<(native_lib_placeholder_stamp)',
462 ['gyp_managed_install == 1', {
464 'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
465 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
466 'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
467 'configuration_name': '<(CONFIGURATION_NAME)',
470 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
471 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
475 'includes': ['../build/android/push_libraries.gypi'],
478 'action_name': 'create device library symlinks',
479 'message': 'Creating links on device for <(_target_name)',
481 '<(DEPTH)/build/android/gyp/util/build_utils.py',
482 '<(DEPTH)/build/android/gyp/create_device_library_links.py',
483 '<(apk_install_record)',
484 '<(build_device_config_path)',
485 '<(ordered_libraries_file)',
491 'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
492 '--build-device-configuration=<(build_device_config_path)',
493 '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
494 '--script-host-path=<(symlink_script_host_path)',
495 '--script-device-path=<(symlink_script_device_path)',
496 '--target-dir=<(device_library_dir)',
497 '--apk=<(incomplete_apk_path)',
498 '--stamp=<(link_stamp)',
499 '--configuration-name=<(CONFIGURATION_NAME)',
504 ['create_standalone_apk == 1', {
507 'action_name': 'create standalone APK',
510 '<(ordered_libraries_file)',
511 '<(strip_additional_stamp)',
512 '<(pack_arm_relocations_stamp)',
514 'output_apk_path': '<(unsigned_standalone_apk_path)',
515 'libraries_top_dir%': '<(libraries_top_dir)',
516 'input_apk_path': '<(managed_input_apk_path)',
518 'includes': [ 'android/create_standalone_apk_action.gypi' ],
524 # gyp_managed_install != 1
526 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
527 'package_input_paths': [
528 '<(strip_additional_stamp)',
529 '<(pack_arm_relocations_stamp)',
534 }], # native_lib_target != ''
535 ['gyp_managed_install == 0 or create_standalone_apk == 1 or create_abi_split == 1', {
537 '<(DEPTH)/build/android/rezip.gyp:rezip_apk_jar',
540 ['create_abi_split == 1 or gyp_managed_install == 0 or create_standalone_apk == 1', {
543 'action_name': 'finalize_base',
545 'output_apk_path': '<(final_apk_path)',
547 ['create_abi_split == 0', {
548 'input_apk_path': '<(unsigned_standalone_apk_path)',
550 'input_apk_path': '<(unsigned_apk_path)',
551 'load_library_from_zip': 0,
555 'includes': [ 'android/finalize_apk_action.gypi']
559 ['create_abi_split == 1', {
562 'action_name': 'generate_split_manifest_<(_target_name)',
564 '<(DEPTH)/build/android/gyp/util/build_utils.py',
565 '<(DEPTH)/build/android/gyp/generate_split_manifest.py',
566 '<(android_manifest_path)',
569 '<(split_android_manifest_path)',
572 'python', '<(DEPTH)/build/android/gyp/generate_split_manifest.py',
573 '--main-manifest', '<(android_manifest_path)',
574 '--out-manifest', '<(split_android_manifest_path)',
575 '--split', 'abi_<(android_app_abi)',
580 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)',
581 'asset_location': '',
582 'android_manifest_path': '<(split_android_manifest_path)',
583 'create_density_splits': 0,
585 'includes': [ 'android/package_resources_action.gypi' ],
589 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)',
590 'apk_path': '<(unsigned_abi_split_apk_path)',
592 'native_libs_dir': '<(apk_package_native_libs_dir)',
593 'extra_inputs': ['<(native_lib_placeholder_stamp)'],
595 'includes': ['android/apkbuilder_action.gypi'],
599 ['create_abi_split == 1 and (gyp_managed_install == 0 or create_standalone_apk == 1)', {
602 'action_name': 'finalize_split',
604 'output_apk_path': '<(final_abi_split_apk_path)',
606 ['gyp_managed_install == 1', {
607 'input_apk_path': '<(unsigned_standalone_apk_path)',
609 'input_apk_path': '<(unsigned_abi_split_apk_path)',
613 'includes': [ 'android/finalize_apk_action.gypi']
617 ['gyp_managed_install == 1', {
620 'action_name': 'finalize incomplete apk',
622 'load_library_from_zip': 0,
623 'input_apk_path': '<(managed_input_apk_path)',
624 'output_apk_path': '<(incomplete_apk_path)',
626 'includes': [ 'android/finalize_apk_action.gypi']
629 'action_name': 'apk_install_<(_target_name)',
630 'message': 'Installing <(apk_name).apk',
632 '<(DEPTH)/build/android/gyp/util/build_utils.py',
633 '<(DEPTH)/build/android/gyp/apk_install.py',
634 '<(build_device_config_path)',
635 '<(incomplete_apk_path)',
638 '<(apk_install_record)',
641 'python', '<(DEPTH)/build/android/gyp/apk_install.py',
642 '--build-device-configuration=<(build_device_config_path)',
643 '--install-record=<(apk_install_record)',
644 '--configuration-name=<(CONFIGURATION_NAME)',
645 '--android-sdk-tools', '<(android_sdk_tools)',
648 ['create_abi_split == 1', {
653 '--apk-path=<(final_apk_path)',
654 '--split-apk-path=<(incomplete_apk_path)',
658 '--apk-path=<(incomplete_apk_path)',
661 ['create_density_splits == 1', {
663 '<(final_apk_path_no_extension)-density-hdpi.apk',
664 '<(final_apk_path_no_extension)-density-xhdpi.apk',
665 '<(final_apk_path_no_extension)-density-xxhdpi.apk',
666 '<(final_apk_path_no_extension)-density-tvdpi.apk',
669 '--split-apk-path=<(final_apk_path_no_extension)-density-hdpi.apk',
670 '--split-apk-path=<(final_apk_path_no_extension)-density-xhdpi.apk',
671 '--split-apk-path=<(final_apk_path_no_extension)-density-xxhdpi.apk',
672 '--split-apk-path=<(final_apk_path_no_extension)-density-tvdpi.apk',
679 ['create_density_splits == 1', {
682 'action_name': 'finalize_density_splits',
686 'includes': [ 'android/finalize_splits_action.gypi']
690 ['is_test_apk == 1', {
692 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_commands',
693 '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
696 ['run_findbugs == 1', {
699 'action_name': 'findbugs_<(_target_name)',
700 'message': 'Running findbugs on <(_target_name)',
702 '<(DEPTH)/build/android/findbugs_diff.py',
703 '<(DEPTH)/build/android/findbugs_filter/findbugs_exclude.xml',
704 '<(DEPTH)/build/android/pylib/utils/findbugs.py',
705 '>@(input_jars_paths)',
713 'python', '<(DEPTH)/build/android/findbugs_diff.py',
714 '--auxclasspath-gyp', '>(input_jars_paths)',
715 '--stamp', '<(findbugs_stamp)',
724 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
728 'action_name': 'process_resources',
729 'message': 'processing resources for <(_target_name)',
731 # Write the inputs list to a file, so that its mtime is updated when
732 # the list of inputs changes.
733 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional_input_paths) >@(resource_input_paths))',
734 'process_resources_options': [],
736 ['is_test_apk == 1', {
737 'dependencies_res_zip_paths=': [],
738 'additional_res_packages=': [],
740 ['res_v14_skip == 1', {
741 'process_resources_options+': ['--v14-skip']
743 ['shared_resources == 1', {
744 'process_resources_options+': ['--shared-resources']
746 ['R_package != ""', {
747 'process_resources_options+': ['--custom-package', '<(R_package)']
749 ['include_all_resources == 1', {
750 'process_resources_options+': ['--include-all-resources']
755 '<(DEPTH)/build/android/gyp/util/build_utils.py',
756 '<(DEPTH)/build/android/gyp/process_resources.py',
757 '<(android_manifest_path)',
758 '>@(additional_input_paths)',
759 '>@(resource_input_paths)',
760 '>@(dependencies_res_zip_paths)',
761 '>(inputs_list_file)',
764 '<(resource_zip_path)',
765 '<(generated_proguard_file)',
769 'python', '<(DEPTH)/build/android/gyp/process_resources.py',
770 '--android-sdk', '<(android_sdk)',
771 '--android-sdk-tools', '<(android_sdk_tools)',
773 '--android-manifest', '<(android_manifest_path)',
774 '--dependencies-res-zips', '>(dependencies_res_zip_paths)',
776 '--extra-res-packages', '>(additional_res_packages)',
777 '--extra-r-text-files', '>(additional_R_text_files)',
779 '--proguard-file', '<(generated_proguard_file)',
781 '--resource-dirs', '<(resource_dir)',
782 '--resource-zip-out', '<(resource_zip_path)',
784 '--R-dir', '<(intermediate_dir)/gen',
786 '--stamp', '<(codegen_stamp)',
788 '<@(process_resources_options)',
792 'action_name': 'javac_<(_target_name)',
793 'message': 'Compiling java for <(_target_name)',
796 '<(intermediate_dir)/gen',
797 '>@(generated_src_dirs)',
799 # If there is a separate find for additional_src_dirs, it will find the
800 # wrong .java files when additional_src_dirs is empty.
801 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and
802 # java_apk.gypi evaluate the same command, and at the moment two targets
803 # set java_in_dir to "java". Add a dummy comment here to make sure
804 # that the two targets (one uses java.gypi, the other java_apk.gypi)
805 # get distinct source lists. Medium-term, make targets list all their
806 # Java files instead of using find. (As is, this will be broken if two
807 # targets use the same java_in_dir and both use java_apk.gypi or
808 # both use java.gypi.)
809 'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additional_src_dirs) -name "*.java" # apk)'],
813 '<(DEPTH)/build/android/gyp/util/build_utils.py',
814 '<(DEPTH)/build/android/gyp/javac.py',
816 '>@(input_jars_paths)',
820 ['native_lib_target != ""', {
821 'inputs': [ '<(native_libraries_java_stamp)' ],
829 'python', '<(DEPTH)/build/android/gyp/javac.py',
830 '--classpath=>(input_jars_paths) <(android_sdk_jar)',
831 '--src-gendirs=>(gen_src_dirs)',
832 '--javac-includes=<(javac_includes)',
833 '--chromium-code=<(chromium_code)',
834 '--jar-path=<(javac_jar_path)',
835 '--jar-excluded-classes=<(jar_excluded_classes)',
836 '--stamp=<(compile_stamp)',
841 'action_name': 'instr_jar_<(_target_name)',
842 'message': 'Instrumenting <(_target_name) jar',
844 'input_path': '<(javac_jar_path)',
845 'output_path': '<(jar_path)',
846 'stamp_path': '<(instr_stamp)',
856 'includes': [ 'android/instr_action.gypi' ],
861 '<(java_in_dir)<(java_in_dir_suffix)',
862 '>@(additional_src_dirs)',
864 'lint_jar_path': '<(jar_path)',
865 'stamp_path': '<(lint_stamp)',
866 'result_path': '<(lint_result)',
867 'config_path': '<(lint_config)',
872 'includes': [ 'android/lint_action.gypi' ],
875 'action_name': 'obfuscate_<(_target_name)',
876 'message': 'Obfuscating <(_target_name)',
878 'additional_obfuscate_options': [],
879 'additional_obfuscate_input_paths': [],
880 'proguard_out_dir': '<(intermediate_dir)/proguard',
881 'proguard_input_jar_paths': [
882 '>@(input_jars_paths)',
885 'target_conditions': [
886 ['is_test_apk == 1', {
887 'additional_obfuscate_options': [
891 ['is_test_apk == 1 and tested_apk_obfuscated_jar_path != "/"', {
892 'additional_obfuscate_options': [
893 '--tested-apk-obfuscated-jar-path', '>(tested_apk_obfuscated_jar_path)',
895 'additional_obfuscate_input_paths': [
896 '>(tested_apk_obfuscated_jar_path).info',
899 ['proguard_enabled == "true"', {
900 'additional_obfuscate_options': [
901 '--proguard-enabled',
905 'obfuscate_input_jars_paths': [
906 '>@(input_jars_paths)',
911 ['is_test_apk == 1', {
918 '<(DEPTH)/build/android/gyp/apk_obfuscate.py',
919 '<(DEPTH)/build/android/gyp/util/build_utils.py',
920 '>@(proguard_flags_paths)',
921 '>@(obfuscate_input_jars_paths)',
922 '>@(additional_obfuscate_input_paths)',
926 '<(obfuscate_stamp)',
928 # In non-Release builds, these paths will all be empty files.
929 '<(obfuscated_jar_path)',
930 '<(obfuscated_jar_path).info',
931 '<(obfuscated_jar_path).dump',
932 '<(obfuscated_jar_path).seeds',
933 '<(obfuscated_jar_path).mapping',
934 '<(obfuscated_jar_path).usage',
937 'python', '<(DEPTH)/build/android/gyp/apk_obfuscate.py',
939 '--configuration-name', '<(CONFIGURATION_NAME)',
941 '--android-sdk', '<(android_sdk)',
942 '--android-sdk-tools', '<(android_sdk_tools)',
943 '--android-sdk-jar', '<(android_sdk_jar)',
945 '--input-jars-paths=>(proguard_input_jar_paths)',
946 '--proguard-configs=>(proguard_flags_paths)',
948 '--test-jar-path', '<(test_jar_path)',
949 '--obfuscated-jar-path', '<(obfuscated_jar_path)',
951 '--proguard-jar-path', '<(android_sdk_root)/tools/proguard/lib/proguard.jar',
953 '--stamp', '<(obfuscate_stamp)',
955 '>@(additional_obfuscate_options)',
959 'action_name': 'dex_<(_target_name)',
962 '>@(library_dexed_jars_paths)',
965 'output_path': '<(dex_path)',
966 'proguard_enabled_input_path': '<(obfuscated_jar_path)',
968 'target_conditions': [
969 ['emma_instrument != 0', {
977 ['is_test_apk == 1 and tested_apk_dex_path != "/"', {
979 'dex_additional_options': [
980 '--excluded-paths', '@FileArg(>(tested_apk_dex_path).inputs)'
984 '>(tested_apk_dex_path).inputs',
987 ['proguard_enabled == "true"', {
988 'inputs': [ '<(obfuscate_stamp)' ]
990 'inputs': [ '<(instr_stamp)' ]
993 'includes': [ 'android/dex_action.gypi' ],
997 'extra_inputs': ['<(codegen_stamp)'],
999 '<(resource_zip_path)',
1002 ['is_test_apk == 0', {
1004 '>@(dependencies_res_zip_paths)',
1009 'includes': [ 'android/package_resources_action.gypi' ],
1013 'apk_path': '<(unsigned_apk_path)',
1015 ['native_lib_target != ""', {
1016 'extra_inputs': ['<(native_lib_placeholder_stamp)'],
1018 ['create_abi_split == 0', {
1019 'native_libs_dir': '<(apk_package_native_libs_dir)',
1021 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res',
1025 'includes': ['android/apkbuilder_action.gypi'],