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_dirs - Additional directories containing Android resources.
28 # additional_res_packages - Package names of the R.java files corresponding to
29 # each directory in additional_res_dirs.
30 # additional_src_dirs - Additional directories with .java files to be compiled
31 # and included in the output of this target.
32 # additional_bundled_libs - Additional libraries what will be stripped and
34 # asset_location - The directory where assets are located.
35 # generated_src_dirs - Same as additional_src_dirs except used for .java files
36 # that are generated at build time. This should be set automatically by a
37 # target's dependencies. The .java files in these directories are not
38 # included in the 'inputs' list (unlike additional_src_dirs).
39 # input_jars_paths - The path to jars to be included in the classpath. This
40 # should be filled automatically by depending on the appropriate targets.
41 # is_test_apk - Set to 1 if building a test apk. This prevents resources from
42 # dependencies from being re-included.
43 # native_lib_target - The target_name of the target which generates the final
44 # shared library to be included in this apk. A stripped copy of the
45 # library will be included in the apk.
46 # resource_dir - The directory for resources.
47 # R_package - A custom Java package to generate the resource file R.java in.
48 # By default, the package given in AndroidManifest.xml will be used.
49 # use_chromium_linker - Enable the content dynamic linker that allows sharing the
50 # RELRO section of the native libraries between the different processes.
51 # load_library_from_zip_file - When using the dynamic linker, load the library
52 # directly out of the zip file.
53 # use_relocation_packer - Enable relocation packing. Relies on the chromium
54 # linker, so use_chromium_linker must also be enabled.
55 # enable_chromium_linker_tests - Enable the content dynamic linker test support
56 # code. This allows a test APK to inject a Linker.TestRunner instance at
57 # runtime. Should only be used by the chromium_linker_test_apk target!!
58 # never_lint - Set to 1 to not run lint on this target.
61 'tested_apk_obfuscated_jar_path%': '/',
62 'tested_apk_dex_path%': '/',
63 'additional_input_paths': [],
64 'input_jars_paths': [],
65 'library_dexed_jars_paths': [],
66 'additional_src_dirs': [],
67 'generated_src_dirs': [],
68 'app_manifest_version_name%': '<(android_app_version_name)',
69 'app_manifest_version_code%': '<(android_app_version_code)',
70 # aapt generates this proguard.txt.
71 'generated_proguard_file': '<(intermediate_dir)/proguard.txt',
72 'proguard_enabled%': 'false',
73 'proguard_flags_paths': ['<(generated_proguard_file)'],
74 'jar_name': 'chromium_apk_<(_target_name).jar',
75 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
77 'additional_R_text_files': [],
78 'dependencies_res_zip_paths': [],
79 'additional_res_packages': [],
80 'additional_bundled_libs%': [],
82 'resource_input_paths': [],
83 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
84 'asset_location%': '<(intermediate_dir)/assets',
85 'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
86 'package_input_paths': [],
87 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
88 'additional_ordered_libraries_file': '<(intermediate_dir)/additional_native_libraries.json',
89 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLibraries.template',
90 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
91 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java',
92 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp',
93 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/',
94 'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h',
95 'native_libraries_template_version_file': '<(native_libraries_template_data_dir)/native_libraries_version.h',
96 'compile_stamp': '<(intermediate_dir)/compile.stamp',
97 'lint_stamp': '<(intermediate_dir)/lint.stamp',
98 'lint_result': '<(intermediate_dir)/lint_result.xml',
99 'lint_config': '<(intermediate_dir)/lint_config.xml',
101 'instr_stamp': '<(intermediate_dir)/instr.stamp',
102 'jar_stamp': '<(intermediate_dir)/jar.stamp',
103 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
104 'pack_arm_relocations_stamp': '<(intermediate_dir)/pack_arm_relocations.stamp',
105 'strip_stamp': '<(intermediate_dir)/strip.stamp',
106 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries',
107 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp',
108 'classes_dir': '<(intermediate_dir)/classes/2',
109 'javac_includes': [],
110 'jar_excluded_classes': [],
111 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar',
112 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
113 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
114 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
115 'dex_path': '<(intermediate_dir)/classes.dex',
116 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
117 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
118 'push_stamp': '<(intermediate_dir)/push.stamp',
119 'link_stamp': '<(intermediate_dir)/link.stamp',
120 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp',
121 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip',
122 'resource_packaged_apk_name': '<(apk_name)-resources.ap_',
123 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_name)',
124 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
125 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
126 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
127 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp',
128 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_target_name)/<(CONFIGURATION_NAME)',
129 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
130 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
131 'create_standalone_apk%': 1,
132 'res_v14_verify_only%': 0,
135 'native_lib_target%': '',
136 'native_lib_version_name%': '',
137 'use_chromium_linker%' : 0,
138 'load_library_from_zip_file%' : 0,
139 'use_relocation_packer%' : 0,
140 'enable_chromium_linker_tests%': 0,
144 ['gyp_managed_install == 1 and native_lib_target != ""', {
145 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk',
147 'unsigned_standalone_apk_path': '<(unsigned_apk_path)',
149 ['gyp_managed_install == 1', {
150 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
152 'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
154 ['is_test_apk == 0 and emma_coverage != 0', {
155 'emma_instrument%': 1,
157 'emma_instrument%': 0,
161 'native_lib_target%': '',
162 'native_lib_version_name%': '',
163 'use_chromium_linker%' : 0,
164 'load_library_from_zip_file%' : 0,
165 'use_relocation_packer%' : 0,
166 'enable_chromium_linker_tests%': 0,
167 'emma_instrument%': '<(emma_instrument)',
168 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)',
169 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
170 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_extension)',
171 'extra_native_libs': [],
173 # Pass the jar path to the apk's "fake" jar target. This would be better as
174 # direct_dependent_settings, but a variable set by a direct_dependent_settings
175 # cannot be lifted in a dependent to all_dependent_settings.
176 'all_dependent_settings': {
178 ['proguard_enabled == "true"', {
180 'proguard_enabled': 'true',
185 'apk_output_jar_path': '<(jar_path)',
186 'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)',
187 'tested_apk_dex_path': '<(dex_path)',
191 ['resource_dir!=""', {
193 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
196 ['R_package != ""', {
198 # We generate R.java in package R_package (in addition to the package
199 # listed in the AndroidManifest.xml, which is unavoidable).
200 'additional_res_packages': ['<(R_package)'],
201 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'],
204 ['native_lib_target != "" and component == "shared_library"', {
206 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
209 ['use_chromium_linker == 1', {
211 '<(DEPTH)/base/base.gyp:chromium_android_linker',
214 ['native_lib_target != ""', {
216 'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
217 'native_libs_paths': [
218 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)'
220 'package_input_paths': [
221 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
226 # gdbserver is always copied into the APK's native libs dir. The ant
227 # build scripts (apkbuilder task) will only include it in a debug
229 'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)',
231 '<(android_gdbserver)',
239 ['use_chromium_linker == 1', {
241 'linker_input_libraries': [
242 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)',
247 'linker_input_libraries': [],
252 '<@(native_libs_paths)',
253 '<@(extra_native_libs)',
254 '<@(linker_input_libraries)',
257 'includes': ['../build/android/write_ordered_libraries.gypi'],
260 'action_name': 'native_libraries_template_data_<(_target_name)',
261 'message': 'Creating native_libraries_list.h for <(_target_name)',
263 '<(DEPTH)/build/android/gyp/util/build_utils.py',
264 '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
265 '<(ordered_libraries_file)',
268 '<(native_libraries_template_data_file)',
269 '<(native_libraries_template_version_file)',
272 'python', '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
273 '--ordered-libraries=<(ordered_libraries_file)',
274 '--version-name=<(native_lib_version_name)',
275 '--native-library-list=<(native_libraries_template_data_file)',
276 '--version-output=<(native_libraries_template_version_file)',
280 'action_name': 'native_libraries_<(_target_name)',
283 ['use_chromium_linker == 1', {
285 'linker_gcc_preprocess_defines': [
286 '--defines', 'ENABLE_CHROMIUM_LINKER',
291 'linker_gcc_preprocess_defines': [],
294 ['load_library_from_zip_file == 1', {
296 'linker_load_from_zip_file_preprocess_defines': [
297 '--defines', 'ENABLE_CHROMIUM_LINKER_LIBRARY_IN_ZIP_FILE',
302 'linker_load_from_zip_file_preprocess_defines': [],
305 ['enable_chromium_linker_tests == 1', {
307 'linker_tests_gcc_preprocess_defines': [
308 '--defines', 'ENABLE_CHROMIUM_LINKER_TESTS',
313 'linker_tests_gcc_preprocess_defines': [],
317 'gcc_preprocess_defines': [
318 '<@(linker_load_from_zip_file_preprocess_defines)',
319 '<@(linker_gcc_preprocess_defines)',
320 '<@(linker_tests_gcc_preprocess_defines)',
323 'message': 'Creating NativeLibraries.java for <(_target_name)',
325 '<(DEPTH)/build/android/gyp/util/build_utils.py',
326 '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
327 '<(native_libraries_template_data_file)',
328 '<(native_libraries_template_version_file)',
329 '<(native_libraries_template)',
332 '<(native_libraries_java_stamp)',
335 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
336 '--include-path=<(native_libraries_template_data_dir)',
337 '--output=<(native_libraries_java_file)',
338 '--template=<(native_libraries_template)',
339 '--stamp=<(native_libraries_java_stamp)',
340 '<@(gcc_preprocess_defines)',
344 'action_name': 'strip_native_libraries',
346 'ordered_libraries_file%': '<(ordered_libraries_file)',
347 'stripped_libraries_dir%': '<(stripped_libraries_dir)',
349 '<@(native_libs_paths)',
350 '<@(extra_native_libs)',
352 'stamp': '<(strip_stamp)'
354 'includes': ['../build/android/strip_native_libraries.gypi'],
357 'action_name': 'pack_arm_relocations',
360 ['use_chromium_linker == 1 and use_relocation_packer == 1', {
366 'exclude_packing_list': [
367 '<(libchromium_android_linker)',
369 'ordered_libraries_file%': '<(ordered_libraries_file)',
370 'stripped_libraries_dir%': '<(stripped_libraries_dir)',
371 'packed_libraries_dir': '<(libraries_source_dir)',
375 'stamp': '<(pack_arm_relocations_stamp)',
377 'includes': ['../build/android/pack_arm_relocations.gypi'],
382 '<@(additional_bundled_libs)',
384 'ordered_libraries_file': '<(additional_ordered_libraries_file)',
385 'subtarget': '_additional_libraries',
387 'includes': ['../build/android/write_ordered_libraries.gypi'],
390 'action_name': 'strip_additional_libraries',
392 'ordered_libraries_file': '<(additional_ordered_libraries_file)',
393 'stripped_libraries_dir': '<(libraries_source_dir)',
395 '<@(additional_bundled_libs)',
398 'stamp': '<(strip_additional_stamp)'
400 'includes': ['../build/android/strip_native_libraries.gypi'],
404 ['gyp_managed_install == 1', {
406 'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
407 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
408 'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
409 'configuration_name': '<(CONFIGURATION_NAME)',
412 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
416 'includes': ['../build/android/push_libraries.gypi'],
419 'action_name': 'create device library symlinks',
420 'message': 'Creating links on device for <(_target_name)',
422 '<(DEPTH)/build/android/gyp/util/build_utils.py',
423 '<(DEPTH)/build/android/gyp/create_device_library_links.py',
424 '<(apk_install_record)',
425 '<(build_device_config_path)',
426 '<(ordered_libraries_file)',
432 'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
433 '--build-device-configuration=<(build_device_config_path)',
434 '--libraries-json=<(ordered_libraries_file)',
435 '--script-host-path=<(symlink_script_host_path)',
436 '--script-device-path=<(symlink_script_device_path)',
437 '--target-dir=<(device_library_dir)',
438 '--apk=<(incomplete_apk_path)',
439 '--stamp=<(link_stamp)',
440 '--configuration-name=<(CONFIGURATION_NAME)',
445 ['create_standalone_apk == 1', {
448 'action_name': 'create standalone APK',
451 '<(ordered_libraries_file)',
452 '<(pack_arm_relocations_stamp)',
453 '<(strip_additional_stamp)',
455 'input_apk_path': '<(unsigned_apk_path)',
456 'output_apk_path': '<(unsigned_standalone_apk_path)',
457 'libraries_top_dir%': '<(libraries_top_dir)',
459 'includes': [ 'android/create_standalone_apk_action.gypi' ],
465 # gyp_managed_install != 1
467 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
468 'package_input_paths': [
469 '<(pack_arm_relocations_stamp)',
470 '<(strip_additional_stamp)',
475 }], # native_lib_target != ''
476 ['gyp_managed_install == 0 or create_standalone_apk == 1', {
479 'action_name': 'finalize standalone apk',
481 'input_apk_path': '<(unsigned_standalone_apk_path)',
482 'output_apk_path': '<(final_apk_path)',
484 'includes': [ 'android/finalize_apk_action.gypi']
488 '<(DEPTH)/build/android/rezip.gyp:rezip#host',
491 ['gyp_managed_install == 1', {
494 'action_name': 'finalize incomplete apk',
496 'input_apk_path': '<(unsigned_apk_path)',
497 'output_apk_path': '<(incomplete_apk_path)',
499 'includes': [ 'android/finalize_apk_action.gypi']
502 'action_name': 'apk_install_<(_target_name)',
503 'message': 'Installing <(apk_name).apk',
505 '<(DEPTH)/build/android/gyp/util/build_utils.py',
506 '<(DEPTH)/build/android/gyp/apk_install.py',
507 '<(build_device_config_path)',
508 '<(incomplete_apk_path)',
511 '<(apk_install_record)',
514 'python', '<(DEPTH)/build/android/gyp/apk_install.py',
515 '--apk-path=<(incomplete_apk_path)',
516 '--build-device-configuration=<(build_device_config_path)',
517 '--install-record=<(apk_install_record)',
518 '--configuration-name=<(CONFIGURATION_NAME)',
523 '<(DEPTH)/build/android/rezip.gyp:rezip#host',
526 ['is_test_apk == 1', {
528 '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
533 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
537 'action_name': 'process_resources',
538 'message': 'processing resources for <(_target_name)',
540 # Write the inputs list to a file, so that its mtime is updated when
541 # the list of inputs changes.
542 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional_input_paths) >@(resource_input_paths))',
543 'process_resources_options': [],
545 ['is_test_apk == 1', {
546 'dependencies_res_zip_paths=': [],
547 'additional_res_packages=': [],
549 ['res_v14_verify_only == 1', {
550 'process_resources_options': ['--v14-verify-only']
555 '<(DEPTH)/build/android/gyp/util/build_utils.py',
556 '<(DEPTH)/build/android/gyp/process_resources.py',
557 '<(android_manifest_path)',
558 '>@(additional_input_paths)',
559 '>@(resource_input_paths)',
560 '>@(dependencies_res_zip_paths)',
561 '>(inputs_list_file)',
564 '<(resource_zip_path)',
565 '<(generated_proguard_file)',
569 'python', '<(DEPTH)/build/android/gyp/process_resources.py',
570 '--android-sdk', '<(android_sdk)',
571 '--android-sdk-tools', '<(android_sdk_tools)',
573 '--android-manifest', '<(android_manifest_path)',
574 '--dependencies-res-zips', '>(dependencies_res_zip_paths)',
576 '--extra-res-packages', '>(additional_res_packages)',
577 '--extra-r-text-files', '>(additional_R_text_files)',
579 '--proguard-file', '<(generated_proguard_file)',
581 '--resource-dirs', '<(resource_dir)',
582 '--resource-zip-out', '<(resource_zip_path)',
584 '--R-dir', '<(intermediate_dir)/gen',
586 '--stamp', '<(codegen_stamp)',
588 '<@(process_resources_options)',
592 'action_name': 'javac_<(_target_name)',
593 'message': 'Compiling java for <(_target_name)',
596 '<(intermediate_dir)/gen',
597 '>@(generated_src_dirs)',
599 # If there is a separate find for additional_src_dirs, it will find the
600 # wrong .java files when additional_src_dirs is empty.
601 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and
602 # java_apk.gypi evaluate the same command, and at the moment two targets
603 # set java_in_dir to "java". Add a dummy comment here to make sure
604 # that the two targets (one uses java.gypi, the other java_apk.gypi)
605 # get distinct source lists. Medium-term, make targets list all their
606 # Java files instead of using find. (As is, this will be broken if two
607 # targets use the same java_in_dir and both use java_apk.gypi or
608 # both use java.gypi.)
609 'java_sources': ['>!@(find >(java_in_dir)/src >(additional_src_dirs) -name "*.java" # apk)'],
613 '<(DEPTH)/build/android/gyp/util/build_utils.py',
614 '<(DEPTH)/build/android/gyp/javac.py',
616 '>@(input_jars_paths)',
620 ['native_lib_target != ""', {
621 'inputs': [ '<(native_libraries_java_stamp)' ],
629 'python', '<(DEPTH)/build/android/gyp/javac.py',
630 '--classes-dir=<(classes_dir)',
631 '--classpath=>(input_jars_paths) <(android_sdk_jar)',
632 '--src-gendirs=>(gen_src_dirs)',
633 '--javac-includes=<(javac_includes)',
634 '--chromium-code=<(chromium_code)',
635 '--jar-path=<(javac_jar_path)',
636 '--jar-excluded-classes=<(jar_excluded_classes)',
637 '--stamp=<(compile_stamp)',
644 '<(java_in_dir)/src',
645 '>@(additional_src_dirs)',
647 'stamp_path': '<(lint_stamp)',
648 'result_path': '<(lint_result)',
649 'config_path': '<(lint_config)',
657 'includes': [ 'android/lint_action.gypi' ],
660 'action_name': 'instr_jar_<(_target_name)',
661 'message': 'Instrumenting <(_target_name) jar',
663 'input_path': '<(javac_jar_path)',
664 'output_path': '<(jar_path)',
665 'stamp_path': '<(instr_stamp)',
675 'includes': [ 'android/instr_action.gypi' ],
678 'action_name': 'obfuscate_<(_target_name)',
679 'message': 'Obfuscating <(_target_name)',
681 'additional_obfuscate_options': [],
682 'additional_obfuscate_input_paths': [],
683 'proguard_out_dir': '<(intermediate_dir)/proguard',
684 'proguard_input_jar_paths': [
685 '>@(input_jars_paths)',
688 'target_conditions': [
689 ['is_test_apk == 1', {
690 'additional_obfuscate_options': [
694 ['is_test_apk == 1 and tested_apk_obfuscated_jar_path != "/"', {
695 'additional_obfuscate_options': [
696 '--tested-apk-obfuscated-jar-path', '>(tested_apk_obfuscated_jar_path)',
698 'additional_obfuscate_input_paths': [
699 '>(tested_apk_obfuscated_jar_path).info',
702 ['proguard_enabled == "true"', {
703 'additional_obfuscate_options': [
704 '--proguard-enabled',
708 'obfuscate_input_jars_paths': [
709 '>@(input_jars_paths)',
714 ['is_test_apk == 1', {
721 '<(DEPTH)/build/android/gyp/apk_obfuscate.py',
722 '<(DEPTH)/build/android/gyp/util/build_utils.py',
723 '>@(proguard_flags_paths)',
724 '>@(obfuscate_input_jars_paths)',
725 '>@(additional_obfuscate_input_paths)',
729 '<(obfuscate_stamp)',
731 # In non-Release builds, these paths will all be empty files.
732 '<(obfuscated_jar_path)',
733 '<(obfuscated_jar_path).info',
734 '<(obfuscated_jar_path).dump',
735 '<(obfuscated_jar_path).seeds',
736 '<(obfuscated_jar_path).mapping',
737 '<(obfuscated_jar_path).usage',
740 'python', '<(DEPTH)/build/android/gyp/apk_obfuscate.py',
742 '--configuration-name', '<(CONFIGURATION_NAME)',
744 '--android-sdk', '<(android_sdk)',
745 '--android-sdk-tools', '<(android_sdk_tools)',
746 '--android-sdk-jar', '<(android_sdk_jar)',
748 '--input-jars-paths=>(proguard_input_jar_paths)',
749 '--proguard-configs=>(proguard_flags_paths)',
752 '--test-jar-path', '<(test_jar_path)',
753 '--obfuscated-jar-path', '<(obfuscated_jar_path)',
755 '--proguard-jar-path', '<(android_sdk_root)/tools/proguard/lib/proguard.jar',
757 '--stamp', '<(obfuscate_stamp)',
759 '>@(additional_obfuscate_options)',
763 'action_name': 'dex_<(_target_name)',
766 '>@(library_dexed_jars_paths)',
769 'output_path': '<(dex_path)',
770 'proguard_enabled_input_path': '<(obfuscated_jar_path)',
772 'target_conditions': [
773 ['emma_instrument != 0', {
781 ['is_test_apk == 1 and tested_apk_dex_path != "/"', {
783 'dex_additional_options': [
784 '--excluded-paths-file', '>(tested_apk_dex_path).inputs'
788 '>(tested_apk_dex_path).inputs',
791 ['proguard_enabled == "true"', {
792 'inputs': [ '<(obfuscate_stamp)' ]
794 'inputs': [ '<(instr_stamp)' ]
797 'includes': [ 'android/dex_action.gypi' ],
800 'action_name': 'package_resources',
801 'message': 'packaging resources for <(_target_name)',
803 'package_resource_zip_input_paths': [
804 '<(resource_zip_path)',
805 '>@(dependencies_res_zip_paths)',
809 ['is_test_apk == 1', {
811 'dependencies_res_zip_paths=': [],
812 'additional_res_packages=': [],
817 # TODO: This isn't always rerun correctly, http://crbug.com/351928
818 '<(DEPTH)/build/android/gyp/util/build_utils.py',
819 '<(DEPTH)/build/android/gyp/package_resources.py',
820 '<(android_manifest_path)',
822 '>@(package_resource_zip_input_paths)',
827 '<(resource_packaged_apk_path)',
830 'python', '<(DEPTH)/build/android/gyp/package_resources.py',
831 '--android-sdk', '<(android_sdk)',
832 '--android-sdk-tools', '<(android_sdk_tools)',
834 '--configuration-name', '<(CONFIGURATION_NAME)',
836 '--android-manifest', '<(android_manifest_path)',
837 '--version-code', '<(app_manifest_version_code)',
838 '--version-name', '<(app_manifest_version_name)',
840 '--asset-dir', '<(asset_location)',
841 '--resource-zips', '>(package_resource_zip_input_paths)',
843 '--apk-path', '<(resource_packaged_apk_path)',
847 'action_name': 'ant_package_<(_target_name)',
848 'message': 'Packaging <(_target_name)',
850 # Write the inputs list to a file, so that its mtime is updated when
851 # the list of inputs changes.
852 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_input_paths))'
855 '<(DEPTH)/build/android/ant/apk-package.xml',
856 '<(DEPTH)/build/android/gyp/util/build_utils.py',
857 '<(DEPTH)/build/android/gyp/ant.py',
860 '<(obfuscate_stamp)',
861 '<(resource_packaged_apk_path)',
862 '>@(package_input_paths)',
863 '>(inputs_list_file)',
866 '<(unsigned_apk_path)',
869 'python', '<(DEPTH)/build/android/gyp/ant.py',
871 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
872 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
873 '-DRESOURCE_PACKAGED_APK_NAME=<(resource_packaged_apk_name)',
874 '-DAPK_NAME=<(apk_name)',
875 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
876 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)',
877 '-DOUT_DIR=<(intermediate_dir)',
878 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)',
879 '-DEMMA_INSTRUMENT=<(emma_instrument)',
880 '-DEMMA_DEVICE_JAR=<(emma_device_jar)',
884 '<(DEPTH)/build/android/ant/apk-package.xml',