| 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("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
| 6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
| 7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
| 8 import("//tools/grit/grit_rule.gni") | 8 import("//tools/grit/grit_rule.gni") |
| 9 import("//tools/relocation_packer/config.gni") | 9 import("//tools/relocation_packer/config.gni") |
| 10 | 10 |
| (...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 # (and so not through builtin targets like 'action', 'group', etc). | 1154 # (and so not through builtin targets like 'action', 'group', etc). |
| 1155 # java_files: List of .java files to include in the apk. | 1155 # java_files: List of .java files to include in the apk. |
| 1156 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars | 1156 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars |
| 1157 # will be added to java_files and be included in this apk. | 1157 # will be added to java_files and be included in this apk. |
| 1158 # apk_name: Name for final apk. | 1158 # apk_name: Name for final apk. |
| 1159 # final_apk_path: Path to final built apk. Default is | 1159 # final_apk_path: Path to final built apk. Default is |
| 1160 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. | 1160 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. |
| 1161 # native_libs: List paths of native libraries to include in this apk. If these | 1161 # native_libs: List paths of native libraries to include in this apk. If these |
| 1162 # libraries depend on other shared_library targets, those dependencies will | 1162 # libraries depend on other shared_library targets, those dependencies will |
| 1163 # also be included in the apk. | 1163 # also be included in the apk. |
| 1164 # apk_under_test: For an instrumentation test apk, this is the target of the |
| 1165 # tested apk. |
| 1164 # testonly: Marks this target as "test-only". | 1166 # testonly: Marks this target as "test-only". |
| 1165 # | 1167 # |
| 1166 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in | 1168 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in |
| 1167 # this directory will be included in the library. This is only supported to | 1169 # this directory will be included in the library. This is only supported to |
| 1168 # ease the gyp->gn conversion and will be removed in the future. | 1170 # ease the gyp->gn conversion and will be removed in the future. |
| 1169 # | 1171 # |
| 1170 # Example | 1172 # Example |
| 1171 # android_apk("foo_apk") { | 1173 # android_apk("foo_apk") { |
| 1172 # android_manifest = "AndroidManifest.xml" | 1174 # android_manifest = "AndroidManifest.xml" |
| 1173 # java_files = [ | 1175 # java_files = [ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1187 # } | 1189 # } |
| 1188 template("android_apk") { | 1190 template("android_apk") { |
| 1189 set_sources_assignment_filter([]) | 1191 set_sources_assignment_filter([]) |
| 1190 if (defined(invoker.testonly)) { | 1192 if (defined(invoker.testonly)) { |
| 1191 testonly = invoker.testonly | 1193 testonly = invoker.testonly |
| 1192 } | 1194 } |
| 1193 | 1195 |
| 1194 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) | 1196 assert(defined(invoker.final_apk_path) || defined(invoker.apk_name)) |
| 1195 gen_dir = "$target_gen_dir/$target_name" | 1197 gen_dir = "$target_gen_dir/$target_name" |
| 1196 base_path = "$gen_dir/$target_name" | 1198 base_path = "$gen_dir/$target_name" |
| 1197 _build_config = "$base_path.build_config" | 1199 _build_config = "$target_gen_dir/$target_name.build_config" |
| 1198 resources_zip_path = "$base_path.resources.zip" | 1200 resources_zip_path = "$base_path.resources.zip" |
| 1199 all_resources_zip_path = "$base_path.resources.all.zip" | 1201 all_resources_zip_path = "$base_path.resources.all.zip" |
| 1200 jar_path = "$base_path.jar" | 1202 jar_path = "$base_path.jar" |
| 1201 final_dex_path = "$gen_dir/classes.dex" | 1203 final_dex_path = "$gen_dir/classes.dex" |
| 1202 _template_name = target_name | 1204 _template_name = target_name |
| 1203 _final_apk_path = "" | 1205 _final_apk_path = "" |
| 1204 if (defined(invoker.final_apk_path)) { | 1206 if (defined(invoker.final_apk_path)) { |
| 1205 _final_apk_path = invoker.final_apk_path | 1207 _final_apk_path = invoker.final_apk_path |
| 1206 } else if (defined(invoker.apk_name)) { | 1208 } else if (defined(invoker.apk_name)) { |
| 1207 _final_apk_path = "$root_build_dir/apks/" + invoker.apk_name + ".apk" | 1209 _final_apk_path = "$root_build_dir/apks/" + invoker.apk_name + ".apk" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 write_build_config("${_template_name}__build_config") { | 1284 write_build_config("${_template_name}__build_config") { |
| 1283 type = "android_apk" | 1285 type = "android_apk" |
| 1284 dex_path = final_dex_path | 1286 dex_path = final_dex_path |
| 1285 resources_zip = resources_zip_path | 1287 resources_zip = resources_zip_path |
| 1286 build_config = _build_config | 1288 build_config = _build_config |
| 1287 | 1289 |
| 1288 if (defined(invoker.deps)) { | 1290 if (defined(invoker.deps)) { |
| 1289 deps = invoker.deps | 1291 deps = invoker.deps |
| 1290 } | 1292 } |
| 1291 | 1293 |
| 1294 if (defined(invoker.apk_under_test)) { |
| 1295 apk_under_test = invoker.apk_under_test |
| 1296 } |
| 1297 |
| 1292 native_libs = _native_libs | 1298 native_libs = _native_libs |
| 1293 } | 1299 } |
| 1294 | 1300 |
| 1295 final_deps = [] | 1301 final_deps = [] |
| 1296 | 1302 |
| 1297 final_deps += [ ":${_template_name}__process_resources" ] | 1303 final_deps += [ ":${_template_name}__process_resources" ] |
| 1298 process_resources("${_template_name}__process_resources") { | 1304 process_resources("${_template_name}__process_resources") { |
| 1299 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 1305 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
| 1300 android_manifest = invoker.android_manifest | 1306 android_manifest = invoker.android_manifest |
| 1301 resource_dirs = [ "//build/android/ant/empty/res" ] | 1307 resource_dirs = [ "//build/android/ant/empty/res" ] |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1794 template("uiautomator_test") { | 1800 template("uiautomator_test") { |
| 1795 set_sources_assignment_filter([]) | 1801 set_sources_assignment_filter([]) |
| 1796 if (defined(invoker.testonly)) { | 1802 if (defined(invoker.testonly)) { |
| 1797 testonly = invoker.testonly | 1803 testonly = invoker.testonly |
| 1798 } | 1804 } |
| 1799 assert(target_name != "") | 1805 assert(target_name != "") |
| 1800 assert(invoker.deps != [] || true) | 1806 assert(invoker.deps != [] || true) |
| 1801 group(target_name) { | 1807 group(target_name) { |
| 1802 } | 1808 } |
| 1803 } | 1809 } |
| OLD | NEW |