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 # asset_location - The directory where assets are located.
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
35 # target's dependencies. The .java files in these directories are not
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
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
40 # dependencies from being re-included.
41 # native_lib_target - The target_name of the target which generates the final
42 # shared library to be included in this apk. A stripped copy of the
43 # library will be included in the apk.
44 # resource_dir - The directory for resources.
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.
47 # java_strings_grd - The name of the grd file from which to generate localized
48 # strings.xml files, if any.
49 # library_manifest_paths'- Paths to additional AndroidManifest.xml files from
51 # use_content_linker - Enable the content dynamic linker that allows sharing the
52 # RELRO section of the native libraries between the different processes.
53 # enable_content_linker_tests - Enable the content dynamic linker test support
54 # code. This allows a test APK to inject a Linker.TestRunner instance at
55 # runtime. Should only be used by the content_linker_test_apk target!!
58 'additional_input_paths': [],
59 'input_jars_paths': [],
60 'library_dexed_jars_paths': [],
61 'additional_src_dirs': [],
62 'generated_src_dirs': [],
63 'app_manifest_version_name%': '<(android_app_version_name)',
64 'app_manifest_version_code%': '<(android_app_version_code)',
65 'proguard_enabled%': 'false',
66 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'],
67 'jar_name': 'chromium_apk_<(_target_name).jar',
68 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
70 'additional_R_text_files': [],
71 'additional_res_dirs': [],
72 'additional_res_packages': [],
74 'java_strings_grd%': '',
75 'library_manifest_paths' : [],
76 'resource_input_paths': [],
77 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
78 'asset_location%': '<(intermediate_dir)/assets',
79 'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
80 'compile_input_paths': [],
81 'package_input_paths': [],
82 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
83 # TODO(cjhopman): build/ shouldn't refer to content/. The libraryloader and
84 # nativelibraries template should be moved out of content/ (to base/?).
85 # http://crbug.com/225101
86 'native_libraries_template': '<(DEPTH)/content/public/android/java/templates/NativeLibraries.template',
87 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
88 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java',
89 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp',
90 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/',
91 'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h',
92 'native_libraries_template_data_stamp': '<(intermediate_dir)/native_libraries_template_data.stamp',
93 'compile_stamp': '<(intermediate_dir)/compile.stamp',
94 'instr_stamp': '<(intermediate_dir)/instr.stamp',
95 'jar_stamp': '<(intermediate_dir)/jar.stamp',
96 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
97 'strip_stamp': '<(intermediate_dir)/strip.stamp',
98 'classes_dir': '<(intermediate_dir)/classes',
99 'classes_final_dir': '<(intermediate_dir)/classes_instr',
100 'javac_includes': [],
101 'jar_excluded_classes': [],
102 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
103 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
104 'dex_path': '<(intermediate_dir)/classes.dex',
105 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
106 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
107 'push_stamp': '<(intermediate_dir)/push.stamp',
108 'link_stamp': '<(intermediate_dir)/link.stamp',
109 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp',
110 'codegen_input_paths': [],
111 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
112 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
113 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
114 'source_dir': '<(java_in_dir)/src',
115 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp',
116 'device_intermediate_dir': '/data/local/tmp/chromium/<(_target_name)/<(CONFIGURATION_NAME)',
117 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
118 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
119 'create_standalone_apk%': 1,
122 'native_lib_target%': '',
123 'use_content_linker%': 0,
124 'enable_content_linker_tests%': 0,
128 ['gyp_managed_install == 1 and native_lib_target != ""', {
129 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk',
131 'unsigned_standalone_apk_path': '<(unsigned_apk_path)',
133 ['gyp_managed_install == 1', {
134 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
136 'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
138 ['is_test_apk == 0 and emma_coverage != 0', {
139 'emma_instrument': 1,
141 'emma_instrument': 0,
145 'native_lib_target%': '',
146 'use_content_linker%': 0,
147 'enable_content_linker_tests%': 0,
148 'emma_instrument': '<(emma_instrument)',
149 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)',
150 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
151 'extra_native_libs': [],
153 # Pass the jar path to the apk's "fake" jar target. This would be better as
154 # direct_dependent_settings, but a variable set by a direct_dependent_settings
155 # cannot be lifted in a dependent to all_dependent_settings.
156 'all_dependent_settings': {
158 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
162 ['resource_dir!=""', {
164 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
167 ['R_package != ""', {
169 # We generate R.java in package R_package (in addition to the package
170 # listed in the AndroidManifest.xml, which is unavoidable).
171 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'],
172 'additional_res_packages': ['<(R_package)'],
173 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'],
176 ['native_lib_target != "" and component == "shared_library"', {
178 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
181 ['use_content_linker == 1', {
183 '<(DEPTH)/content/content.gyp:content_android_linker',
186 ['native_lib_target != ""', {
188 'compile_input_paths': [ '<(native_libraries_java_stamp)' ],
189 'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
190 'native_libs_paths': [
191 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)'
193 'package_input_paths': [
194 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
199 # gdbserver is always copied into the APK's native libs dir. The ant
200 # build scripts (apkbuilder task) will only include it in a debug
202 'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)',
204 '<(android_gdbserver)',
205 '<@(extra_native_libs)',
213 ['use_content_linker == 1', {
215 'linker_input_libraries': [
216 '<(SHARED_LIB_DIR)/libcontent_android_linker.>(android_product_extension)',
221 'linker_input_libraries': [],
226 '<@(native_libs_paths)',
227 '<@(extra_native_libs)',
228 '<@(linker_input_libraries)',
231 'includes': ['../build/android/write_ordered_libraries.gypi'],
234 'action_name': 'native_libraries_template_data_<(_target_name)',
235 'message': 'Creating native_libraries_list.h for <(_target_name)',
237 '<(DEPTH)/build/android/gyp/util/build_utils.py',
238 '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
239 '<(ordered_libraries_file)',
242 '<(native_libraries_template_data_stamp)',
245 'python', '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
246 '--ordered-libraries=<(ordered_libraries_file)',
247 '--output=<(native_libraries_template_data_file)',
248 '--stamp=<(native_libraries_template_data_stamp)',
252 'action_name': 'native_libraries_<(_target_name)',
255 ['use_content_linker == 1', {
257 'linker_gcc_preprocess_defines': [
258 '--defines', 'ENABLE_CONTENT_LINKER',
263 'linker_gcc_preprocess_defines': [],
266 ['enable_content_linker_tests == 1', {
268 'linker_tests_gcc_preprocess_defines': [
269 '--defines', 'ENABLE_CONTENT_LINKER_TESTS',
274 'linker_tests_gcc_preprocess_defines': [],
278 'gcc_preprocess_defines': [
279 '<@(linker_gcc_preprocess_defines)',
280 '<@(linker_tests_gcc_preprocess_defines)',
283 'message': 'Creating NativeLibraries.java for <(_target_name).',
285 '<(DEPTH)/build/android/gyp/util/build_utils.py',
286 '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
287 '<(native_libraries_template_data_stamp)',
288 '<(native_libraries_template)',
291 '<(native_libraries_java_stamp)',
294 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
295 '--include-path=<(native_libraries_template_data_dir)',
296 '--output=<(native_libraries_java_file)',
297 '--template=<(native_libraries_template)',
298 '--stamp=<(native_libraries_java_stamp)',
299 '<@(gcc_preprocess_defines)',
303 'action_name': 'strip_native_libraries',
305 'ordered_libraries_file%': '<(ordered_libraries_file)',
306 'stripped_libraries_dir': '<(libraries_source_dir)',
308 '<@(native_libs_paths)',
309 '<@(extra_native_libs)',
311 'stamp': '<(strip_stamp)'
313 'includes': ['../build/android/strip_native_libraries.gypi'],
317 ['gyp_managed_install == 1', {
319 'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
320 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
321 'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
322 'configuration_name': '<(CONFIGURATION_NAME)',
325 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
329 'includes': ['../build/android/push_libraries.gypi'],
332 'action_name': 'create device library symlinks',
333 'message': 'Creating links on device for <(_target_name).',
335 '<(DEPTH)/build/android/gyp/util/build_utils.py',
336 '<(DEPTH)/build/android/gyp/create_device_library_links.py',
337 '<(apk_install_record)',
338 '<(build_device_config_path)',
339 '<(ordered_libraries_file)',
345 'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
346 '--build-device-configuration=<(build_device_config_path)',
347 '--libraries-json=<(ordered_libraries_file)',
348 '--script-host-path=<(symlink_script_host_path)',
349 '--script-device-path=<(symlink_script_device_path)',
350 '--target-dir=<(device_library_dir)',
351 '--apk=<(incomplete_apk_path)',
352 '--stamp=<(link_stamp)',
353 '--configuration-name=<(CONFIGURATION_NAME)',
358 ['create_standalone_apk == 1', {
361 'action_name': 'create standalone APK',
364 '<(ordered_libraries_file)',
367 'input_apk_path': '<(unsigned_apk_path)',
368 'output_apk_path': '<(unsigned_standalone_apk_path)',
369 'libraries_top_dir%': '<(libraries_top_dir)',
371 'includes': [ 'android/create_standalone_apk_action.gypi' ],
377 # gyp_managed_install != 1
379 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
380 'package_input_paths': [ '<(strip_stamp)' ],
384 }], # native_lib_target != ''
385 ['gyp_managed_install == 0 or create_standalone_apk == 1', {
388 'action_name': 'finalize standalone apk',
390 'input_apk_path': '<(unsigned_standalone_apk_path)',
391 'output_apk_path': '<(final_apk_path)',
393 'includes': [ 'android/finalize_apk_action.gypi']
397 ['java_strings_grd != ""', {
399 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit',
400 'additional_res_dirs': ['<(res_grit_dir)'],
401 # grit_grd_file is used by grit_action.gypi, included below.
402 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
403 'resource_input_paths': [
404 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir)" <(grit_grd_file))'
409 'action_name': 'generate_localized_strings_xml',
411 'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'],
412 'grit_out_dir': '<(res_grit_dir)',
413 # resource_ids is unneeded since we don't generate .h headers.
414 'grit_resource_ids': '',
416 'includes': ['../build/grit_action.gypi'],
420 ['gyp_managed_install == 1', {
423 'action_name': 'finalize incomplete apk',
425 'input_apk_path': '<(unsigned_apk_path)',
426 'output_apk_path': '<(incomplete_apk_path)',
428 'includes': [ 'android/finalize_apk_action.gypi']
431 'action_name': 'apk_install_<(_target_name)',
432 'message': 'Installing <(apk_name).apk',
434 '<(DEPTH)/build/android/gyp/util/build_utils.py',
435 '<(DEPTH)/build/android/gyp/apk_install.py',
436 '<(build_device_config_path)',
437 '<(incomplete_apk_path)',
440 '<(apk_install_record)',
443 'python', '<(DEPTH)/build/android/gyp/apk_install.py',
444 '--apk-path=<(incomplete_apk_path)',
445 '--build-device-configuration=<(build_device_config_path)',
446 '--install-record=<(apk_install_record)',
447 '--configuration-name=<(CONFIGURATION_NAME)',
452 ['is_test_apk == 1', {
454 '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
459 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
463 'action_name': 'ant_codegen_<(_target_name)',
464 'message': 'Generating R.java for <(_target_name)',
466 ['is_test_apk == 1', {
468 'additional_res_dirs=': [],
469 'additional_res_packages=': [],
474 '<(DEPTH)/build/android/ant/apk-codegen.xml',
475 '<(DEPTH)/build/android/gyp/util/build_utils.py',
476 '<(DEPTH)/build/android/gyp/ant.py',
477 '<(android_manifest_path)',
478 '>@(additional_input_paths)',
479 '>@(codegen_input_paths)',
480 '>@(library_manifest_paths)',
481 '>@(resource_input_paths)',
487 'python', '<(DEPTH)/build/android/gyp/ant.py',
489 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
490 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
491 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
492 '-DANDROID_MANIFEST=<(android_manifest_path)',
493 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
494 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
495 '-DANDROID_SDK_VERSION=<(android_sdk_version)',
496 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
497 '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)',
498 '-DOUT_DIR=<(intermediate_dir)',
499 '-DRESOURCE_DIR=<(resource_dir)',
501 '-DSTAMP=<(codegen_stamp)',
504 '<(DEPTH)/build/android/ant/apk-codegen.xml',
506 # Add list of inputs to the command line, so if inputs change
507 # (e.g. if a Java file is removed), the command will be re-run.
508 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
509 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
513 'action_name': 'javac_<(_target_name)',
514 'message': 'Compiling java for <(_target_name)',
517 '<(java_in_dir)/src',
518 '<(intermediate_dir)/gen',
519 '>@(additional_src_dirs)',
520 '>@(generated_src_dirs)',
524 '<(DEPTH)/build/android/gyp/util/build_utils.py',
525 '<(DEPTH)/build/android/gyp/javac.py',
526 # If there is a separate find for additional_src_dirs, it will find the
527 # wrong .java files when additional_src_dirs is empty.
528 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")',
529 '>@(input_jars_paths)',
531 '>@(compile_input_paths)',
537 'python', '<(DEPTH)/build/android/gyp/javac.py',
538 '--output-dir=<(classes_dir)',
539 '--classpath=>(input_jars_paths) <(android_sdk_jar)',
540 '--src-dirs=>(all_src_dirs)',
541 '--javac-includes=<(javac_includes)',
542 '--chromium-code=<(chromium_code)',
543 '--stamp=<(compile_stamp)',
545 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
546 '--ignore=>!(echo \'>(_inputs)\' | md5sum)',
550 'action_name': 'instr_classes_<(_target_name)',
551 'message': 'Instrumenting <(_target_name) classes',
553 'input_path': '<(classes_dir)',
554 'output_path': '<(classes_final_dir)',
555 'stamp_path': '<(instr_stamp)',
556 'instr_type': 'classes',
564 'includes': [ 'android/instr_action.gypi' ],
567 'action_name': 'jar_<(_target_name)',
568 'message': 'Creating <(_target_name) jar',
571 '<(DEPTH)/build/android/gyp/util/build_utils.py',
572 '<(DEPTH)/build/android/gyp/util/md5_check.py',
573 '<(DEPTH)/build/android/gyp/jar.py',
579 'python', '<(DEPTH)/build/android/gyp/jar.py',
580 '--classes-dir=<(classes_final_dir)',
581 '--jar-path=<(jar_path)',
582 '--excluded-classes=<(jar_excluded_classes)',
583 '--stamp=<(jar_stamp)',
585 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
586 '--ignore=>!(echo \'>(_inputs)\' | md5sum)',
590 'action_name': 'ant_obfuscate_<(_target_name)',
591 'message': 'Obfuscating <(_target_name)',
593 '<(DEPTH)/build/android/ant/apk-obfuscate.xml',
594 '<(DEPTH)/build/android/ant/create-test-jar.js',
595 '<(DEPTH)/build/android/gyp/util/build_utils.py',
596 '<(DEPTH)/build/android/gyp/ant.py',
598 '>@(proguard_flags_paths)',
601 '<(obfuscate_stamp)',
604 'python', '<(DEPTH)/build/android/gyp/ant.py',
606 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)',
607 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
608 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
609 '-DANDROID_SDK_VERSION=<(android_sdk_version)',
610 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
611 '-DAPK_NAME=<(apk_name)',
612 '-DCREATE_TEST_JAR_PATH=<(DEPTH)/build/android/ant/create-test-jar.js',
613 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
614 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)',
615 '-DINPUT_JARS_PATHS=>(input_jars_paths)',
616 '-DIS_TEST_APK=<(is_test_apk)',
617 '-DJAR_PATH=<(PRODUCT_DIR)/lib.java/<(jar_name)',
618 '-DOBFUSCATED_JAR_PATH=<(obfuscated_jar_path)',
619 '-DOUT_DIR=<(intermediate_dir)',
620 '-DPROGUARD_ENABLED=<(proguard_enabled)',
621 '-DPROGUARD_FLAGS=<(proguard_flags_paths)',
622 '-DTEST_JAR_PATH=<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
624 '-DSTAMP=<(obfuscate_stamp)',
627 '<(DEPTH)/build/android/ant/apk-obfuscate.xml',
629 # Add list of inputs to the command line, so if inputs change
630 # (e.g. if a Java file is removed), the command will be re-run.
631 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
632 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
636 'action_name': 'dex_<(_target_name)',
639 ['proguard_enabled == "true"', {
640 'input_paths': [ '<(obfuscate_stamp)' ],
641 'proguard_enabled_input_path': '<(obfuscated_jar_path)',
643 ['emma_instrument != 0', {
646 ['emma_instrument != 0 and is_test_apk == 0', {
647 'dex_input_paths': [ '<(emma_device_jar)' ],
650 'input_paths': [ '<(instr_stamp)' ],
651 'dex_input_paths': [ '>@(library_dexed_jars_paths)' ],
652 'dex_generated_input_dirs': [ '<(classes_final_dir)' ],
653 'output_path': '<(dex_path)',
655 'includes': [ 'android/dex_action.gypi' ],
658 'action_name': 'ant package resources',
659 'message': 'Packaging resources for <(_target_name) APK.',
661 '<(DEPTH)/build/android/ant/apk-package-resources.xml',
662 '<(DEPTH)/build/android/gyp/util/build_utils.py',
663 '<(DEPTH)/build/android/gyp/ant.py',
664 '<(android_manifest_path)',
667 '>@(library_manifest_paths)',
668 '>@(additional_input_paths)',
671 ['is_test_apk == 1', {
673 'additional_res_dirs=': [],
674 'additional_res_packages=': [],
679 '<(package_resources_stamp)',
682 'python', '<(DEPTH)/build/android/gyp/ant.py',
684 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
685 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
686 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
687 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
688 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
689 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
690 '-DAPK_NAME=<(apk_name)',
691 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)',
692 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)',
693 '-DASSET_DIR=<(asset_location)',
694 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
695 '-DOUT_DIR=<(intermediate_dir)',
696 '-DRESOURCE_DIR=<(resource_dir)',
698 '-DSTAMP=<(package_resources_stamp)',
702 '<(DEPTH)/build/android/ant/apk-package-resources.xml',
704 # Add list of inputs to the command line, so if inputs change
705 # (e.g. if a Java file is removed), the command will be re-run.
706 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
707 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
711 'action_name': 'ant_package_<(_target_name)',
712 'message': 'Packaging <(_target_name).',
714 '<(DEPTH)/build/android/ant/apk-package.xml',
715 '<(DEPTH)/build/android/gyp/util/build_utils.py',
716 '<(DEPTH)/build/android/gyp/ant.py',
719 '<(obfuscate_stamp)',
720 '<(package_resources_stamp)',
721 '>@(package_input_paths)',
724 '<(unsigned_apk_path)',
727 'python', '<(DEPTH)/build/android/gyp/ant.py',
729 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
730 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
731 '-DAPK_NAME=<(apk_name)',
732 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
733 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)',
734 '-DOUT_DIR=<(intermediate_dir)',
735 '-DSOURCE_DIR=<(source_dir)',
736 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)',
737 '-DEMMA_INSTRUMENT=<(emma_instrument)',
738 '-DEMMA_DEVICE_JAR=<(emma_device_jar)',
742 '<(DEPTH)/build/android/ant/apk-package.xml',
744 # Add list of inputs to the command line, so if inputs change
745 # (e.g. if a Java file is removed), the command will be re-run.
746 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
747 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',