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_chromium_linker - Enable the content dynamic linker that allows sharing the
52 # RELRO section of the native libraries between the different processes.
53 # enable_chromium_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 chromium_linker_test_apk target!!
56 # never_lint - Set to 1 to not run lint on this target.
59 'additional_input_paths': [],
60 'input_jars_paths': [],
61 'library_dexed_jars_paths': [],
62 'additional_src_dirs': [],
63 'generated_src_dirs': [],
64 'app_manifest_version_name%': '<(android_app_version_name)',
65 'app_manifest_version_code%': '<(android_app_version_code)',
66 'proguard_enabled%': 'false',
67 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'],
68 'jar_name': 'chromium_apk_<(_target_name).jar',
69 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
71 'additional_R_text_files': [],
72 'additional_res_dirs': [],
73 'additional_res_packages': [],
75 'java_strings_grd%': '',
76 'library_manifest_paths' : [],
77 'resource_input_paths': [],
78 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
79 'asset_location%': '<(intermediate_dir)/assets',
80 'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
81 'compile_input_paths': [],
82 'package_input_paths': [],
83 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
84 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLibraries.template',
85 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
86 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java',
87 'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp',
88 'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/',
89 'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h',
90 'native_libraries_template_version_file': '<(native_libraries_template_data_dir)/native_libraries_version.h',
91 'compile_stamp': '<(intermediate_dir)/compile.stamp',
92 'lint_stamp': '<(intermediate_dir)/lint.stamp',
93 'lint_result': '<(intermediate_dir)/lint_result.xml',
94 'lint_config': '<(intermediate_dir)/lint_config.xml',
96 'instr_stamp': '<(intermediate_dir)/instr.stamp',
97 'jar_stamp': '<(intermediate_dir)/jar.stamp',
98 'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
99 'strip_stamp': '<(intermediate_dir)/strip.stamp',
100 'classes_dir': '<(intermediate_dir)/classes',
101 'classes_final_dir': '<(intermediate_dir)/classes_instr',
102 'javac_includes': [],
103 'jar_excluded_classes': [],
104 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
105 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
106 'dex_path': '<(intermediate_dir)/classes.dex',
107 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
108 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
109 'push_stamp': '<(intermediate_dir)/push.stamp',
110 'link_stamp': '<(intermediate_dir)/link.stamp',
111 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp',
112 'codegen_input_paths': [],
113 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
114 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
115 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
116 'source_dir': '<(java_in_dir)/src',
117 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp',
118 'device_intermediate_dir': '/data/local/tmp/chromium/<(_target_name)/<(CONFIGURATION_NAME)',
119 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
120 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
121 'create_standalone_apk%': 1,
124 'native_lib_target%': '',
125 'native_lib_version_name%': '',
126 'use_chromium_linker%' : 0,
127 'enable_chromium_linker_tests%': 0,
131 ['gyp_managed_install == 1 and native_lib_target != ""', {
132 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk',
134 'unsigned_standalone_apk_path': '<(unsigned_apk_path)',
136 ['gyp_managed_install == 1', {
137 'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
139 'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
141 ['is_test_apk == 0 and emma_coverage != 0', {
142 'emma_instrument': 1,
144 'emma_instrument': 0,
148 'native_lib_target%': '',
149 'native_lib_version_name%': '',
150 'use_chromium_linker%' : 0,
151 'enable_chromium_linker_tests%': 0,
152 'emma_instrument': '<(emma_instrument)',
153 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)',
154 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
155 'extra_native_libs': [],
157 # Pass the jar path to the apk's "fake" jar target. This would be better as
158 # direct_dependent_settings, but a variable set by a direct_dependent_settings
159 # cannot be lifted in a dependent to all_dependent_settings.
160 'all_dependent_settings': {
162 'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
166 ['resource_dir!=""', {
168 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
171 ['R_package != ""', {
173 # We generate R.java in package R_package (in addition to the package
174 # listed in the AndroidManifest.xml, which is unavoidable).
175 'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'],
176 'additional_res_packages': ['<(R_package)'],
177 'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'],
180 ['native_lib_target != "" and component == "shared_library"', {
182 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
185 ['use_chromium_linker == 1', {
187 '<(DEPTH)/base/base.gyp:chromium_android_linker',
190 ['native_lib_target != ""', {
192 'compile_input_paths': [ '<(native_libraries_java_stamp)' ],
193 'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
194 'native_libs_paths': [
195 '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)'
197 'package_input_paths': [
198 '<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
203 # gdbserver is always copied into the APK's native libs dir. The ant
204 # build scripts (apkbuilder task) will only include it in a debug
206 'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)',
208 '<(android_gdbserver)',
209 '<@(extra_native_libs)',
217 ['use_chromium_linker == 1', {
219 'linker_input_libraries': [
220 '<(SHARED_LIB_DIR)/libchromium_android_linker.>(android_product_extension)',
225 'linker_input_libraries': [],
230 '<@(native_libs_paths)',
231 '<@(extra_native_libs)',
232 '<@(linker_input_libraries)',
235 'includes': ['../build/android/write_ordered_libraries.gypi'],
238 'action_name': 'native_libraries_template_data_<(_target_name)',
239 'message': 'Creating native_libraries_list.h for <(_target_name)',
241 '<(DEPTH)/build/android/gyp/util/build_utils.py',
242 '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
243 '<(ordered_libraries_file)',
246 '<(native_libraries_template_data_file)',
247 '<(native_libraries_template_version_file)',
250 'python', '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
251 '--ordered-libraries=<(ordered_libraries_file)',
252 '--version-name=<(native_lib_version_name)',
253 '--native-library-list=<(native_libraries_template_data_file)',
254 '--version-output=<(native_libraries_template_version_file)',
258 'action_name': 'native_libraries_<(_target_name)',
261 ['use_chromium_linker == 1', {
263 'linker_gcc_preprocess_defines': [
264 '--defines', 'ENABLE_CHROMIUM_LINKER',
269 'linker_gcc_preprocess_defines': [],
272 ['enable_chromium_linker_tests == 1', {
274 'linker_tests_gcc_preprocess_defines': [
275 '--defines', 'ENABLE_CHROMIUM_LINKER_TESTS',
280 'linker_tests_gcc_preprocess_defines': [],
284 'gcc_preprocess_defines': [
285 '<@(linker_gcc_preprocess_defines)',
286 '<@(linker_tests_gcc_preprocess_defines)',
289 'message': 'Creating NativeLibraries.java for <(_target_name)',
291 '<(DEPTH)/build/android/gyp/util/build_utils.py',
292 '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
293 '<(native_libraries_template_data_file)',
294 '<(native_libraries_template_version_file)',
295 '<(native_libraries_template)',
298 '<(native_libraries_java_stamp)',
301 'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
302 '--include-path=<(native_libraries_template_data_dir)',
303 '--output=<(native_libraries_java_file)',
304 '--template=<(native_libraries_template)',
305 '--stamp=<(native_libraries_java_stamp)',
306 '<@(gcc_preprocess_defines)',
310 'action_name': 'strip_native_libraries',
312 'ordered_libraries_file%': '<(ordered_libraries_file)',
313 'stripped_libraries_dir': '<(libraries_source_dir)',
315 '<@(native_libs_paths)',
316 '<@(extra_native_libs)',
318 'stamp': '<(strip_stamp)'
320 'includes': ['../build/android/strip_native_libraries.gypi'],
324 ['gyp_managed_install == 1', {
326 'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
327 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
328 'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
329 'configuration_name': '<(CONFIGURATION_NAME)',
332 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
336 'includes': ['../build/android/push_libraries.gypi'],
339 'action_name': 'create device library symlinks',
340 'message': 'Creating links on device for <(_target_name)',
342 '<(DEPTH)/build/android/gyp/util/build_utils.py',
343 '<(DEPTH)/build/android/gyp/create_device_library_links.py',
344 '<(apk_install_record)',
345 '<(build_device_config_path)',
346 '<(ordered_libraries_file)',
352 'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
353 '--build-device-configuration=<(build_device_config_path)',
354 '--libraries-json=<(ordered_libraries_file)',
355 '--script-host-path=<(symlink_script_host_path)',
356 '--script-device-path=<(symlink_script_device_path)',
357 '--target-dir=<(device_library_dir)',
358 '--apk=<(incomplete_apk_path)',
359 '--stamp=<(link_stamp)',
360 '--configuration-name=<(CONFIGURATION_NAME)',
365 ['create_standalone_apk == 1', {
368 'action_name': 'create standalone APK',
371 '<(ordered_libraries_file)',
374 'input_apk_path': '<(unsigned_apk_path)',
375 'output_apk_path': '<(unsigned_standalone_apk_path)',
376 'libraries_top_dir%': '<(libraries_top_dir)',
378 'includes': [ 'android/create_standalone_apk_action.gypi' ],
384 # gyp_managed_install != 1
386 'libraries_source_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
387 'package_input_paths': [ '<(strip_stamp)' ],
391 }], # native_lib_target != ''
392 ['gyp_managed_install == 0 or create_standalone_apk == 1', {
395 'action_name': 'finalize standalone apk',
397 'input_apk_path': '<(unsigned_standalone_apk_path)',
398 'output_apk_path': '<(final_apk_path)',
400 'includes': [ 'android/finalize_apk_action.gypi']
404 ['java_strings_grd != ""', {
406 'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit',
407 'additional_res_dirs': ['<(res_grit_dir)'],
408 # grit_grd_file is used by grit_action.gypi, included below.
409 'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
410 'resource_input_paths': [
411 '<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir)" <(grit_grd_file))'
416 'action_name': 'generate_localized_strings_xml',
418 'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'],
419 'grit_out_dir': '<(res_grit_dir)',
420 # resource_ids is unneeded since we don't generate .h headers.
421 'grit_resource_ids': '',
423 'includes': ['../build/grit_action.gypi'],
427 ['gyp_managed_install == 1', {
430 'action_name': 'finalize incomplete apk',
432 'input_apk_path': '<(unsigned_apk_path)',
433 'output_apk_path': '<(incomplete_apk_path)',
435 'includes': [ 'android/finalize_apk_action.gypi']
438 'action_name': 'apk_install_<(_target_name)',
439 'message': 'Installing <(apk_name).apk',
441 '<(DEPTH)/build/android/gyp/util/build_utils.py',
442 '<(DEPTH)/build/android/gyp/apk_install.py',
443 '<(build_device_config_path)',
444 '<(incomplete_apk_path)',
447 '<(apk_install_record)',
450 'python', '<(DEPTH)/build/android/gyp/apk_install.py',
451 '--apk-path=<(incomplete_apk_path)',
452 '--build-device-configuration=<(build_device_config_path)',
453 '--install-record=<(apk_install_record)',
454 '--configuration-name=<(CONFIGURATION_NAME)',
459 ['is_test_apk == 1', {
461 '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
466 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
470 'action_name': 'ant_codegen_<(_target_name)',
471 'message': 'Generating R.java for <(_target_name)',
473 ['is_test_apk == 1', {
475 'additional_res_dirs=': [],
476 'additional_res_packages=': [],
481 '<(DEPTH)/build/android/ant/apk-codegen.xml',
482 '<(DEPTH)/build/android/gyp/util/build_utils.py',
483 '<(DEPTH)/build/android/gyp/ant.py',
484 '<(android_manifest_path)',
485 '>@(additional_input_paths)',
486 '>@(codegen_input_paths)',
487 '>@(library_manifest_paths)',
488 '>@(resource_input_paths)',
494 'python', '<(DEPTH)/build/android/gyp/ant.py',
496 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
497 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
498 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
499 '-DANDROID_MANIFEST=<(android_manifest_path)',
500 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
501 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
502 '-DANDROID_SDK_VERSION=<(android_sdk_version)',
503 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
504 '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)',
505 '-DOUT_DIR=<(intermediate_dir)',
506 '-DRESOURCE_DIR=<(resource_dir)',
508 '-DSTAMP=<(codegen_stamp)',
511 '<(DEPTH)/build/android/ant/apk-codegen.xml',
513 # Add list of inputs to the command line, so if inputs change
514 # (e.g. if a Java file is removed), the command will be re-run.
515 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
516 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
520 'action_name': 'javac_<(_target_name)',
521 'message': 'Compiling java for <(_target_name)',
524 '<(java_in_dir)/src',
525 '<(intermediate_dir)/gen',
526 '>@(additional_src_dirs)',
527 '>@(generated_src_dirs)',
531 '<(DEPTH)/build/android/gyp/util/build_utils.py',
532 '<(DEPTH)/build/android/gyp/javac.py',
533 # If there is a separate find for additional_src_dirs, it will find the
534 # wrong .java files when additional_src_dirs is empty.
535 '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")',
536 '>@(input_jars_paths)',
538 '>@(compile_input_paths)',
544 'python', '<(DEPTH)/build/android/gyp/javac.py',
545 '--output-dir=<(classes_dir)',
546 '--classpath=>(input_jars_paths) <(android_sdk_jar)',
547 '--src-dirs=>(all_src_dirs)',
548 '--javac-includes=<(javac_includes)',
549 '--chromium-code=<(chromium_code)',
550 '--stamp=<(compile_stamp)',
552 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
553 '--ignore=>!(echo \'>(_inputs)\' | md5sum)',
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',
596 '<(DEPTH)/build/android/gyp/util/build_utils.py',
597 '<(DEPTH)/build/android/gyp/util/md5_check.py',
598 '<(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)',
610 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
611 '--ignore=>!(echo \'>(_inputs)\' | md5sum)',
615 'action_name': 'ant_obfuscate_<(_target_name)',
616 'message': 'Obfuscating <(_target_name)',
618 '<(DEPTH)/build/android/ant/apk-obfuscate.xml',
619 '<(DEPTH)/build/android/ant/create-test-jar.js',
620 '<(DEPTH)/build/android/gyp/util/build_utils.py',
621 '<(DEPTH)/build/android/gyp/ant.py',
623 '>@(proguard_flags_paths)',
626 '<(obfuscate_stamp)',
629 'python', '<(DEPTH)/build/android/gyp/ant.py',
631 '-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)',
632 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
633 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
634 '-DANDROID_SDK_VERSION=<(android_sdk_version)',
635 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
636 '-DAPK_NAME=<(apk_name)',
637 '-DCREATE_TEST_JAR_PATH=<(DEPTH)/build/android/ant/create-test-jar.js',
638 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
639 '-DGENERATED_SRC_DIRS=>(generated_src_dirs)',
640 '-DINPUT_JARS_PATHS=>(input_jars_paths)',
641 '-DIS_TEST_APK=<(is_test_apk)',
642 '-DJAR_PATH=<(PRODUCT_DIR)/lib.java/<(jar_name)',
643 '-DOBFUSCATED_JAR_PATH=<(obfuscated_jar_path)',
644 '-DOUT_DIR=<(intermediate_dir)',
645 '-DPROGUARD_ENABLED=<(proguard_enabled)',
646 '-DPROGUARD_FLAGS=<(proguard_flags_paths)',
647 '-DTEST_JAR_PATH=<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
649 '-DSTAMP=<(obfuscate_stamp)',
652 '<(DEPTH)/build/android/ant/apk-obfuscate.xml',
654 # Add list of inputs to the command line, so if inputs change
655 # (e.g. if a Java file is removed), the command will be re-run.
656 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
657 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
661 'action_name': 'dex_<(_target_name)',
664 ['proguard_enabled == "true"', {
665 'input_paths': [ '<(obfuscate_stamp)' ],
666 'proguard_enabled_input_path': '<(obfuscated_jar_path)',
668 ['emma_instrument != 0', {
671 ['emma_instrument != 0 and is_test_apk == 0', {
672 'dex_input_paths': [ '<(emma_device_jar)' ],
675 'input_paths': [ '<(instr_stamp)' ],
676 'dex_input_paths': [ '>@(library_dexed_jars_paths)' ],
677 'dex_generated_input_dirs': [ '<(classes_final_dir)' ],
678 'output_path': '<(dex_path)',
680 'includes': [ 'android/dex_action.gypi' ],
683 'action_name': 'ant package resources',
684 'message': 'Packaging resources for <(_target_name) APK',
686 '<(DEPTH)/build/android/ant/apk-package-resources.xml',
687 '<(DEPTH)/build/android/gyp/util/build_utils.py',
688 '<(DEPTH)/build/android/gyp/ant.py',
689 '<(android_manifest_path)',
692 '>@(library_manifest_paths)',
693 '>@(additional_input_paths)',
696 ['is_test_apk == 1', {
698 'additional_res_dirs=': [],
699 'additional_res_packages=': [],
704 '<(package_resources_stamp)',
707 'python', '<(DEPTH)/build/android/gyp/ant.py',
709 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
710 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
711 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
712 '-DANDROID_SDK_JAR=<(android_sdk_jar)',
713 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
714 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
715 '-DAPK_NAME=<(apk_name)',
716 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)',
717 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)',
718 '-DASSET_DIR=<(asset_location)',
719 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
720 '-DOUT_DIR=<(intermediate_dir)',
721 '-DRESOURCE_DIR=<(resource_dir)',
723 '-DSTAMP=<(package_resources_stamp)',
727 '<(DEPTH)/build/android/ant/apk-package-resources.xml',
729 # Add list of inputs to the command line, so if inputs change
730 # (e.g. if a Java file is removed), the command will be re-run.
731 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
732 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
736 'action_name': 'ant_package_<(_target_name)',
737 'message': 'Packaging <(_target_name)',
739 '<(DEPTH)/build/android/ant/apk-package.xml',
740 '<(DEPTH)/build/android/gyp/util/build_utils.py',
741 '<(DEPTH)/build/android/gyp/ant.py',
744 '<(obfuscate_stamp)',
745 '<(package_resources_stamp)',
746 '>@(package_input_paths)',
749 '<(unsigned_apk_path)',
752 'python', '<(DEPTH)/build/android/gyp/ant.py',
754 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
755 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
756 '-DAPK_NAME=<(apk_name)',
757 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
758 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)',
759 '-DOUT_DIR=<(intermediate_dir)',
760 '-DSOURCE_DIR=<(source_dir)',
761 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)',
762 '-DEMMA_INSTRUMENT=<(emma_instrument)',
763 '-DEMMA_DEVICE_JAR=<(emma_device_jar)',
767 '<(DEPTH)/build/android/ant/apk-package.xml',
769 # Add list of inputs to the command line, so if inputs change
770 # (e.g. if a Java file is removed), the command will be re-run.
771 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
772 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',