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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 # code. This allows a test APK to inject a Linker.TestRunner instance at | 63 # code. This allows a test APK to inject a Linker.TestRunner instance at |
64 # runtime. Should only be used by the chromium_linker_test_apk target!! | 64 # runtime. Should only be used by the chromium_linker_test_apk target!! |
65 # never_lint - Set to 1 to not run lint on this target. | 65 # never_lint - Set to 1 to not run lint on this target. |
66 # java_in_dir_suffix - To override the /src suffix on java_in_dir. | 66 # java_in_dir_suffix - To override the /src suffix on java_in_dir. |
67 # app_manifest_version_name - set the apps 'human readable' version number. | 67 # app_manifest_version_name - set the apps 'human readable' version number. |
68 # app_manifest_version_code - set the apps version number. | 68 # app_manifest_version_code - set the apps version number. |
69 { | 69 { |
70 'variables': { | 70 'variables': { |
71 'tested_apk_obfuscated_jar_path%': '/', | 71 'tested_apk_obfuscated_jar_path%': '/', |
72 'tested_apk_dex_path%': '/', | 72 'tested_apk_dex_path%': '/', |
73 'tested_apk_is_multidex%': 0, | |
73 'additional_input_paths': [], | 74 'additional_input_paths': [], |
74 'create_density_splits%': 0, | 75 'create_density_splits%': 0, |
75 'language_splits': [], | 76 'language_splits': [], |
76 'input_jars_paths': [], | 77 'input_jars_paths': [], |
77 'library_dexed_jars_paths': [], | 78 'library_dexed_jars_paths': [], |
79 'main_dex_list_paths': [], | |
78 'additional_src_dirs': [], | 80 'additional_src_dirs': [], |
79 'generated_src_dirs': [], | 81 'generated_src_dirs': [], |
80 'app_manifest_version_name%': '<(android_app_version_name)', | 82 'app_manifest_version_name%': '<(android_app_version_name)', |
81 'app_manifest_version_code%': '<(android_app_version_code)', | 83 'app_manifest_version_code%': '<(android_app_version_code)', |
82 # aapt generates this proguard.txt. | 84 # aapt generates this proguard.txt. |
83 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', | 85 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', |
84 'proguard_enabled%': 'false', | 86 'proguard_enabled%': 'false', |
85 'proguard_flags_paths': ['<(generated_proguard_file)'], | 87 'proguard_flags_paths': ['<(generated_proguard_file)'], |
86 'jar_name': 'chromium_apk_<(_target_name).jar', | 88 'jar_name': 'chromium_apk_<(_target_name).jar', |
87 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', | 89 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 'strip_stamp': '<(intermediate_dir)/strip.stamp', | 126 'strip_stamp': '<(intermediate_dir)/strip.stamp', |
125 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries', | 127 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries', |
126 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp', | 128 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp', |
127 'version_stamp': '<(intermediate_dir)/version.stamp', | 129 'version_stamp': '<(intermediate_dir)/version.stamp', |
128 'javac_includes': [], | 130 'javac_includes': [], |
129 'jar_excluded_classes': [], | 131 'jar_excluded_classes': [], |
130 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', | 132 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', |
131 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 133 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
132 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 134 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
133 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | 135 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', |
134 'dex_path': '<(intermediate_dir)/classes.dex', | 136 'enable_multidex%': 0, |
135 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 137 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
136 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 138 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
137 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi d_app_abi)/AndroidManifest.xml', | 139 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi d_app_abi)/AndroidManifest.xml', |
138 'push_stamp': '<(intermediate_dir)/push.stamp', | 140 'push_stamp': '<(intermediate_dir)/push.stamp', |
139 'link_stamp': '<(intermediate_dir)/link.stamp', | 141 'link_stamp': '<(intermediate_dir)/link.stamp', |
140 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', | 142 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', |
141 'shared_resources%': 0, | 143 'shared_resources%': 0, |
142 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 144 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
143 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', | 145 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', |
144 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_ app_abi).apk', | 146 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_ app_abi).apk', |
145 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', | 147 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', |
146 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', | 148 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
147 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t arget_name)/<(CONFIGURATION_NAME)', | 149 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t arget_name)/<(CONFIGURATION_NAME)', |
148 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', | 150 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
149 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh ', | 151 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh ', |
150 'create_standalone_apk%': 1, | 152 'create_standalone_apk%': 1, |
151 'res_v14_skip%': 0, | 153 'res_v14_skip%': 0, |
152 'variables': { | 154 'variables': { |
153 'variables': { | 155 'variables': { |
154 'native_lib_target%': '', | 156 'native_lib_target%': '', |
155 'native_lib_version_name%': '', | 157 'native_lib_version_name%': '', |
156 'use_chromium_linker%' : 0, | 158 'use_chromium_linker%' : 0, |
157 'use_relocation_packer%' : 0, | 159 'use_relocation_packer%' : 0, |
158 'enable_chromium_linker_tests%': 0, | 160 'enable_chromium_linker_tests%': 0, |
159 'is_test_apk%': 0, | 161 'is_test_apk%': 0, |
160 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 162 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
161 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(an droid_app_abi)-unsigned.apk', | 163 'unsigned_abi_split_apk_path': '<(intermediate_dir)/<(apk_name)-abi-<(an droid_app_abi)-unsigned.apk', |
162 'create_abi_split%': 0, | 164 'create_abi_split%': 0, |
165 'enable_multidex%': 0, | |
163 }, | 166 }, |
164 'unsigned_apk_path': '<(unsigned_apk_path)', | 167 'unsigned_apk_path': '<(unsigned_apk_path)', |
165 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', | 168 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
166 'create_abi_split%': '<(create_abi_split)', | 169 'create_abi_split%': '<(create_abi_split)', |
167 'conditions': [ | 170 'conditions': [ |
168 ['gyp_managed_install == 1 and native_lib_target != ""', { | 171 ['gyp_managed_install == 1 and native_lib_target != ""', { |
169 'conditions': [ | 172 'conditions': [ |
170 ['create_abi_split == 0', { | 173 ['create_abi_split == 0', { |
171 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-s tandalone-unsigned.apk', | 174 'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-s tandalone-unsigned.apk', |
172 }, { | 175 }, { |
(...skipping 13 matching lines...) Expand all Loading... | |
186 },{ | 189 },{ |
187 'emma_instrument%': 0, | 190 'emma_instrument%': 0, |
188 }], | 191 }], |
189 # When using abi splits, the abi split is modified by | 192 # When using abi splits, the abi split is modified by |
190 # gyp_managed_install rather than the main .apk | 193 # gyp_managed_install rather than the main .apk |
191 ['create_abi_split == 1', { | 194 ['create_abi_split == 1', { |
192 'managed_input_apk_path': '<(unsigned_abi_split_apk_path)', | 195 'managed_input_apk_path': '<(unsigned_abi_split_apk_path)', |
193 }, { | 196 }, { |
194 'managed_input_apk_path': '<(unsigned_apk_path)', | 197 'managed_input_apk_path': '<(unsigned_apk_path)', |
195 }], | 198 }], |
199 ['enable_multidex == 1', { | |
200 'dex_path': '<(intermediate_dir)/classes.dex.zip', | |
201 }, { | |
202 'dex_path': '<(intermediate_dir)/classes.dex', | |
203 }], | |
196 ], | 204 ], |
197 }, | 205 }, |
198 'native_lib_target%': '', | 206 'native_lib_target%': '', |
199 'native_lib_version_name%': '', | 207 'native_lib_version_name%': '', |
200 'use_chromium_linker%' : 0, | 208 'use_chromium_linker%' : 0, |
201 'load_library_from_zip%' : 0, | 209 'load_library_from_zip%' : 0, |
202 'use_relocation_packer%' : 0, | 210 'use_relocation_packer%' : 0, |
203 'enable_chromium_linker_tests%': 0, | 211 'enable_chromium_linker_tests%': 0, |
204 'emma_instrument%': '<(emma_instrument)', | 212 'emma_instrument%': '<(emma_instrument)', |
205 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', | 213 'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)', |
206 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', | 214 'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)', |
207 'unsigned_apk_path': '<(unsigned_apk_path)', | 215 'unsigned_apk_path': '<(unsigned_apk_path)', |
208 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', | 216 'unsigned_abi_split_apk_path': '<(unsigned_abi_split_apk_path)', |
209 'create_abi_split%': '<(create_abi_split)', | 217 'create_abi_split%': '<(create_abi_split)', |
210 'managed_input_apk_path': '<(managed_input_apk_path)', | 218 'managed_input_apk_path': '<(managed_input_apk_path)', |
211 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_ extension)', | 219 'libchromium_android_linker': 'libchromium_android_linker.>(android_product_ extension)', |
212 'extra_native_libs': [], | 220 'extra_native_libs': [], |
213 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap p_abi)/native_lib_placeholder.stamp', | 221 'native_lib_placeholder_stamp': '<(apk_package_native_libs_dir)/<(android_ap p_abi)/native_lib_placeholder.stamp', |
214 'native_lib_placeholders': [], | 222 'native_lib_placeholders': [], |
215 'main_apk_name': '<(apk_name)', | 223 'main_apk_name': '<(apk_name)', |
224 'dex_path': '<(dex_path)', | |
216 'enable_errorprone%': '0', | 225 'enable_errorprone%': '0', |
217 'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone', | 226 'errorprone_exe_path': '<(PRODUCT_DIR)/bin.java/chromium_errorprone', |
218 }, | 227 }, |
219 # Pass the jar path to the apk's "fake" jar target. This would be better as | 228 # Pass the jar path to the apk's "fake" jar target. This would be better as |
220 # direct_dependent_settings, but a variable set by a direct_dependent_settings | 229 # direct_dependent_settings, but a variable set by a direct_dependent_settings |
221 # cannot be lifted in a dependent to all_dependent_settings. | 230 # cannot be lifted in a dependent to all_dependent_settings. |
222 'all_dependent_settings': { | 231 'all_dependent_settings': { |
223 'conditions': [ | 232 'conditions': [ |
224 ['proguard_enabled == "true"', { | 233 ['proguard_enabled == "true"', { |
225 'variables': { | 234 'variables': { |
226 'proguard_enabled': 'true', | 235 'proguard_enabled': 'true', |
227 } | 236 } |
228 }], | 237 }], |
229 ], | 238 ], |
230 'variables': { | 239 'variables': { |
231 'apk_output_jar_path': '<(jar_path)', | 240 'apk_output_jar_path': '<(jar_path)', |
232 'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)', | 241 'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)', |
233 'tested_apk_dex_path': '<(dex_path)', | 242 'tested_apk_dex_path': '<(dex_path)', |
243 'tested_apk_is_multidex': '<(enable_multidex)', | |
234 }, | 244 }, |
235 }, | 245 }, |
236 'conditions': [ | 246 'conditions': [ |
237 ['resource_dir!=""', { | 247 ['resource_dir!=""', { |
238 'variables': { | 248 'variables': { |
239 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ] | 249 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ] |
240 }, | 250 }, |
241 }], | 251 }], |
242 ['R_package != ""', { | 252 ['R_package != ""', { |
243 'variables': { | 253 'variables': { |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
733 '<(findbugs_stamp)', | 743 '<(findbugs_stamp)', |
734 ], | 744 ], |
735 'action': [ | 745 'action': [ |
736 'python', '<(DEPTH)/build/android/findbugs_diff.py', | 746 'python', '<(DEPTH)/build/android/findbugs_diff.py', |
737 '--auxclasspath-gyp', '>(input_jars_paths)', | 747 '--auxclasspath-gyp', '>(input_jars_paths)', |
738 '--stamp', '<(findbugs_stamp)', | 748 '--stamp', '<(findbugs_stamp)', |
739 '<(jar_path)', | 749 '<(jar_path)', |
740 ], | 750 ], |
741 }, | 751 }, |
742 ], | 752 ], |
743 }, | 753 }], |
744 ] | 754 ['enable_multidex == 1', { |
755 'variables': { | |
756 'main_dex_list_file': '<(intermediate_dir)/main_dex_list.txt', | |
757 }, | |
758 'actions': [ | |
759 { | |
760 'action_name': 'main_dex_list_for_<(_target_name)', | |
761 'variables': { | |
762 'main_dex_rules_file': '<(DEPTH)/build/android/main_dex_classes.flag s', | |
763 }, | |
764 'inputs': [ | |
765 '<(DEPTH)/build/android/gyp/main_dex_list.py', | |
766 '<(main_dex_rules_file)', | |
767 ], | |
768 'outputs': [ | |
769 '<(main_dex_list_file)', | |
770 ], | |
771 'action': [ | |
772 'python', '<(DEPTH)/build/android/gyp/main_dex_list.py', | |
773 '--android-sdk-tools', '<(android_sdk_tools)', | |
774 '--main-dex-list-path', '<(main_dex_list_file)', | |
775 '--main-dex-rules-path', '<(main_dex_rules_file)', | |
776 '>@(input_jars_paths)', | |
777 ], | |
778 }, | |
779 ], | |
780 }], | |
745 ], | 781 ], |
746 'dependencies': [ | 782 'dependencies': [ |
747 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', | 783 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', |
748 ], | 784 ], |
749 'actions': [ | 785 'actions': [ |
750 { | 786 { |
751 'action_name': 'process_resources', | 787 'action_name': 'process_resources', |
752 'message': 'processing resources for <(_target_name)', | 788 'message': 'processing resources for <(_target_name)', |
753 'variables': { | 789 'variables': { |
754 # Write the inputs list to a file, so that its mtime is updated when | 790 # Write the inputs list to a file, so that its mtime is updated when |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
986 '--proguard-jar-path', '<(android_sdk_root)/tools/proguard/lib/proguard. jar', | 1022 '--proguard-jar-path', '<(android_sdk_root)/tools/proguard/lib/proguard. jar', |
987 | 1023 |
988 '--stamp', '<(obfuscate_stamp)', | 1024 '--stamp', '<(obfuscate_stamp)', |
989 | 1025 |
990 '>@(additional_obfuscate_options)', | 1026 '>@(additional_obfuscate_options)', |
991 ], | 1027 ], |
992 }, | 1028 }, |
993 { | 1029 { |
994 'action_name': 'dex_<(_target_name)', | 1030 'action_name': 'dex_<(_target_name)', |
995 'variables': { | 1031 'variables': { |
1032 'dex_additional_options': [], | |
996 'dex_input_paths': [ | 1033 'dex_input_paths': [ |
997 '>@(library_dexed_jars_paths)', | |
998 '<(jar_path)', | 1034 '<(jar_path)', |
999 ], | 1035 ], |
1000 'output_path': '<(dex_path)', | 1036 'output_path': '<(dex_path)', |
1001 'proguard_enabled_input_path': '<(obfuscated_jar_path)', | 1037 'proguard_enabled_input_path': '<(obfuscated_jar_path)', |
1002 }, | 1038 }, |
1039 'conditions': [ | |
1040 ['enable_multidex == 1', { | |
1041 'variables': { | |
1042 'dex_additional_options': [ | |
1043 '--multi-dex', | |
1044 '--main-dex-list-paths', '>@(main_dex_list_paths)', | |
1045 ], | |
1046 }, | |
1047 'inputs': [ | |
1048 '>@(main_dex_list_paths)', | |
Yaron
2015/08/13 20:18:27
Actually, does this include the file created from
jbudorick
2015/08/14 21:01:21
Good catch. It does now.
| |
1049 ], | |
1050 }] | |
1051 ], | |
1003 'target_conditions': [ | 1052 'target_conditions': [ |
1053 ['enable_multidex == 1 or tested_apk_is_multidex == 1', { | |
1054 'variables': { | |
1055 'dex_input_paths': [ | |
1056 '>@(input_jars_paths)', | |
1057 ], | |
1058 }, | |
1059 }, { | |
1060 'variables': { | |
1061 'dex_input_paths': [ | |
1062 '>@(library_dexed_jars_paths)', | |
1063 ], | |
1064 }, | |
1065 }], | |
1004 ['emma_instrument != 0', { | 1066 ['emma_instrument != 0', { |
1005 'variables': { | 1067 'variables': { |
1006 'dex_no_locals': 1, | 1068 'dex_no_locals': 1, |
1007 'dex_input_paths': [ | 1069 'dex_input_paths': [ |
1008 '<(emma_device_jar)' | 1070 '<(emma_device_jar)' |
1009 ], | 1071 ], |
1010 }, | 1072 }, |
1011 }], | 1073 }], |
1012 ['is_test_apk == 1 and tested_apk_dex_path != "/"', { | 1074 ['is_test_apk == 1 and tested_apk_dex_path != "/"', { |
1013 'variables': { | 1075 'variables': { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1054 'native_libs_dir': '<(apk_package_native_libs_dir)', | 1116 'native_libs_dir': '<(apk_package_native_libs_dir)', |
1055 }, { | 1117 }, { |
1056 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', | 1118 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
1057 }], | 1119 }], |
1058 ], | 1120 ], |
1059 }, | 1121 }, |
1060 'includes': ['android/apkbuilder_action.gypi'], | 1122 'includes': ['android/apkbuilder_action.gypi'], |
1061 }, | 1123 }, |
1062 ], | 1124 ], |
1063 } | 1125 } |
OLD | NEW |