OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to build Android APKs in a consistent manner. | 6 # to build Android APKs in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'my_package_apk', | 10 # 'target_name': 'my_package_apk', |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 'load_library_from_zip_file%' : 0, | 174 'load_library_from_zip_file%' : 0, |
175 'use_relocation_packer%' : 0, | 175 'use_relocation_packer%' : 0, |
176 'enable_chromium_linker_tests%': 0, | 176 'enable_chromium_linker_tests%': 0, |
177 'emma_instrument%': '<(emma_instrument)', | 177 'emma_instrument%': '<(emma_instrument)', |
178 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', | 178 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', |
179 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', | 179 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
180 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_
extension)', | 180 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_
extension)', |
181 'extra_native_libs': [], | 181 'extra_native_libs': [], |
182 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)/native_lib_placeholder.stamp', | 182 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)/native_lib_placeholder.stamp', |
183 'native_lib_placeholders': [], | 183 'native_lib_placeholders': [], |
| 184 'enable_errorprone%': '1', |
| 185 'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone', |
184 }, | 186 }, |
185 # Pass the jar path to the apk's "fake" jar target. This would be better as | 187 # Pass the jar path to the apk's "fake" jar target. This would be better as |
186 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 188 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
187 # cannot be lifted in a dependent to all_dependent_settings. | 189 # cannot be lifted in a dependent to all_dependent_settings. |
188 'all_dependent_settings': { | 190 'all_dependent_settings': { |
189 'conditions': [ | 191 'conditions': [ |
190 ['proguard_enabled == "true"', { | 192 ['proguard_enabled == "true"', { |
191 'variables': { | 193 'variables': { |
192 'proguard_enabled': 'true', | 194 'proguard_enabled': 'true', |
193 } | 195 } |
(...skipping 22 matching lines...) Expand all Loading... |
216 ['native_lib_target != "" and component == "shared_library"', { | 218 ['native_lib_target != "" and component == "shared_library"', { |
217 'dependencies': [ | 219 'dependencies': [ |
218 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', | 220 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', |
219 ], | 221 ], |
220 }], | 222 }], |
221 ['use_chromium_linker == 1', { | 223 ['use_chromium_linker == 1', { |
222 'dependencies': [ | 224 'dependencies': [ |
223 '<(DEPTH)/base/base.gyp:chromium_android_linker', | 225 '<(DEPTH)/base/base.gyp:chromium_android_linker', |
224 ], | 226 ], |
225 }], | 227 }], |
| 228 ['enable_errorprone == 1', { |
| 229 'dependencies': [ |
| 230 '<(DEPTH)/third_party/errorprone/errorprone.gyp:chromium_errorprone', |
| 231 ], |
| 232 }], |
226 ['native_lib_target != ""', { | 233 ['native_lib_target != ""', { |
227 'variables': { | 234 'variables': { |
228 'conditions': [ | 235 'conditions': [ |
229 ['use_chromium_linker == 1', { | 236 ['use_chromium_linker == 1', { |
230 'variables': { | 237 'variables': { |
231 'chromium_linker_path': [ | 238 'chromium_linker_path': [ |
232 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)', | 239 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)', |
233 ], | 240 ], |
234 } | 241 } |
235 }, { | 242 }, { |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 # wrong .java files when additional_src_dirs is empty. | 678 # wrong .java files when additional_src_dirs is empty. |
672 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and | 679 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and |
673 # java_apk.gypi evaluate the same command, and at the moment two targets | 680 # java_apk.gypi evaluate the same command, and at the moment two targets |
674 # set java_in_dir to "java". Add a dummy comment here to make sure | 681 # set java_in_dir to "java". Add a dummy comment here to make sure |
675 # that the two targets (one uses java.gypi, the other java_apk.gypi) | 682 # that the two targets (one uses java.gypi, the other java_apk.gypi) |
676 # get distinct source lists. Medium-term, make targets list all their | 683 # get distinct source lists. Medium-term, make targets list all their |
677 # Java files instead of using find. (As is, this will be broken if two | 684 # Java files instead of using find. (As is, this will be broken if two |
678 # targets use the same java_in_dir and both use java_apk.gypi or | 685 # targets use the same java_in_dir and both use java_apk.gypi or |
679 # both use java.gypi.) | 686 # both use java.gypi.) |
680 'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additio
nal_src_dirs) -name "*.java" # apk)'], | 687 'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additio
nal_src_dirs) -name "*.java" # apk)'], |
681 | 688 'conditions': [ |
| 689 ['enable_errorprone == 1', { |
| 690 'extra_inputs': [ |
| 691 '<(errorprone_exe_path)', |
| 692 ], |
| 693 'extra_args': [ '--errorprone-path=<(errorprone_exe_path)' ], |
| 694 }], |
| 695 ], |
682 }, | 696 }, |
683 'inputs': [ | 697 'inputs': [ |
684 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 698 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
685 '<(DEPTH)/build/android/gyp/javac.py', | 699 '<(DEPTH)/build/android/gyp/javac.py', |
686 '>@(java_sources)', | 700 '>@(java_sources)', |
687 '>@(input_jars_paths)', | 701 '>@(input_jars_paths)', |
688 '<(codegen_stamp)', | 702 '<(codegen_stamp)', |
| 703 '<@(extra_inputs)', |
689 ], | 704 ], |
690 'conditions': [ | 705 'conditions': [ |
691 ['native_lib_target != ""', { | 706 ['native_lib_target != ""', { |
692 'inputs': [ '<(native_libraries_java_stamp)' ], | 707 'inputs': [ '<(native_libraries_java_stamp)' ], |
693 }], | 708 }], |
694 ], | 709 ], |
695 'outputs': [ | 710 'outputs': [ |
696 '<(compile_stamp)', | 711 '<(compile_stamp)', |
697 '<(javac_jar_path)', | 712 '<(javac_jar_path)', |
698 ], | 713 ], |
699 'action': [ | 714 'action': [ |
700 'python', '<(DEPTH)/build/android/gyp/javac.py', | 715 'python', '<(DEPTH)/build/android/gyp/javac.py', |
701 '--classpath=>(input_jars_paths) <(android_sdk_jar)', | 716 '--classpath=>(input_jars_paths) <(android_sdk_jar)', |
702 '--src-gendirs=>(gen_src_dirs)', | 717 '--src-gendirs=>(gen_src_dirs)', |
703 '--javac-includes=<(javac_includes)', | 718 '--javac-includes=<(javac_includes)', |
704 '--chromium-code=<(chromium_code)', | 719 '--chromium-code=<(chromium_code)', |
705 '--jar-path=<(javac_jar_path)', | 720 '--jar-path=<(javac_jar_path)', |
706 '--jar-excluded-classes=<(jar_excluded_classes)', | 721 '--jar-excluded-classes=<(jar_excluded_classes)', |
707 '--stamp=<(compile_stamp)', | 722 '--stamp=<(compile_stamp)', |
| 723 '<@(extra_args)', |
708 '>@(java_sources)', | 724 '>@(java_sources)', |
709 ], | 725 ], |
710 }, | 726 }, |
711 { | 727 { |
712 'action_name': 'instr_jar_<(_target_name)', | 728 'action_name': 'instr_jar_<(_target_name)', |
713 'message': 'Instrumenting <(_target_name) jar', | 729 'message': 'Instrumenting <(_target_name) jar', |
714 'variables': { | 730 'variables': { |
715 'input_path': '<(javac_jar_path)', | 731 'input_path': '<(javac_jar_path)', |
716 'output_path': '<(jar_path)', | 732 'output_path': '<(jar_path)', |
717 'stamp_path': '<(instr_stamp)', | 733 'stamp_path': '<(instr_stamp)', |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 'conditions': [ | 902 'conditions': [ |
887 ['native_lib_target != ""', { | 903 ['native_lib_target != ""', { |
888 'extra_inputs': ['<(native_lib_placeholder_stamp)'], | 904 'extra_inputs': ['<(native_lib_placeholder_stamp)'], |
889 }], | 905 }], |
890 ], | 906 ], |
891 }, | 907 }, |
892 'includes': ['android/apkbuilder_action.gypi'], | 908 'includes': ['android/apkbuilder_action.gypi'], |
893 }, | 909 }, |
894 ], | 910 ], |
895 } | 911 } |
OLD | NEW |