| 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_overrides/build.gni") |     5 import("//build_overrides/build.gni") | 
|     6 import("//build/config/android/config.gni") |     6 import("//build/config/android/config.gni") | 
|     7 import("//build/config/sanitizers/sanitizers.gni") |     7 import("//build/config/sanitizers/sanitizers.gni") | 
|     8 import("//third_party/android_platform/config.gni") |  | 
|     9  |     8  | 
|    10 assert(is_android) |     9 assert(is_android) | 
|    11  |    10  | 
|    12 # These identify targets that have .build_config files (except for android_apk, |    11 # These identify targets that have .build_config files (except for android_apk, | 
|    13 # java_binary, resource_rewriter, since we never need to depend on these). |    12 # java_binary, resource_rewriter, since we never need to depend on these). | 
|    14 _java_target_whitelist = [ |    13 _java_target_whitelist = [ | 
|    15   "*:*_java", |    14   "*:*_java", | 
|    16   "*:*_javalib", |    15   "*:*_javalib", | 
|    17   "*:*_java_*",  # e.g. java_test_support |    16   "*:*_java_*",  # e.g. java_test_support | 
|    18   "*:java", |    17   "*:java", | 
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   294         # Don't list shared_libraries_runtime_deps_file as an input in order to |   293         # Don't list shared_libraries_runtime_deps_file as an input in order to | 
|   295         # avoid having to depend on the runtime_deps target. See comment in |   294         # avoid having to depend on the runtime_deps target. See comment in | 
|   296         # rules.gni for why we do this. |   295         # rules.gni for why we do this. | 
|   297         args += [ |   296         args += [ | 
|   298           "--shared-libraries-runtime-deps", |   297           "--shared-libraries-runtime-deps", | 
|   299           rebase_path(invoker.shared_libraries_runtime_deps_file, |   298           rebase_path(invoker.shared_libraries_runtime_deps_file, | 
|   300                       root_build_dir), |   299                       root_build_dir), | 
|   301         ] |   300         ] | 
|   302       } |   301       } | 
|   303  |   302  | 
|   304       if (defined(invoker.secondary_abi_shared_libraries_runtime_deps_file)) { |  | 
|   305         # Don't list secondary_abi_shared_libraries_runtime_deps_file as an |  | 
|   306         # input in order to avoid having to depend on the runtime_deps target. |  | 
|   307         # See comment in rules.gni for why we do this. |  | 
|   308         args += [ |  | 
|   309           "--secondary-abi-shared-libraries-runtime-deps", |  | 
|   310           rebase_path(invoker.secondary_abi_shared_libraries_runtime_deps_file, |  | 
|   311                       root_build_dir), |  | 
|   312         ] |  | 
|   313       } |  | 
|   314  |  | 
|   315       if (defined(invoker.proguard_enabled) && invoker.proguard_enabled) { |   303       if (defined(invoker.proguard_enabled) && invoker.proguard_enabled) { | 
|   316         args += [ |   304         args += [ | 
|   317           "--proguard-enabled", |   305           "--proguard-enabled", | 
|   318           "--proguard-info", |   306           "--proguard-info", | 
|   319           rebase_path(invoker.proguard_info, root_build_dir), |   307           rebase_path(invoker.proguard_info, root_build_dir), | 
|   320         ] |   308         ] | 
|   321       } |   309       } | 
|   322  |   310  | 
|   323       if (defined(invoker.apk_path)) { |   311       if (defined(invoker.apk_path)) { | 
|   324         _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) |   312         _rebased_apk_path = rebase_path(invoker.apk_path, root_build_dir) | 
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1277       if (invoker.native_libs != []) { |  1265       if (invoker.native_libs != []) { | 
|  1278         _rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) |  1266         _rebased_native_libs = rebase_path(invoker.native_libs, root_build_dir) | 
|  1279         args += [ "--native-libs=$_rebased_native_libs" ] |  1267         args += [ "--native-libs=$_rebased_native_libs" ] | 
|  1280       } |  1268       } | 
|  1281       if (defined(invoker.native_libs_filearg)) { |  1269       if (defined(invoker.native_libs_filearg)) { | 
|  1282         args += [ "--native-libs=${invoker.native_libs_filearg}" ] |  1270         args += [ "--native-libs=${invoker.native_libs_filearg}" ] | 
|  1283       } |  1271       } | 
|  1284       if (_native_lib_placeholders != []) { |  1272       if (_native_lib_placeholders != []) { | 
|  1285         args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] |  1273         args += [ "--native-lib-placeholders=$_native_lib_placeholders" ] | 
|  1286       } |  1274       } | 
|  1287  |  1275       if (defined(invoker.secondary_native_libs) && | 
|  1288       # TODO (michaelbai): Remove the secondary_native_libs variable. |  1276           invoker.secondary_native_libs != []) { | 
|  1289       if (defined(invoker.secondary_abi_native_libs_filearg)) { |  | 
|  1290         assert(defined(android_app_secondary_abi)) |  | 
|  1291         args += [ |  | 
|  1292           "--secondary-native-libs=${invoker.secondary_abi_native_libs_filearg}"
      , |  | 
|  1293           "--secondary-android-abi=$android_app_secondary_abi", |  | 
|  1294         ] |  | 
|  1295       } else if (defined(invoker.secondary_native_libs) && |  | 
|  1296                  invoker.secondary_native_libs != []) { |  | 
|  1297         assert(defined(android_app_secondary_abi)) |  1277         assert(defined(android_app_secondary_abi)) | 
|  1298         inputs += invoker.secondary_native_libs |  1278         inputs += invoker.secondary_native_libs | 
|  1299         _secondary_native_libs = rebase_path(invoker.secondary_native_libs) |  1279         _secondary_native_libs = rebase_path(invoker.secondary_native_libs) | 
|  1300         args += [ |  1280         args += [ | 
|  1301           "--secondary-native-libs=$_secondary_native_libs", |  1281           "--secondary-native-libs=$_secondary_native_libs", | 
|  1302           "--secondary-android-abi=$android_app_secondary_abi", |  1282           "--secondary-android-abi=$android_app_secondary_abi", | 
|  1303         ] |  1283         ] | 
|  1304       } |  1284       } | 
|  1305  |  1285  | 
|  1306       if (defined(invoker.emma_instrument) && invoker.emma_instrument) { |  1286       if (defined(invoker.emma_instrument) && invoker.emma_instrument) { | 
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1611     } |  1591     } | 
|  1612  |  1592  | 
|  1613     package_target = "${target_name}__package" |  1593     package_target = "${target_name}__package" | 
|  1614     package_apk(package_target) { |  1594     package_apk(package_target) { | 
|  1615       forward_variables_from(invoker, |  1595       forward_variables_from(invoker, | 
|  1616                              [ |  1596                              [ | 
|  1617                                "assets_build_config", |  1597                                "assets_build_config", | 
|  1618                                "emma_instrument", |  1598                                "emma_instrument", | 
|  1619                                "native_lib_placeholders", |  1599                                "native_lib_placeholders", | 
|  1620                                "native_libs_filearg", |  1600                                "native_libs_filearg", | 
|  1621                                "secondary_abi_native_libs_filearg", |  | 
|  1622                                "secondary_native_libs", |  1601                                "secondary_native_libs", | 
|  1623                                "uncompress_shared_libraries", |  1602                                "uncompress_shared_libraries", | 
|  1624                                "write_asset_list", |  1603                                "write_asset_list", | 
|  1625                              ]) |  1604                              ]) | 
|  1626       deps = _deps + [ ":${_package_resources_target_name}" ] |  1605       deps = _deps + [ ":${_package_resources_target_name}" ] | 
|  1627       native_libs = _native_libs + _native_libs_even_when_incremental |  1606       native_libs = _native_libs + _native_libs_even_when_incremental | 
|  1628  |  1607  | 
|  1629       if (defined(_dex_path)) { |  1608       if (defined(_dex_path)) { | 
|  1630         dex_path = _dex_path |  1609         dex_path = _dex_path | 
|  1631       } |  1610       } | 
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2655       script = "//build/android/gyp/generate_split_manifest.py" |  2634       script = "//build/android/gyp/generate_split_manifest.py" | 
|  2656       outputs = [ |  2635       outputs = [ | 
|  2657         invoker.out_manifest, |  2636         invoker.out_manifest, | 
|  2658       ] |  2637       ] | 
|  2659       inputs = [ |  2638       inputs = [ | 
|  2660         invoker.main_manifest, |  2639         invoker.main_manifest, | 
|  2661       ] |  2640       ] | 
|  2662     } |  2641     } | 
|  2663   } |  2642   } | 
|  2664 } |  2643 } | 
|  2665  |  | 
|  2666 template("pack_relocation_section") { |  | 
|  2667   assert(defined(invoker.file_list_json)) |  | 
|  2668   assert(defined(invoker.libraries_filearg)) |  | 
|  2669   action(target_name) { |  | 
|  2670     forward_variables_from(invoker, |  | 
|  2671                            [ |  | 
|  2672                              "deps", |  | 
|  2673                              "public_deps", |  | 
|  2674                              "inputs", |  | 
|  2675                              "testonly", |  | 
|  2676                            ]) |  | 
|  2677     script = "//build/android/gyp/pack_relocations.py" |  | 
|  2678     depfile = "$target_gen_dir/$target_name.d" |  | 
|  2679     _packed_libraries_dir = "$target_gen_dir/$target_name/packed-libs" |  | 
|  2680     outputs = [ |  | 
|  2681       invoker.file_list_json, |  | 
|  2682     ] |  | 
|  2683     deps += [ relocation_packer_target ] |  | 
|  2684  |  | 
|  2685     args = [ |  | 
|  2686       "--depfile", |  | 
|  2687       rebase_path(depfile, root_build_dir), |  | 
|  2688       "--enable-packing=1", |  | 
|  2689       "--android-pack-relocations", |  | 
|  2690       rebase_path(relocation_packer_exe, root_build_dir), |  | 
|  2691       "--stripped-libraries-dir", |  | 
|  2692       rebase_path(root_build_dir, root_build_dir), |  | 
|  2693       "--packed-libraries-dir", |  | 
|  2694       rebase_path(_packed_libraries_dir, root_build_dir), |  | 
|  2695       "--libraries=${invoker.libraries_filearg}", |  | 
|  2696       "--filelistjson", |  | 
|  2697       rebase_path(invoker.file_list_json, root_build_dir), |  | 
|  2698     ] |  | 
|  2699   } |  | 
|  2700 } |  | 
| OLD | NEW |