Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: build/java_apk.gypi

Issue 1408163009: [Android] Enable multidex for debug builds of ChromePublic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no-op ChromiumMultiDex.install for non-multidex builds Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 # java_in_dir_suffix - To override the /src suffix on java_in_dir. 70 # java_in_dir_suffix - To override the /src suffix on java_in_dir.
71 # app_manifest_version_name - set the apps 'human readable' version number. 71 # app_manifest_version_name - set the apps 'human readable' version number.
72 # app_manifest_version_code - set the apps version number. 72 # app_manifest_version_code - set the apps version number.
73 # dependencies_locale_zip_alternative_paths - a list of paths that used to 73 # dependencies_locale_zip_alternative_paths - a list of paths that used to
74 # replace dependencies_locale_zip_paths of all_dependent_settings. 74 # replace dependencies_locale_zip_paths of all_dependent_settings.
75 { 75 {
76 'variables': { 76 'variables': {
77 'tested_apk_obfuscated_jar_path%': '/', 77 'tested_apk_obfuscated_jar_path%': '/',
78 'tested_apk_dex_path%': '/', 78 'tested_apk_dex_path%': '/',
79 'tested_apk_is_multidex%': 0, 79 'tested_apk_is_multidex%': 0,
80 'tested_apk_multidex_configuration_path%': '',
80 'additional_input_paths': [], 81 'additional_input_paths': [],
81 'additional_locale_input_paths': [], 82 'additional_locale_input_paths': [],
82 'create_density_splits%': 0, 83 'create_density_splits%': 0,
83 'language_splits': [], 84 'language_splits': [],
84 'library_jars_paths': [], 85 'library_jars_paths': [],
85 'input_jars_paths': [], 86 'input_jars_paths': [],
86 'library_dexed_jars_paths': [], 87 'library_dexed_jars_paths': [],
87 'main_dex_list_path': '<(intermediate_dir)/main_dex_list.txt',
88 'main_dex_list_paths': ['<(main_dex_list_path)'],
89 'additional_src_dirs': [], 88 'additional_src_dirs': [],
90 'generated_src_dirs': [], 89 'generated_src_dirs': [],
91 'app_manifest_version_name%': '<(android_app_version_name)', 90 'app_manifest_version_name%': '<(android_app_version_name)',
92 'app_manifest_version_code%': '<(android_app_version_code)', 91 'app_manifest_version_code%': '<(android_app_version_code)',
93 # aapt generates this proguard.txt. 92 # aapt generates this proguard.txt.
94 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', 93 'generated_proguard_file': '<(intermediate_dir)/proguard.txt',
95 'proguard_enabled%': 'false', 94 'proguard_enabled%': 'false',
96 'debug_build_proguard_enabled%': 'false', 95 'debug_build_proguard_enabled%': 'false',
97 'proguard_flags_paths': ['<(generated_proguard_file)'], 96 'proguard_flags_paths': ['<(generated_proguard_file)'],
98 'jar_name': 'chromium_apk_<(_target_name).jar', 97 'jar_name': 'chromium_apk_<(_target_name).jar',
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries', 138 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries',
140 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp', 139 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp',
141 'version_stamp': '<(intermediate_dir)/version.stamp', 140 'version_stamp': '<(intermediate_dir)/version.stamp',
142 'javac_includes': [], 141 'javac_includes': [],
143 'jar_excluded_classes': [], 142 'jar_excluded_classes': [],
144 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', 143 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar',
145 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', 144 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
146 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', 145 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
147 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', 146 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
148 'enable_multidex%': 0, 147 'enable_multidex%': 0,
148 'enable_multidex_configurations%': [],
149 'multidex_configuration_path': '<(intermediate_dir)/multidex_config.json',
150 'multidex_disabled_jars_paths%': [],
151 'multidex_enabled_jars_paths%': [],
152 'main_dex_list_path': '<(intermediate_dir)/main_dex_list.txt',
149 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', 153 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
150 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', 154 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
151 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi d_app_abi)/AndroidManifest.xml', 155 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi d_app_abi)/AndroidManifest.xml',
152 'push_stamp': '<(intermediate_dir)/push.stamp', 156 'push_stamp': '<(intermediate_dir)/push.stamp',
153 'link_stamp': '<(intermediate_dir)/link.stamp', 157 'link_stamp': '<(intermediate_dir)/link.stamp',
154 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', 158 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip',
155 'shared_resources%': 0, 159 'shared_resources%': 0,
156 'app_as_shared_library%': 0, 160 'app_as_shared_library%': 0,
157 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', 161 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
158 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', 162 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)',
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 'variables': { 261 'variables': {
258 'debug_build_proguard_enabled': 'true', 262 'debug_build_proguard_enabled': 'true',
259 } 263 }
260 }], 264 }],
261 ], 265 ],
262 'variables': { 266 'variables': {
263 'apk_output_jar_path': '<(jar_path)', 267 'apk_output_jar_path': '<(jar_path)',
264 'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)', 268 'tested_apk_obfuscated_jar_path': '<(obfuscated_jar_path)',
265 'tested_apk_dex_path': '<(dex_path)', 269 'tested_apk_dex_path': '<(dex_path)',
266 'tested_apk_is_multidex': '<(enable_multidex)', 270 'tested_apk_is_multidex': '<(enable_multidex)',
271 'tested_apk_multidex_configuration_path': '<(multidex_configuration_path)' ,
267 }, 272 },
268 }, 273 },
269 'conditions': [ 274 'conditions': [
270 ['resource_dir!=""', { 275 ['resource_dir!=""', {
271 'variables': { 276 'variables': {
272 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ] 277 'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
273 }, 278 },
274 }], 279 }],
275 ['R_package != ""', { 280 ['R_package != ""', {
276 'variables': { 281 'variables': {
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 '<@(placeholders)', 507 '<@(placeholders)',
503 ], 508 ],
504 }, 509 },
505 ], 510 ],
506 'conditions': [ 511 'conditions': [
507 ['gyp_managed_install == 1', { 512 ['gyp_managed_install == 1', {
508 'variables': { 513 'variables': {
509 'libraries_top_dir': '<(intermediate_dir)/lib.stripped', 514 'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
510 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi) ', 515 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi) ',
511 'device_library_dir': '<(device_intermediate_dir)/lib.stripped', 516 'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
512 'configuration_name': '<(CONFIGURATION_NAME)',
513 }, 517 },
514 'dependencies': [ 518 'dependencies': [
515 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations', 519 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
516 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_ commands', 520 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_ commands',
517 ], 521 ],
518 'actions': [ 522 'actions': [
519 { 523 {
520 'includes': ['../build/android/push_libraries.gypi'], 524 'includes': ['../build/android/push_libraries.gypi'],
521 }, 525 },
522 { 526 {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 'density_splits': 1, 744 'density_splits': 1,
741 }, 745 },
742 'includes': [ 'android/finalize_splits_action.gypi'] 746 'includes': [ 'android/finalize_splits_action.gypi']
743 }, 747 },
744 ], 748 ],
745 }], 749 }],
746 ['is_test_apk == 1', { 750 ['is_test_apk == 1', {
747 'dependencies': [ 751 'dependencies': [
748 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm ands', 752 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm ands',
749 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', 753 '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
750 ] 754 ],
751 }], 755 }],
752 ['run_findbugs == 1', { 756 ['run_findbugs == 1', {
753 'actions': [ 757 'actions': [
754 { 758 {
755 'action_name': 'findbugs_<(_target_name)', 759 'action_name': 'findbugs_<(_target_name)',
756 'message': 'Running findbugs on <(_target_name)', 760 'message': 'Running findbugs on <(_target_name)',
757 'variables': { 761 'variables': {
758 'additional_findbugs_args': [], 762 'additional_findbugs_args': [],
759 'findbugs_verbose%': 0, 763 'findbugs_verbose%': 0,
760 }, 764 },
(...skipping 18 matching lines...) Expand all
779 'action': [ 783 'action': [
780 'python', '<(DEPTH)/build/android/findbugs_diff.py', 784 'python', '<(DEPTH)/build/android/findbugs_diff.py',
781 '--auxclasspath-gyp', '>(input_jars_paths)', 785 '--auxclasspath-gyp', '>(input_jars_paths)',
782 '--stamp', '<(findbugs_stamp)', 786 '--stamp', '<(findbugs_stamp)',
783 '<@(additional_findbugs_args)', 787 '<@(additional_findbugs_args)',
784 '<(jar_path)', 788 '<(jar_path)',
785 ], 789 ],
786 }, 790 },
787 ], 791 ],
788 }], 792 }],
793 ['enable_multidex == 1', {
794 'actions': [
795 {
796 'action_name': 'main_dex_list_for_<(_target_name)',
797 'variables': {
798 'jar_paths': ['>@(input_jars_paths)', '<(javac_jar_path)'],
799 'output_path': '<(main_dex_list_path)',
800 },
801 'includes': [ 'android/main_dex_action.gypi' ],
802 },
803 ],
804 'dependencies': [
805 '<(DEPTH)/base/base.gyp:base_multidex_enabled_java',
806 ],
807 }],
808 ],
809 'target_conditions': [
810 ['multidex_disabled_jars_paths != []', {
811 'actions': [
812 {
813 'action_name': 'configure_multidex_for_<(_target_name)',
814 'inputs': [
815 '<(DEPTH)/build/android/gyp/configure_multidex.py',
816 '>@(multidex_enabled_jars_paths)',
817 '>@(multidex_disabled_jars_paths)',
818 ],
819 'outputs': [
820 '<(multidex_configuration_path)',
821 ],
822 'variables': {
823 'additional_multidex_config_options': [],
824 'enabled_configurations': ['>@(enable_multidex_configurations)'],
825 'conditions': [
826 ['enable_multidex == 1', {
827 'additional_multidex_config_options': ['--enable-multidex'],
828 }],
829 ],
830 'target_conditions': [
831 ['multidex_enabled_jars_paths != []', {
832 'additional_multidex_config_options': [
833 '--multidex-enabled-libs', '>(multidex_enabled_jars_paths)',
agrieve 2015/11/11 14:43:01 nit: libs usually refers to native libs, can you c
jbudorick 2015/11/12 20:33:40 Entirely gone after Yaron's cpp suggestion.
834 ],
835 }],
836 ['tested_apk_multidex_configuration_path == 1', {
837 'additional_multidex_config_options': [
838 '--tested-apk-multidex-configuration-path',
839 '>(tested_apk_multidex_configuration_path)',
840 ],
841 }],
842 ],
843 },
844 'action': [
845 'python', '<(DEPTH)/build/android/gyp/configure_multidex.py',
846 '--configuration-name', '<(CONFIGURATION_NAME)',
847 '--enabled-configurations', '<(enabled_configurations)',
848 '--multidex-configuration-path', '<(multidex_configuration_path)',
849 '--multidex-disabled-libs', '>(multidex_disabled_jars_paths)',
850 '>@(additional_multidex_config_options)',
851 ],
852 },
853 ],
854 }],
789 ], 855 ],
790 'dependencies': [ 856 'dependencies': [
791 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', 857 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
792 ], 858 ],
793 'actions': [ 859 'actions': [
794 { 860 {
795 'action_name': 'process_resources', 861 'action_name': 'process_resources',
796 'message': 'processing resources for <(_target_name)', 862 'message': 'processing resources for <(_target_name)',
797 'variables': { 863 'variables': {
798 'local_additional_input_paths': [ 864 'local_additional_input_paths': [
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 '--javac-includes=<(javac_includes)', 994 '--javac-includes=<(javac_includes)',
929 '--chromium-code=<(chromium_code)', 995 '--chromium-code=<(chromium_code)',
930 '--jar-path=<(javac_jar_path)', 996 '--jar-path=<(javac_jar_path)',
931 '--jar-excluded-classes=<(jar_excluded_classes)', 997 '--jar-excluded-classes=<(jar_excluded_classes)',
932 '--stamp=<(compile_stamp)', 998 '--stamp=<(compile_stamp)',
933 '<@(extra_args)', 999 '<@(extra_args)',
934 '>@(java_sources)', 1000 '>@(java_sources)',
935 ], 1001 ],
936 }, 1002 },
937 { 1003 {
938 'action_name': 'main_dex_list_for_<(_target_name)',
939 'variables': {
940 'jar_path': '<(javac_jar_path)',
941 'output_path': '<(main_dex_list_path)',
942 },
943 'includes': [ 'android/main_dex_action.gypi' ],
944 },
945 {
946 'action_name': 'emma_instr_jar_<(_target_name)', 1004 'action_name': 'emma_instr_jar_<(_target_name)',
947 'message': 'Instrumenting <(_target_name) jar', 1005 'message': 'Instrumenting <(_target_name) jar',
948 'variables': { 1006 'variables': {
949 'input_path': '<(javac_jar_path)', 1007 'input_path': '<(javac_jar_path)',
950 'output_path': '<(jar_path)', 1008 'output_path': '<(jar_path)',
951 'stamp_path': '<(emma_instr_stamp)', 1009 'stamp_path': '<(emma_instr_stamp)',
952 'instr_type': 'jar', 1010 'instr_type': 'jar',
953 }, 1011 },
954 'outputs': [ 1012 'outputs': [
955 '<(emma_instr_stamp)', 1013 '<(emma_instr_stamp)',
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 '>@(input_jars_paths)', 1074 '>@(input_jars_paths)',
1017 '<(jar_path)', 1075 '<(jar_path)',
1018 ], 1076 ],
1019 }, 1077 },
1020 'conditions': [ 1078 'conditions': [
1021 ['is_test_apk == 1', { 1079 ['is_test_apk == 1', {
1022 'outputs': [ 1080 'outputs': [
1023 '<(test_jar_path)', 1081 '<(test_jar_path)',
1024 ], 1082 ],
1025 }], 1083 }],
1084 ['enable_multidex == 1', {
1085 'inputs': [
1086 '<(main_dex_list_path)',
1087 ],
1088 'variables': {
1089 'additional_obfuscate_options': [
1090 '--main-dex-list-path', '<(main_dex_list_path)',
1091 ],
1092 },
1093 }],
1094 ],
1095 'target_conditions': [
1096 ['multidex_disabled_jars_paths != []', {
1097 'variables': {
1098 'additional_obfuscate_options': [
1099 '--multidex-configuration-path', '>(multidex_configuration_path)',
1100 ],
1101 },
1102 'inputs': [
1103 '>(multidex_configuration_path)',
1104 ],
1105 }]
1026 ], 1106 ],
1027 'inputs': [ 1107 'inputs': [
1028 '<(DEPTH)/build/android/gyp/apk_obfuscate.py', 1108 '<(DEPTH)/build/android/gyp/apk_obfuscate.py',
1029 '<(DEPTH)/build/android/gyp/util/build_utils.py', 1109 '<(DEPTH)/build/android/gyp/util/build_utils.py',
1030 '>@(proguard_flags_paths)', 1110 '>@(proguard_flags_paths)',
1031 '>@(obfuscate_input_jars_paths)', 1111 '>@(obfuscate_input_jars_paths)',
1032 '>@(additional_obfuscate_input_paths)', 1112 '>@(additional_obfuscate_input_paths)',
1033 '<(emma_instr_stamp)', 1113 '<(emma_instr_stamp)',
1034 ], 1114 ],
1035 'outputs': [ 1115 'outputs': [
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 'variables': { 1150 'variables': {
1071 'dex_additional_options': [], 1151 'dex_additional_options': [],
1072 'dex_input_paths': [ 1152 'dex_input_paths': [
1073 '<(jar_path)', 1153 '<(jar_path)',
1074 ], 1154 ],
1075 'output_path': '<(dex_path)', 1155 'output_path': '<(dex_path)',
1076 'proguard_enabled_input_path': '<(obfuscated_jar_path)', 1156 'proguard_enabled_input_path': '<(obfuscated_jar_path)',
1077 }, 1157 },
1078 'conditions': [ 1158 'conditions': [
1079 ['enable_multidex == 1', { 1159 ['enable_multidex == 1', {
1160 'inputs': [
1161 '<(main_dex_list_path)',
1162 ],
1080 'variables': { 1163 'variables': {
1081 'dex_additional_options': [ 1164 'dex_additional_options': ['--main-dex-list-path', '<(main_dex_list_ path)'],
1082 '--multi-dex',
1083 '--main-dex-list-paths', '>@(main_dex_list_paths)',
1084 ],
1085 }, 1165 },
1086 'inputs': [ 1166 }],
1087 '>@(main_dex_list_paths)',
1088 ],
1089 }]
1090 ], 1167 ],
1091 'target_conditions': [ 1168 'target_conditions': [
1092 ['enable_multidex == 1 or tested_apk_is_multidex == 1', { 1169 ['enable_multidex == 1 or tested_apk_is_multidex == 1', {
1093 'variables': { 1170 'variables': {
1094 'dex_input_paths': [ 1171 'dex_input_paths': [
1095 '>@(input_jars_paths)', 1172 '>@(input_jars_paths)',
1096 ], 1173 ],
1097 }, 1174 },
1175 }],
1176 ['multidex_disabled_jars_paths != []', {
1177 'variables': {
1178 'dex_additional_options': [
1179 '--multidex-configuration-path', '>(multidex_configuration_path)',
1180 ],
1181 },
1182 'inputs': [
1183 '>(multidex_configuration_path)',
1184 ],
1098 }, { 1185 }, {
1099 'variables': { 1186 'variables': {
1100 'dex_input_paths': [ 1187 'dex_input_paths': [
1101 '>@(library_dexed_jars_paths)', 1188 '>@(library_dexed_jars_paths)',
1102 ], 1189 ],
1103 }, 1190 },
1104 }], 1191 }],
1105 ['emma_instrument != 0', { 1192 ['emma_instrument != 0', {
1106 'variables': { 1193 'variables': {
1107 'dex_no_locals': 1, 1194 'dex_no_locals': 1,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 'native_libs_dir': '<(apk_package_native_libs_dir)', 1248 'native_libs_dir': '<(apk_package_native_libs_dir)',
1162 }, { 1249 }, {
1163 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', 1250 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res',
1164 }], 1251 }],
1165 ], 1252 ],
1166 }, 1253 },
1167 'includes': ['android/apkbuilder_action.gypi'], 1254 'includes': ['android/apkbuilder_action.gypi'],
1168 }, 1255 },
1169 ], 1256 ],
1170 } 1257 }
OLDNEW
« build/android/gyp/dex.py ('K') | « build/java.gypi ('k') | chrome/android/chrome_apk.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698