OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
7 import("//build/config/zip.gni") | 7 import("//build/config/zip.gni") |
8 import("//third_party/ijar/ijar.gni") | 8 import("//third_party/ijar/ijar.gni") |
9 | 9 |
10 assert(is_android) | 10 assert(is_android) |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 defined(invoker.native_libs_filearg) || _native_libs != [] | 1120 defined(invoker.native_libs_filearg) || _native_libs != [] |
1121 if (_has_native_libs && _native_libs_even_when_incremental == []) { | 1121 if (_has_native_libs && _native_libs_even_when_incremental == []) { |
1122 native_lib_placeholders = [ "libfix.crbug.384638.so" ] | 1122 native_lib_placeholders = [ "libfix.crbug.384638.so" ] |
1123 } | 1123 } |
1124 | 1124 |
1125 output_apk_path = _incremental_packaged_apk_path | 1125 output_apk_path = _incremental_packaged_apk_path |
1126 resource_packaged_apk_path = _incremental_resource_packaged_apk_path | 1126 resource_packaged_apk_path = _incremental_resource_packaged_apk_path |
1127 } | 1127 } |
1128 | 1128 |
1129 _finalize_apk_rule_name = "${target_name}__finalize" | 1129 _finalize_apk_rule_name = "${target_name}__finalize" |
| 1130 _output_apks = [ _final_apk_path ] |
1130 finalize_apk(_finalize_apk_rule_name) { | 1131 finalize_apk(_finalize_apk_rule_name) { |
1131 forward_variables_from(invoker, [ "page_align_shared_libraries" ]) | 1132 forward_variables_from(invoker, [ "page_align_shared_libraries" ]) |
1132 | 1133 |
1133 input_apk_path = _packaged_apk_path | 1134 input_apk_path = _packaged_apk_path |
1134 output_apk_path = _final_apk_path | 1135 output_apk_path = _final_apk_path |
1135 keystore_path = _keystore_path | 1136 keystore_path = _keystore_path |
1136 keystore_name = _keystore_name | 1137 keystore_name = _keystore_name |
1137 keystore_password = _keystore_password | 1138 keystore_password = _keystore_password |
1138 rezip_apk = _load_library_from_apk | 1139 rezip_apk = _load_library_from_apk |
1139 | 1140 |
1140 public_deps = [ | 1141 deps = [ |
1141 # Generator of the _packaged_apk_path this target takes as input. | 1142 # Generator of the _packaged_apk_path this target takes as input. |
1142 ":$package_target", | 1143 ":$package_target", |
1143 ] | 1144 ] |
1144 } | 1145 } |
1145 | 1146 |
1146 _incremental_finalize_apk_rule_name = "${target_name}_incremental__finalize" | 1147 _incremental_finalize_apk_rule_name = "${target_name}_incremental__finalize" |
1147 finalize_apk(_incremental_finalize_apk_rule_name) { | 1148 finalize_apk(_incremental_finalize_apk_rule_name) { |
1148 input_apk_path = _incremental_packaged_apk_path | 1149 input_apk_path = _incremental_packaged_apk_path |
1149 output_apk_path = _incremental_final_apk_path | 1150 output_apk_path = _incremental_final_apk_path |
1150 keystore_path = _keystore_path | 1151 keystore_path = _keystore_path |
1151 keystore_name = _keystore_name | 1152 keystore_name = _keystore_name |
1152 keystore_password = _keystore_password | 1153 keystore_password = _keystore_password |
1153 | 1154 |
1154 public_deps = [ | 1155 deps = [ |
1155 ":$_incremental_package_target", | 1156 ":$_incremental_package_target", |
1156 ] | 1157 ] |
1157 } | 1158 } |
1158 | 1159 |
1159 _split_deps = [] | 1160 _split_deps = [] |
1160 | 1161 |
1161 template("finalize_split") { | 1162 template("finalize_split") { |
| 1163 _output_paths = process_file_template( |
| 1164 [ _final_apk_path ], |
| 1165 "{{source_dir}}/{{source_name_part}}-${_type}-${_config}.apk") |
| 1166 _output_apk_path = _output_paths[0] |
| 1167 _output_apks += [ _output_apk_path ] |
1162 finalize_apk(target_name) { | 1168 finalize_apk(target_name) { |
1163 _config = invoker.split_config | 1169 _config = invoker.split_config |
1164 _type = invoker.split_type | 1170 _type = invoker.split_type |
1165 input_apk_path = "${_resource_packaged_apk_path}_${_config}" | 1171 input_apk_path = "${_resource_packaged_apk_path}_${_config}" |
1166 _output_paths = process_file_template( | 1172 output_apk_path = _output_apk_path |
1167 [ _final_apk_path ], | |
1168 "{{source_dir}}/{{source_name_part}}-${_type}-${_config}.apk") | |
1169 output_apk_path = _output_paths[0] | |
1170 keystore_path = _keystore_path | 1173 keystore_path = _keystore_path |
1171 keystore_name = _keystore_name | 1174 keystore_name = _keystore_name |
1172 keystore_password = _keystore_password | 1175 keystore_password = _keystore_password |
1173 deps = [ | 1176 deps = [ |
1174 ":${_package_resources_target_name}", | 1177 ":${_package_resources_target_name}", |
1175 ] | 1178 ] |
1176 } | 1179 } |
1177 } | 1180 } |
1178 | 1181 |
1179 foreach(_split, _split_densities) { | 1182 foreach(_split, _split_densities) { |
1180 _split_rule = "${target_name}__finalize_${_split}_split" | 1183 _split_rule = "${target_name}__finalize_${_split}_split" |
1181 finalize_split(_split_rule) { | 1184 finalize_split(_split_rule) { |
1182 split_type = "density" | 1185 split_type = "density" |
1183 split_config = _split | 1186 split_config = _split |
1184 } | 1187 } |
1185 _split_deps += [ ":$_split_rule" ] | 1188 _split_deps += [ ":$_split_rule" ] |
1186 } | 1189 } |
1187 foreach(_split, _split_languages) { | 1190 foreach(_split, _split_languages) { |
1188 _split_rule = "${target_name}__finalize_${_split}_split" | 1191 _split_rule = "${target_name}__finalize_${_split}_split" |
1189 finalize_split(_split_rule) { | 1192 finalize_split(_split_rule) { |
1190 split_type = "lang" | 1193 split_type = "lang" |
1191 split_config = _split | 1194 split_config = _split |
1192 } | 1195 } |
1193 _split_deps += [ ":$_split_rule" ] | 1196 _split_deps += [ ":$_split_rule" ] |
1194 } | 1197 } |
1195 | 1198 |
| 1199 _all_apk_deps = [ ":${_finalize_apk_rule_name}" ] + _split_deps |
1196 group(target_name) { | 1200 group(target_name) { |
1197 public_deps = [ ":${_finalize_apk_rule_name}" ] + _split_deps | 1201 public_deps = _all_apk_deps |
| 1202 } |
| 1203 group("${target_name}__data") { |
| 1204 data = _output_apks |
1198 } | 1205 } |
1199 group("${target_name}_incremental") { | 1206 group("${target_name}_incremental") { |
1200 public_deps = [ ":${_incremental_finalize_apk_rule_name}" ] + _split_deps | 1207 public_deps = [ ":${_incremental_finalize_apk_rule_name}" ] + _split_deps |
1201 } | 1208 } |
1202 } | 1209 } |
1203 | 1210 |
1204 template("java_prebuilt_impl") { | 1211 template("java_prebuilt_impl") { |
1205 set_sources_assignment_filter([]) | 1212 set_sources_assignment_filter([]) |
1206 forward_variables_from(invoker, [ "testonly" ]) | 1213 forward_variables_from(invoker, [ "testonly" ]) |
1207 _supports_android = | 1214 _supports_android = |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 ] | 2171 ] |
2165 args = [ | 2172 args = [ |
2166 "--depfile", | 2173 "--depfile", |
2167 rebase_path(depfile, root_build_dir), | 2174 rebase_path(depfile, root_build_dir), |
2168 "--script-output-path", | 2175 "--script-output-path", |
2169 rebase_path(generated_script, root_build_dir), | 2176 rebase_path(generated_script, root_build_dir), |
2170 ] | 2177 ] |
2171 args += test_runner_args | 2178 args += test_runner_args |
2172 } | 2179 } |
2173 } | 2180 } |
OLD | NEW |