| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', | 202 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
| 203 'unsigned_apk_path': '<(unsigned_apk_path)', | 203 'unsigned_apk_path': '<(unsigned_apk_path)', |
| 204 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', | 204 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
| 205 'create_abi_split%': '<(create_abi_split)', | 205 'create_abi_split%': '<(create_abi_split)', |
| 206 'managed_input_apk_path': '<(managed_input_apk_path)', | 206 'managed_input_apk_path': '<(managed_input_apk_path)', |
| 207 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_
extension)', | 207 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_
extension)', |
| 208 'extra_native_libs': [], | 208 'extra_native_libs': [], |
| 209 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)/native_lib_placeholder.stamp', | 209 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap
p_abi)/native_lib_placeholder.stamp', |
| 210 'native_lib_placeholders': [], | 210 'native_lib_placeholders': [], |
| 211 'main_apk_name': '<(apk_name)', | 211 'main_apk_name': '<(apk_name)', |
| 212 'enable_errorprone%': '0', |
| 213 'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone', |
| 212 }, | 214 }, |
| 213 # Pass the jar path to the apk's "fake" jar target. This would be better as | 215 # Pass the jar path to the apk's "fake" jar target. This would be better as |
| 214 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 216 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
| 215 # cannot be lifted in a dependent to all_dependent_settings. | 217 # cannot be lifted in a dependent to all_dependent_settings. |
| 216 'all_dependent_settings': { | 218 'all_dependent_settings': { |
| 217 'conditions': [ | 219 'conditions': [ |
| 218 ['proguard_enabled == "true"', { | 220 ['proguard_enabled == "true"', { |
| 219 'variables': { | 221 'variables': { |
| 220 'proguard_enabled': 'true', | 222 'proguard_enabled': 'true', |
| 221 } | 223 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 244 ['native_lib_target != "" and component == "shared_library"', { | 246 ['native_lib_target != "" and component == "shared_library"', { |
| 245 'dependencies': [ | 247 'dependencies': [ |
| 246 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', | 248 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', |
| 247 ], | 249 ], |
| 248 }], | 250 }], |
| 249 ['use_chromium_linker == 1', { | 251 ['use_chromium_linker == 1', { |
| 250 'dependencies': [ | 252 'dependencies': [ |
| 251 '<(DEPTH)/base/base.gyp:chromium_android_linker', | 253 '<(DEPTH)/base/base.gyp:chromium_android_linker', |
| 252 ], | 254 ], |
| 253 }], | 255 }], |
| 256 ['enable_errorprone == 1', { |
| 257 'dependencies': [ |
| 258 '<(DEPTH)/third_party/errorprone/errorprone.gyp:chromium_errorprone', |
| 259 ], |
| 260 }], |
| 254 ['native_lib_target != ""', { | 261 ['native_lib_target != ""', { |
| 255 'variables': { | 262 'variables': { |
| 256 'conditions': [ | 263 'conditions': [ |
| 257 ['use_chromium_linker == 1', { | 264 ['use_chromium_linker == 1', { |
| 258 'variables': { | 265 'variables': { |
| 259 'chromium_linker_path': [ | 266 'chromium_linker_path': [ |
| 260 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)', | 267 '<(SHARED_LIB_DIR)/<(libchromium_android_linker)', |
| 261 ], | 268 ], |
| 262 } | 269 } |
| 263 }, { | 270 }, { |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 | 793 |
| 787 '--stamp', '<(codegen_stamp)', | 794 '--stamp', '<(codegen_stamp)', |
| 788 | 795 |
| 789 '<@(process_resources_options)', | 796 '<@(process_resources_options)', |
| 790 ], | 797 ], |
| 791 }, | 798 }, |
| 792 { | 799 { |
| 793 'action_name': 'javac_<(_target_name)', | 800 'action_name': 'javac_<(_target_name)', |
| 794 'message': 'Compiling java for <(_target_name)', | 801 'message': 'Compiling java for <(_target_name)', |
| 795 'variables': { | 802 'variables': { |
| 803 'extra_args': [], |
| 804 'extra_inputs': [], |
| 796 'gen_src_dirs': [ | 805 'gen_src_dirs': [ |
| 797 '<(intermediate_dir)/gen', | 806 '<(intermediate_dir)/gen', |
| 798 '>@(generated_src_dirs)', | 807 '>@(generated_src_dirs)', |
| 799 ], | 808 ], |
| 800 # If there is a separate find for additional_src_dirs, it will find the | 809 # If there is a separate find for additional_src_dirs, it will find the |
| 801 # wrong .java files when additional_src_dirs is empty. | 810 # wrong .java files when additional_src_dirs is empty. |
| 802 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and | 811 # TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and |
| 803 # java_apk.gypi evaluate the same command, and at the moment two targets | 812 # java_apk.gypi evaluate the same command, and at the moment two targets |
| 804 # set java_in_dir to "java". Add a dummy comment here to make sure | 813 # set java_in_dir to "java". Add a dummy comment here to make sure |
| 805 # that the two targets (one uses java.gypi, the other java_apk.gypi) | 814 # that the two targets (one uses java.gypi, the other java_apk.gypi) |
| 806 # get distinct source lists. Medium-term, make targets list all their | 815 # get distinct source lists. Medium-term, make targets list all their |
| 807 # Java files instead of using find. (As is, this will be broken if two | 816 # Java files instead of using find. (As is, this will be broken if two |
| 808 # targets use the same java_in_dir and both use java_apk.gypi or | 817 # targets use the same java_in_dir and both use java_apk.gypi or |
| 809 # both use java.gypi.) | 818 # both use java.gypi.) |
| 810 'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additio
nal_src_dirs) -name "*.java" # apk)'], | 819 'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additio
nal_src_dirs) -name "*.java" # apk)'], |
| 811 | 820 'conditions': [ |
| 821 ['enable_errorprone == 1', { |
| 822 'extra_inputs': [ |
| 823 '<(errorprone_exe_path)', |
| 824 ], |
| 825 'extra_args': [ '--use-errorprone-path=<(errorprone_exe_path)' ], |
| 826 }], |
| 827 ], |
| 812 }, | 828 }, |
| 813 'inputs': [ | 829 'inputs': [ |
| 814 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 830 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 815 '<(DEPTH)/build/android/gyp/javac.py', | 831 '<(DEPTH)/build/android/gyp/javac.py', |
| 816 '>@(java_sources)', | 832 '>@(java_sources)', |
| 817 '>@(input_jars_paths)', | 833 '>@(input_jars_paths)', |
| 818 '<(codegen_stamp)', | 834 '<(codegen_stamp)', |
| 835 '<@(extra_inputs)', |
| 819 ], | 836 ], |
| 820 'conditions': [ | 837 'conditions': [ |
| 821 ['native_lib_target != ""', { | 838 ['native_lib_target != ""', { |
| 822 'inputs': [ '<(native_libraries_java_stamp)' ], | 839 'inputs': [ '<(native_libraries_java_stamp)' ], |
| 823 }], | 840 }], |
| 824 ], | 841 ], |
| 825 'outputs': [ | 842 'outputs': [ |
| 826 '<(compile_stamp)', | 843 '<(compile_stamp)', |
| 827 '<(javac_jar_path)', | 844 '<(javac_jar_path)', |
| 828 ], | 845 ], |
| 829 'action': [ | 846 'action': [ |
| 830 'python', '<(DEPTH)/build/android/gyp/javac.py', | 847 'python', '<(DEPTH)/build/android/gyp/javac.py', |
| 831 '--classpath=>(input_jars_paths) <(android_sdk_jar)', | 848 '--classpath=>(input_jars_paths) <(android_sdk_jar)', |
| 832 '--src-gendirs=>(gen_src_dirs)', | 849 '--src-gendirs=>(gen_src_dirs)', |
| 833 '--javac-includes=<(javac_includes)', | 850 '--javac-includes=<(javac_includes)', |
| 834 '--chromium-code=<(chromium_code)', | 851 '--chromium-code=<(chromium_code)', |
| 835 '--jar-path=<(javac_jar_path)', | 852 '--jar-path=<(javac_jar_path)', |
| 836 '--jar-excluded-classes=<(jar_excluded_classes)', | 853 '--jar-excluded-classes=<(jar_excluded_classes)', |
| 837 '--stamp=<(compile_stamp)', | 854 '--stamp=<(compile_stamp)', |
| 855 '<@(extra_args)', |
| 838 '>@(java_sources)', | 856 '>@(java_sources)', |
| 839 ], | 857 ], |
| 840 }, | 858 }, |
| 841 { | 859 { |
| 842 'action_name': 'instr_jar_<(_target_name)', | 860 'action_name': 'instr_jar_<(_target_name)', |
| 843 'message': 'Instrumenting <(_target_name) jar', | 861 'message': 'Instrumenting <(_target_name) jar', |
| 844 'variables': { | 862 'variables': { |
| 845 'input_path': '<(javac_jar_path)', | 863 'input_path': '<(javac_jar_path)', |
| 846 'output_path': '<(jar_path)', | 864 'output_path': '<(jar_path)', |
| 847 'stamp_path': '<(instr_stamp)', | 865 'stamp_path': '<(instr_stamp)', |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 'native_libs_dir': '<(apk_package_native_libs_dir)', | 1038 'native_libs_dir': '<(apk_package_native_libs_dir)', |
| 1021 }, { | 1039 }, { |
| 1022 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', | 1040 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
| 1023 }], | 1041 }], |
| 1024 ], | 1042 ], |
| 1025 }, | 1043 }, |
| 1026 'includes': ['android/apkbuilder_action.gypi'], | 1044 'includes': ['android/apkbuilder_action.gypi'], |
| 1027 }, | 1045 }, |
| 1028 ], | 1046 ], |
| 1029 } | 1047 } |
| OLD | NEW |