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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 'additional_input_paths': [], | 80 'additional_input_paths': [], |
81 'additional_locale_input_paths': [], | 81 'additional_locale_input_paths': [], |
82 'create_density_splits%': 0, | 82 'create_density_splits%': 0, |
83 'language_splits': [], | 83 'language_splits': [], |
84 'library_jars_paths': [], | 84 'library_jars_paths': [], |
85 'input_jars_paths': [], | 85 'input_jars_paths': [], |
86 'library_dexed_jars_paths': [], | 86 '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': [], | 87 'additional_src_dirs': [], |
90 'generated_src_dirs': [], | 88 'generated_src_dirs': [], |
91 'app_manifest_version_name%': '<(android_app_version_name)', | 89 'app_manifest_version_name%': '<(android_app_version_name)', |
92 'app_manifest_version_code%': '<(android_app_version_code)', | 90 'app_manifest_version_code%': '<(android_app_version_code)', |
93 # aapt generates this proguard.txt. | 91 # aapt generates this proguard.txt. |
94 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', | 92 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', |
95 'proguard_enabled%': 'false', | 93 'proguard_enabled%': 'false', |
96 'debug_build_proguard_enabled%': 'false', | 94 'debug_build_proguard_enabled%': 'false', |
97 'proguard_flags_paths': ['<(generated_proguard_file)'], | 95 'proguard_flags_paths': ['<(generated_proguard_file)'], |
98 'jar_name': 'chromium_apk_<(_target_name).jar', | 96 'jar_name': 'chromium_apk_<(_target_name).jar', |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries', | 137 'stripped_libraries_dir': '<(intermediate_dir)/stripped_libraries', |
140 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp', | 138 'strip_additional_stamp': '<(intermediate_dir)/strip_additional.stamp', |
141 'version_stamp': '<(intermediate_dir)/version.stamp', | 139 'version_stamp': '<(intermediate_dir)/version.stamp', |
142 'javac_includes': [], | 140 'javac_includes': [], |
143 'jar_excluded_classes': [], | 141 'jar_excluded_classes': [], |
144 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', | 142 'javac_jar_path': '<(intermediate_dir)/<(_target_name).javac.jar', |
145 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 143 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
146 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 144 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
147 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | 145 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', |
148 'enable_multidex%': 0, | 146 'enable_multidex%': 0, |
| 147 'enable_multidex_configurations%': [], |
| 148 'multidex_configuration_path': '<(intermediate_dir)/multidex_config.json', |
| 149 'main_dex_list_path': '<(intermediate_dir)/main_dex_list.txt', |
149 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 150 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
150 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 151 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
151 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi
d_app_abi)/AndroidManifest.xml', | 152 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi
d_app_abi)/AndroidManifest.xml', |
152 'push_stamp': '<(intermediate_dir)/push.stamp', | 153 'push_stamp': '<(intermediate_dir)/push.stamp', |
153 'link_stamp': '<(intermediate_dir)/link.stamp', | 154 'link_stamp': '<(intermediate_dir)/link.stamp', |
154 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', | 155 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', |
155 'shared_resources%': 0, | 156 'shared_resources%': 0, |
156 'app_as_shared_library%': 0, | 157 'app_as_shared_library%': 0, |
157 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 158 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
158 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', | 159 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 '<@(placeholders)', | 503 '<@(placeholders)', |
503 ], | 504 ], |
504 }, | 505 }, |
505 ], | 506 ], |
506 'conditions': [ | 507 'conditions': [ |
507 ['gyp_managed_install == 1', { | 508 ['gyp_managed_install == 1', { |
508 'variables': { | 509 'variables': { |
509 'libraries_top_dir': '<(intermediate_dir)/lib.stripped', | 510 'libraries_top_dir': '<(intermediate_dir)/lib.stripped', |
510 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)
', | 511 'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)
', |
511 'device_library_dir': '<(device_intermediate_dir)/lib.stripped', | 512 'device_library_dir': '<(device_intermediate_dir)/lib.stripped', |
512 'configuration_name': '<(CONFIGURATION_NAME)', | |
513 }, | 513 }, |
514 'dependencies': [ | 514 'dependencies': [ |
515 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations', | 515 '<(DEPTH)/build/android/setup.gyp:get_build_device_configurations', |
516 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_
commands', | 516 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_
commands', |
517 ], | 517 ], |
518 'actions': [ | 518 'actions': [ |
519 { | 519 { |
520 'includes': ['../build/android/push_libraries.gypi'], | 520 'includes': ['../build/android/push_libraries.gypi'], |
521 }, | 521 }, |
522 { | 522 { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 'density_splits': 1, | 740 'density_splits': 1, |
741 }, | 741 }, |
742 'includes': [ 'android/finalize_splits_action.gypi'] | 742 'includes': [ 'android/finalize_splits_action.gypi'] |
743 }, | 743 }, |
744 ], | 744 ], |
745 }], | 745 }], |
746 ['is_test_apk == 1', { | 746 ['is_test_apk == 1', { |
747 'dependencies': [ | 747 'dependencies': [ |
748 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm
ands', | 748 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm
ands', |
749 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', | 749 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', |
750 ] | 750 ], |
751 }], | 751 }], |
752 ['run_findbugs == 1', { | 752 ['run_findbugs == 1', { |
753 'actions': [ | 753 'actions': [ |
754 { | 754 { |
755 'action_name': 'findbugs_<(_target_name)', | 755 'action_name': 'findbugs_<(_target_name)', |
756 'message': 'Running findbugs on <(_target_name)', | 756 'message': 'Running findbugs on <(_target_name)', |
757 'variables': { | 757 'variables': { |
758 'additional_findbugs_args': [], | 758 'additional_findbugs_args': [], |
759 'findbugs_verbose%': 0, | 759 'findbugs_verbose%': 0, |
760 }, | 760 }, |
(...skipping 18 matching lines...) Expand all Loading... |
779 'action': [ | 779 'action': [ |
780 'python', '<(DEPTH)/build/android/findbugs_diff.py', | 780 'python', '<(DEPTH)/build/android/findbugs_diff.py', |
781 '--auxclasspath-gyp', '>(input_jars_paths)', | 781 '--auxclasspath-gyp', '>(input_jars_paths)', |
782 '--stamp', '<(findbugs_stamp)', | 782 '--stamp', '<(findbugs_stamp)', |
783 '<@(additional_findbugs_args)', | 783 '<@(additional_findbugs_args)', |
784 '<(jar_path)', | 784 '<(jar_path)', |
785 ], | 785 ], |
786 }, | 786 }, |
787 ], | 787 ], |
788 }], | 788 }], |
| 789 ['enable_multidex == 1', { |
| 790 'actions': [ |
| 791 { |
| 792 'action_name': 'main_dex_list_for_<(_target_name)', |
| 793 'variables': { |
| 794 'jar_paths': ['>@(input_jars_paths)', '<(javac_jar_path)'], |
| 795 'output_path': '<(main_dex_list_path)', |
| 796 }, |
| 797 'includes': [ 'android/main_dex_action.gypi' ], |
| 798 }, |
| 799 { |
| 800 'action_name': 'configure_multidex_for_<(_target_name)', |
| 801 'inputs': [ |
| 802 '<(DEPTH)/build/android/gyp/configure_multidex.py', |
| 803 ], |
| 804 'outputs': [ |
| 805 '<(multidex_configuration_path)', |
| 806 ], |
| 807 'variables': { |
| 808 'additional_multidex_config_options': [], |
| 809 'enabled_configurations': ['>@(enable_multidex_configurations)'], |
| 810 }, |
| 811 'action': [ |
| 812 'python', '<(DEPTH)/build/android/gyp/configure_multidex.py', |
| 813 '--configuration-name', '<(CONFIGURATION_NAME)', |
| 814 '--enabled-configurations', '<(enabled_configurations)', |
| 815 '--multidex-configuration-path', '<(multidex_configuration_path)', |
| 816 '>@(additional_multidex_config_options)', |
| 817 ], |
| 818 }, |
| 819 ], |
| 820 }], |
789 ], | 821 ], |
790 'dependencies': [ | 822 'dependencies': [ |
791 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', | 823 '<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum', |
792 ], | 824 ], |
793 'actions': [ | 825 'actions': [ |
794 { | 826 { |
795 'action_name': 'process_resources', | 827 'action_name': 'process_resources', |
796 'message': 'processing resources for <(_target_name)', | 828 'message': 'processing resources for <(_target_name)', |
797 'variables': { | 829 'variables': { |
798 'local_additional_input_paths': [ | 830 'local_additional_input_paths': [ |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 '--javac-includes=<(javac_includes)', | 960 '--javac-includes=<(javac_includes)', |
929 '--chromium-code=<(chromium_code)', | 961 '--chromium-code=<(chromium_code)', |
930 '--jar-path=<(javac_jar_path)', | 962 '--jar-path=<(javac_jar_path)', |
931 '--jar-excluded-classes=<(jar_excluded_classes)', | 963 '--jar-excluded-classes=<(jar_excluded_classes)', |
932 '--stamp=<(compile_stamp)', | 964 '--stamp=<(compile_stamp)', |
933 '<@(extra_args)', | 965 '<@(extra_args)', |
934 '>@(java_sources)', | 966 '>@(java_sources)', |
935 ], | 967 ], |
936 }, | 968 }, |
937 { | 969 { |
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)', | 970 'action_name': 'emma_instr_jar_<(_target_name)', |
947 'message': 'Instrumenting <(_target_name) jar', | 971 'message': 'Instrumenting <(_target_name) jar', |
948 'variables': { | 972 'variables': { |
949 'input_path': '<(javac_jar_path)', | 973 'input_path': '<(javac_jar_path)', |
950 'output_path': '<(jar_path)', | 974 'output_path': '<(jar_path)', |
951 'stamp_path': '<(emma_instr_stamp)', | 975 'stamp_path': '<(emma_instr_stamp)', |
952 'instr_type': 'jar', | 976 'instr_type': 'jar', |
953 }, | 977 }, |
954 'outputs': [ | 978 'outputs': [ |
955 '<(emma_instr_stamp)', | 979 '<(emma_instr_stamp)', |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 '>@(input_jars_paths)', | 1040 '>@(input_jars_paths)', |
1017 '<(jar_path)', | 1041 '<(jar_path)', |
1018 ], | 1042 ], |
1019 }, | 1043 }, |
1020 'conditions': [ | 1044 'conditions': [ |
1021 ['is_test_apk == 1', { | 1045 ['is_test_apk == 1', { |
1022 'outputs': [ | 1046 'outputs': [ |
1023 '<(test_jar_path)', | 1047 '<(test_jar_path)', |
1024 ], | 1048 ], |
1025 }], | 1049 }], |
| 1050 ['enable_multidex == 1', { |
| 1051 'inputs': [ |
| 1052 '<(main_dex_list_path)', |
| 1053 '<(multidex_configuration_path)', |
| 1054 ], |
| 1055 'variables': { |
| 1056 'additional_obfuscate_options': [ |
| 1057 '--main-dex-list-path', '<(main_dex_list_path)', |
| 1058 '--multidex-configuration-path', '<(multidex_configuration_path)', |
| 1059 ], |
| 1060 }, |
| 1061 }], |
1026 ], | 1062 ], |
1027 'inputs': [ | 1063 'inputs': [ |
1028 '<(DEPTH)/build/android/gyp/apk_obfuscate.py', | 1064 '<(DEPTH)/build/android/gyp/apk_obfuscate.py', |
1029 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 1065 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
1030 '>@(proguard_flags_paths)', | 1066 '>@(proguard_flags_paths)', |
1031 '>@(obfuscate_input_jars_paths)', | 1067 '>@(obfuscate_input_jars_paths)', |
1032 '>@(additional_obfuscate_input_paths)', | 1068 '>@(additional_obfuscate_input_paths)', |
1033 '<(emma_instr_stamp)', | 1069 '<(emma_instr_stamp)', |
1034 ], | 1070 ], |
1035 'outputs': [ | 1071 'outputs': [ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 'variables': { | 1106 'variables': { |
1071 'dex_additional_options': [], | 1107 'dex_additional_options': [], |
1072 'dex_input_paths': [ | 1108 'dex_input_paths': [ |
1073 '<(jar_path)', | 1109 '<(jar_path)', |
1074 ], | 1110 ], |
1075 'output_path': '<(dex_path)', | 1111 'output_path': '<(dex_path)', |
1076 'proguard_enabled_input_path': '<(obfuscated_jar_path)', | 1112 'proguard_enabled_input_path': '<(obfuscated_jar_path)', |
1077 }, | 1113 }, |
1078 'conditions': [ | 1114 'conditions': [ |
1079 ['enable_multidex == 1', { | 1115 ['enable_multidex == 1', { |
| 1116 'inputs': [ |
| 1117 '<(main_dex_list_path)', |
| 1118 '<(multidex_configuration_path)', |
| 1119 ], |
1080 'variables': { | 1120 'variables': { |
1081 'dex_additional_options': [ | 1121 'dex_additional_options': [ |
1082 '--multi-dex', | 1122 '--main-dex-list-path', '<(main_dex_list_path)' |
1083 '--main-dex-list-paths', '>@(main_dex_list_paths)', | 1123 '--multidex-configuration-path', '<(multidex_configuration_path)', |
1084 ], | 1124 ], |
1085 }, | 1125 }, |
1086 'inputs': [ | 1126 }], |
1087 '>@(main_dex_list_paths)', | |
1088 ], | |
1089 }] | |
1090 ], | 1127 ], |
1091 'target_conditions': [ | 1128 'target_conditions': [ |
1092 ['enable_multidex == 1 or tested_apk_is_multidex == 1', { | 1129 ['enable_multidex == 1 or tested_apk_is_multidex == 1', { |
1093 'variables': { | 1130 'variables': { |
1094 'dex_input_paths': [ | 1131 'dex_input_paths': [ |
1095 '>@(input_jars_paths)', | 1132 '>@(input_jars_paths)', |
1096 ], | 1133 ], |
1097 }, | 1134 }, |
1098 }, { | 1135 }, { |
1099 'variables': { | 1136 'variables': { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 'native_libs_dir': '<(apk_package_native_libs_dir)', | 1198 'native_libs_dir': '<(apk_package_native_libs_dir)', |
1162 }, { | 1199 }, { |
1163 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', | 1200 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
1164 }], | 1201 }], |
1165 ], | 1202 ], |
1166 }, | 1203 }, |
1167 'includes': ['android/apkbuilder_action.gypi'], | 1204 'includes': ['android/apkbuilder_action.gypi'], |
1168 }, | 1205 }, |
1169 ], | 1206 ], |
1170 } | 1207 } |
OLD | NEW |