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 # use_chromium_linker - Enable the content dynamic linker that allows sharing the
50 # RELRO section of the native libraries between the different processes.
51 # enable_chromium_linker_tests - Enable the content dynamic linker test support
52 # code. This allows a test APK to inject a Linker.TestRunner instance at
53 # runtime. Should only be used by the chromium_linker_test_apk target!!
54 # never_lint - Set to 1 to not run lint on this target.
57 'additional_input_paths': [],
58 'input_jars_paths': [],
59 'library_dexed_jars_paths': [],
60 'additional_src_dirs': [],
61 'generated_src_dirs': [],
62 'app_manifest_version_name%': '<(android_app_version_name)',
63 'app_manifest_version_code%': '<(android_app_version_code)',
64 'proguard_enabled%': 'false',
65 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'],
66 'jar_name': 'chromium_apk_<(_target_name).jar',
67 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
69 'additional_R_text_files': [],
70 'additional_res_dirs': [],
71 'additional_res_packages': [],
73 'java_strings_grd%': '',
74 'resource_input_paths': [],
75 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
76 'asset_location%': '<(intermediate_dir)/assets',
77 'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
78 'package_input_paths': [],
79 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
80 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLibraries.template',
81 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
82 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java',
83 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp',
84 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/',
85 'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h',
86 'native_libraries_template_version_file': '<(native_libraries_template_data_dir)/native_libraries_version.h',
87 'compile_stamp': '<(intermediate_dir)/compile.stamp',
88 'lint_stamp': '<(intermediate_dir)/lint.stamp',
89 'lint_result': '<(intermediate_dir)/lint_result.xml',
90 'lint_config': '<(intermediate_dir)/lint_config.xml',
92 'instr_stamp': '<(intermediate_dir)/instr.stamp',
93 'jar_stamp': '<(intermediate_dir)/jar.stamp',
94 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
95 'strip_stamp': '<(intermediate_dir)/strip.stamp',
96 'classes_dir': '<(intermediate_dir)/classes',
97 'classes_final_dir': '<(intermediate_dir)/classes_instr',
99 'jar_excluded_classes': [],
100 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
101 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
102 'dex_path': '<(intermediate_dir)/classes.dex',
103 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
104 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
105 'push_stamp': '<(intermediate_dir)/push.stamp',
106 'link_stamp': '<(intermediate_dir)/link.stamp',
107 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp',
108 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
109 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
110 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
111 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp',
112 'device_intermediate_dir': '/data/local/tmp/chromium/<(_target_name)/<(CONFIGURATION_NAME)',
113 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
114 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
115 'create_standalone_apk%': 1,
118 'native_lib_target%': '',
119 'native_lib_version_name%': '',
120 'use_chromium_linker%' : 0,
121 'enable_chromium_linker_tests%': 0,
125 ['gyp_managed_install == 1 and native_lib_target != ""', {
126 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk',
128 'unsigned_standalone_apk_path': '<(unsigned_apk_path)',
130 ['gyp_managed_install == 1', {
131 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
133 'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
135 ['is_test_apk == 0 and emma_coverage != 0', {
136 'emma_instrument%': 1,
138 'emma_instrument%': 0,
142 'native_lib_target%': '',
143 'native_lib_version_name%': '',
144 'use_chromium_linker%' : 0,
145 'enable_chromium_linker_tests%': 0,
146 'emma_instrument%': '<(emma_instrument)',
147 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)',
148 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
149 'extra_native_libs': [],
151 # Pass the jar path to the apk's "fake" jar target. This would be better as
152 # direct_dependent_settings, but a variable set by a direct_dependent_settings
153 # cannot be lifted in a dependent to all_dependent_settings.
154 'all_dependent_settings': {
156 'apk_output_jar_path': '<(jar_path)',
160 ['resource_dir!=""', {
162 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
165 ['R_package != ""', {
167 # We generate R.java in package R_package (in addition to the package
168 # listed in the AndroidManifest.xml, which is unavoidable).
169 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'],
170 'additional_res_packages': ['<(R_package)'],
171 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'],
174 ['native_lib_target != "" and component == "shared_library"', {
176 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
179 ['use_chromium_linker == 1', {
181 '<(DEPTH)/base/base.gyp:chromium_android_linker',
184 ['native_lib_target != ""', {
186 'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
187 'native_libs_paths': [
188 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)'
190 'package_input_paths': [
191 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
196 # gdbserver is always copied into the APK's native libs dir. The ant
197 # build scripts (apkbuilder task) will only include it in a debug
199 'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)',
201 '<(android_gdbserver)',
209 ['use_chromium_linker == 1', {
211 'linker_input_libraries': [
212 '<(SHARED_LIB_DIR)/libchromium_android_linker.>(android_product_extension)',
217 'linker_input_libraries': [],
222 '<@(native_libs_paths)',
223 '<@(extra_native_libs)',
224 '<@(linker_input_libraries)',
227 'includes': ['../build/android/write_ordered_libraries.gypi'],
230 'action_name': 'native_libraries_template_data_<(_target_name)',
231 'message': 'Creating native_libraries_list.h for <(_target_name)',
233 '<(DEPTH)/build/android/gyp/util/build_utils.py',
234 '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
235 '<(ordered_libraries_file)',
238 '<(native_libraries_template_data_file)',
239 '<(native_libraries_template_version_file)',
242 'python', '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
243 '--ordered-libraries=<(ordered_libraries_file)',
244 '--version-name=<(native_lib_version_name)',
245 '--native-library-list=<(native_libraries_template_data_file)',
246 '--version-output=<(native_libraries_template_version_file)',
250 'action_name': 'native_libraries_<(_target_name)',
253 ['use_chromium_linker == 1', {
255 'linker_gcc_preprocess_defines': [
256 '--defines', 'ENABLE_CHROMIUM_LINKER',
261 'linker_gcc_preprocess_defines': [],
264 ['enable_chromium_linker_tests == 1', {
266 'linker_tests_gcc_preprocess_defines': [
267 '--defines', 'ENABLE_CHROMIUM_LINKER_TESTS',
272 'linker_tests_gcc_preprocess_defines': [],
276 'gcc_preprocess_defines': [
277 '<@(linker_gcc_preprocess_defines)',
278 '<@(linker_tests_gcc_preprocess_defines)',
281 'message': 'Creating NativeLibraries.java for <(_target_name)',
283 '<(DEPTH)/build/android/gyp/util/build_utils.py',
284 '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
285 '<(native_libraries_template_data_file)',
286 '<(native_libraries_template_version_file)',
287 '<(native_libraries_template)',
290 '<(native_libraries_java_stamp)',
293 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
294 '--include-path=<(native_libraries_template_data_dir)',
295 '--output=<(native_libraries_java_file)',
296 '--template=<(native_libraries_template)',
297 '--stamp=<(native_libraries_java_stamp)',
298 '<@(gcc_preprocess_defines)',
302 'action_name': 'strip_native_libraries',
304 'ordered_libraries_file%': '<(ordered_libraries_file)',
305 'stripped_libraries_dir': '<(libraries_source_dir)',
307 '<@(native_libs_paths)',
308 '<@(extra_native_libs)',
310 'stamp': '<(strip_stamp)'
312 'includes': ['../build/android/strip_native_libraries.gypi'],
316 ['gyp_managed_install == 1', {
318 'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
319 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
320 'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
321 'configuration_name': '<(CONFIGURATION_NAME)',
324 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
328 'includes': ['../build/android/push_libraries.gypi'],
331 'action_name': 'create device library symlinks',
332 'message': 'Creating links on device for <(_target_name)',
334 '<(DEPTH)/build/android/gyp/util/build_utils.py',
335 '<(DEPTH)/build/android/gyp/create_device_library_links.py',
336 '<(apk_install_record)',
337 '<(build_device_config_path)',
338 '<(ordered_libraries_file)',
344 'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
345 '--build-device-configuration=<(build_device_config_path)',
346 '--libraries-json=<(ordered_libraries_file)',
347 '--script-host-path=<(symlink_script_host_path)',
348 '--script-device-path=<(symlink_script_device_path)',
349 '--target-dir=<(device_library_dir)',
350 '--apk=<(incomplete_apk_path)',
351 '--stamp=<(link_stamp)',
352 '--configuration-name=<(CONFIGURATION_NAME)',
357 ['create_standalone_apk == 1', {
360 'action_name': 'create standalone APK',
363 '<(ordered_libraries_file)',
366 'input_apk_path': '<(unsigned_apk_path)',
367 'output_apk_path': '<(unsigned_standalone_apk_path)',
368 'libraries_top_dir%': '<(libraries_top_dir)',
370 'includes': [ 'android/create_standalone_apk_action.gypi' ],
376 # gyp_managed_install != 1
378 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
379 'package_input_paths': [ '<(strip_stamp)' ],
383 }], # native_lib_target != ''
384 ['gyp_managed_install == 0 or create_standalone_apk == 1', {
387 'action_name': 'finalize standalone apk',
389 'input_apk_path': '<(unsigned_standalone_apk_path)',
390 'output_apk_path': '<(final_apk_path)',
392 'includes': [ 'android/finalize_apk_action.gypi']
396 ['java_strings_grd != ""', {
398 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit',
399 'additional_res_dirs': ['<(res_grit_dir)'],
400 # grit_grd_file is used by grit_action.gypi, included below.
401 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
402 'resource_input_paths': [
403 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir)" <(grit_grd_file))'
408 'action_name': 'generate_localized_strings_xml',
410 'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'],
411 'grit_out_dir': '<(res_grit_dir)',
412 # resource_ids is unneeded since we don't generate .h headers.
413 'grit_resource_ids': '',
415 'includes': ['../build/grit_action.gypi'],
419 ['gyp_managed_install == 1', {
422 'action_name': 'finalize incomplete apk',
424 'input_apk_path': '<(unsigned_apk_path)',
425 'output_apk_path': '<(incomplete_apk_path)',
427 'includes': [ 'android/finalize_apk_action.gypi']
430 'action_name': 'apk_install_<(_target_name)',
431 'message': 'Installing <(apk_name).apk',
433 '<(DEPTH)/build/android/gyp/util/build_utils.py',
434 '<(DEPTH)/build/android/gyp/apk_install.py',
435 '<(build_device_config_path)',
436 '<(incomplete_apk_path)',
439 '<(apk_install_record)',
442 'python', '<(DEPTH)/build/android/gyp/apk_install.py',
443 '--apk-path=<(incomplete_apk_path)',
444 '--build-device-configuration=<(build_device_config_path)',
445 '--install-record=<(apk_install_record)',
446 '--configuration-name=<(CONFIGURATION_NAME)',
451 ['is_test_apk == 1', {
453 '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
458 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
462 'action_name': 'ant_codegen_<(_target_name)',
463 'message': 'Generating R.java for <(_target_name)',
465 ['is_test_apk == 1', {
467 'additional_res_dirs=': [],
468 'additional_res_packages=': [],
473 # Write the inputs list to a file, so that its mtime is updated when
474 # the list of inputs changes.
475 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional_input_paths) >@(resource_input_paths))'
478 '<(DEPTH)/build/android/ant/apk-codegen.xml',
479 '<(DEPTH)/build/android/gyp/util/build_utils.py',
480 '<(DEPTH)/build/android/gyp/ant.py',
481 '<(android_manifest_path)',
482 '>@(additional_input_paths)',
483 '>@(resource_input_paths)',
484 '>(inputs_list_file)',
490 'python', '<(DEPTH)/build/android/gyp/ant.py',
492 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
493 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
494 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
495 '-DANDROID_MANIFEST=<(android_manifest_path)',
496 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
497 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
498 '-DANDROID_SDK_VERSION=<(android_sdk_version)',
499 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
500 '-DOUT_DIR=<(intermediate_dir)',
501 '-DRESOURCE_DIR=<(resource_dir)',
503 '-DSTAMP=<(codegen_stamp)',
506 '<(DEPTH)/build/android/ant/apk-codegen.xml',
510 'action_name': 'javac_<(_target_name)',
511 'message': 'Compiling java for <(_target_name)',
514 '<(intermediate_dir)/gen',
515 '>@(generated_src_dirs)',
517 # If there is a separate find for additional_src_dirs, it will find the
518 # wrong .java files when additional_src_dirs is empty.
519 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and
520 # java_apk.gypi evaluate the same command, and at the moment two targets
521 # set java_in_dir to "java". Add a dummy comment here to make sure
522 # that the two targets (one uses java.gypi, the other java_apk.gypi)
523 # get distinct source lists. Medium-term, make targets list all their
524 # Java files instead of using find. (As is, this will be broken if two
525 # targets use the same java_in_dir and both use java_apk.gypi or
526 # both use java.gypi.)
527 'java_sources': ['>!@(find >(java_in_dir)/src >(additional_src_dirs) -name "*.java" # apk)'],
531 '<(DEPTH)/build/android/gyp/util/build_utils.py',
532 '<(DEPTH)/build/android/gyp/javac.py',
534 '>@(input_jars_paths)',
538 ['native_lib_target != ""', {
539 'inputs': [ '<(native_libraries_java_stamp)' ],
546 'python', '<(DEPTH)/build/android/gyp/javac.py',
547 '--output-dir=<(classes_dir)',
548 '--classpath=>(input_jars_paths) <(android_sdk_jar)',
549 '--src-gendirs=>(gen_src_dirs)',
550 '--javac-includes=<(javac_includes)',
551 '--chromium-code=<(chromium_code)',
552 '--stamp=<(compile_stamp)',
559 '<(java_in_dir)/src',
560 '>@(additional_src_dirs)',
562 'stamp_path': '<(lint_stamp)',
563 'result_path': '<(lint_result)',
564 'config_path': '<(lint_config)',
572 'includes': [ 'android/lint_action.gypi' ],
575 'action_name': 'instr_classes_<(_target_name)',
576 'message': 'Instrumenting <(_target_name) classes',
578 'input_path': '<(classes_dir)',
579 'output_path': '<(classes_final_dir)',
580 'stamp_path': '<(instr_stamp)',
581 'instr_type': 'classes',
589 'includes': [ 'android/instr_action.gypi' ],
592 'action_name': 'jar_<(_target_name)',
593 'message': 'Creating <(_target_name) jar',
595 '<(DEPTH)/build/android/gyp/util/build_utils.py',
596 '<(DEPTH)/build/android/gyp/util/md5_check.py',
597 '<(DEPTH)/build/android/gyp/jar.py',
604 'python', '<(DEPTH)/build/android/gyp/jar.py',
605 '--classes-dir=<(classes_final_dir)',
606 '--jar-path=<(jar_path)',
607 '--excluded-classes=<(jar_excluded_classes)',
608 '--stamp=<(jar_stamp)',
612 'action_name': 'ant_obfuscate_<(_target_name)',
613 'message': 'Obfuscating <(_target_name)',
615 '<(DEPTH)/build/android/ant/apk-obfuscate.xml',
616 '<(DEPTH)/build/android/gyp/util/build_utils.py',
617 '<(DEPTH)/build/android/gyp/ant.py',
618 '<(android_manifest_path)',
619 '>@(proguard_flags_paths)',
623 # This lists obfuscate_stamp instead of obfuscated_jar_path because
624 # ant only writes the latter if the md5 of the inputs changes.
625 '<(obfuscate_stamp)',
628 'python', '<(DEPTH)/build/android/gyp/ant.py',
630 '-DANDROID_MANIFEST=<(android_manifest_path)',
631 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
632 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
633 '-DANDROID_SDK_VERSION=<(android_sdk_version)',
634 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
635 '-DAPK_NAME=<(apk_name)',
636 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
637 '-DINPUT_JARS_PATHS=>(input_jars_paths)',
638 '-DIS_TEST_APK=<(is_test_apk)',
639 '-DOBFUSCATED_JAR_PATH=<(obfuscated_jar_path)',
640 '-DOUT_DIR=<(intermediate_dir)',
641 '-DPROGUARD_ENABLED=<(proguard_enabled)',
642 '-DPROGUARD_FLAGS=<(proguard_flags_paths)',
643 '-DTEST_JAR_PATH=<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
645 '-DSTAMP=<(obfuscate_stamp)',
648 '<(DEPTH)/build/android/ant/apk-obfuscate.xml',
652 'action_name': 'dex_<(_target_name)',
655 ['emma_instrument != 0', {
657 'dex_input_paths': [ '<(emma_device_jar)' ],
660 'dex_input_paths': [ '>@(library_dexed_jars_paths)' ],
661 'dex_generated_input_dirs': [ '<(classes_final_dir)' ],
662 'output_path': '<(dex_path)',
663 'proguard_enabled_input_path': '<(obfuscated_jar_path)',
666 ['proguard_enabled == "true"', { 'inputs': [ '<(obfuscate_stamp)' ] },
667 { 'inputs': [ '<(instr_stamp)' ] }],
669 'includes': [ 'android/dex_action.gypi' ],
672 'action_name': 'ant package resources',
673 'message': 'Packaging resources for <(_target_name) APK',
675 '<(DEPTH)/build/android/ant/apk-package-resources.xml',
676 '<(DEPTH)/build/android/gyp/util/build_utils.py',
677 '<(DEPTH)/build/android/gyp/ant.py',
678 '<(android_manifest_path)',
680 # TODO: This isn't always rerun correctly, http://crbug.com/351928
682 '>@(additional_input_paths)',
685 ['is_test_apk == 1', {
687 'additional_res_dirs=': [],
688 'additional_res_packages=': [],
693 '<(package_resources_stamp)',
696 'python', '<(DEPTH)/build/android/gyp/ant.py',
698 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
699 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
700 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
701 '-DANDROID_MANIFEST=<(android_manifest_path)',
702 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
703 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
704 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
705 '-DAPK_NAME=<(apk_name)',
706 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)',
707 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)',
708 '-DASSET_DIR=<(asset_location)',
709 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
710 '-DOUT_DIR=<(intermediate_dir)',
711 '-DRESOURCE_DIR=<(resource_dir)',
713 '-DSTAMP=<(package_resources_stamp)',
717 '<(DEPTH)/build/android/ant/apk-package-resources.xml',
721 'action_name': 'ant_package_<(_target_name)',
722 'message': 'Packaging <(_target_name)',
724 # Write the inputs list to a file, so that its mtime is updated when
725 # the list of inputs changes.
726 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_input_paths))'
729 '<(DEPTH)/build/android/ant/apk-package.xml',
730 '<(DEPTH)/build/android/gyp/util/build_utils.py',
731 '<(DEPTH)/build/android/gyp/ant.py',
734 '<(obfuscate_stamp)',
735 '<(package_resources_stamp)',
736 '>@(package_input_paths)',
737 '>(inputs_list_file)',
740 '<(unsigned_apk_path)',
743 'python', '<(DEPTH)/build/android/gyp/ant.py',
745 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
746 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
747 '-DAPK_NAME=<(apk_name)',
748 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
749 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)',
750 '-DOUT_DIR=<(intermediate_dir)',
751 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)',
752 '-DEMMA_INSTRUMENT=<(emma_instrument)',
753 '-DEMMA_DEVICE_JAR=<(emma_device_jar)',
757 '<(DEPTH)/build/android/ant/apk-package.xml',