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/android/internal_rules.gni") | 6 import("//build/config/android/internal_rules.gni") |
7 import("//tools/grit/grit_rule.gni") | 7 import("//tools/grit/grit_rule.gni") |
8 | 8 |
9 assert(is_android) | 9 assert(is_android) |
10 | 10 |
11 | |
12 # Declare a jni target | 11 # Declare a jni target |
13 # | 12 # |
14 # This target generates the native jni bindings for a set of .java files. | 13 # This target generates the native jni bindings for a set of .java files. |
15 # | 14 # |
16 # See base/android/jni_generator/jni_generator.py for more info about the | 15 # See base/android/jni_generator/jni_generator.py for more info about the |
17 # format of generating JNI bindings. | 16 # format of generating JNI bindings. |
18 # | 17 # |
19 # Variables | 18 # Variables |
20 # sources: list of .java files to generate jni for | 19 # sources: list of .java files to generate jni for |
21 # jni_package: subdirectory path for generated bindings | 20 # jni_package: subdirectory path for generated bindings |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
979 dex("${_template_name}__final_dex") { | 978 dex("${_template_name}__final_dex") { |
980 deps = [ ":${_template_name}__java" ] | 979 deps = [ ":${_template_name}__java" ] |
981 sources = [ jar_path ] | 980 sources = [ jar_path ] |
982 inputs = [ build_config ] | 981 inputs = [ build_config ] |
983 output = final_dex_path | 982 output = final_dex_path |
984 dex_arg_key = "${_rebased_build_config}:apk_dex:dependency_dex_files" | 983 dex_arg_key = "${_rebased_build_config}:apk_dex:dependency_dex_files" |
985 args = [ "--inputs=@FileArg($dex_arg_key)" ] | 984 args = [ "--inputs=@FileArg($dex_arg_key)" ] |
986 } | 985 } |
987 | 986 |
988 if (_native_libs != []) { | 987 if (_native_libs != []) { |
989 copy_ex("${_template_name}__prepare_native") { | 988 action("${_template_name}__prepare_native") { |
990 clear_dir = true | 989 script = "//build/android/gyp/pack_arm_relocations.py" |
990 packed_libraries_dir = "$_native_libs_dir/$android_app_abi" | |
991 depfile = "$target_gen_dir/$target_name.d" | |
992 outputs = [ | |
993 depfile | |
994 ] | |
991 inputs = [ | 995 inputs = [ |
992 build_config | 996 build_config |
993 ] | 997 ] |
994 dest = "$_native_libs_dir/$android_app_abi" | 998 relocation_packer_target = "//tools/relocation_packer($host_toolchain)" |
999 deps = [ | |
1000 relocation_packer_target | |
1001 ] | |
1002 skip_packing_list = [ | |
1003 "gdbserver", | |
1004 "libchromium_android_linker.so", | |
1005 ] | |
1006 | |
1007 has_relocations_with_addends = 0 | |
simonb (inactive)
2014/10/17 12:30:20
Should be 0 for arm, 1 for arm64.
cjhopman
2014/10/17 20:55:19
Done. This is in //tools/relocation_packer/config.
| |
1008 relocation_packer_dir = get_label_info( | |
1009 "$relocation_packer_target", "root_out_dir") | |
1010 relocation_packer_exe = "${relocation_packer_dir}/relocation_packer" | |
1011 enable_packing = false | |
simonb (inactive)
2014/10/17 12:30:20
Always false? (How is packing turned on? It is n
cjhopman
2014/10/17 20:55:19
Done.
| |
1012 enable_packing_arg = 0 | |
1013 if (enable_packing) { | |
1014 enable_packing_arg = 1 | |
1015 } | |
1016 | |
995 args = [ | 1017 args = [ |
996 "--files=@FileArg(${_rebased_build_config}:native:libraries)", | 1018 "--depfile", rebase_path(depfile, root_build_dir), |
1019 "--enable-packing=$enable_packing_arg", | |
1020 "--has-relocations-with-addends=$has_relocations_with_addends", | |
1021 "--exclude-packing-list=$skip_packing_list", | |
1022 "--android-pack-relocations", rebase_path(relocation_packer_exe, root_bu ild_dir), | |
1023 "--android-objcopy", rebase_path(android_objcopy, root_build_dir), | |
1024 "--stripped-libraries-dir", rebase_path(root_build_dir, root_build_dir), | |
1025 "--packed-libraries-dir", rebase_path(packed_libraries_dir, root_build_d ir), | |
1026 "--libraries=@FileArg(${_rebased_build_config}:native:libraries)", | |
1027 "--clear-dir" | |
997 ] | 1028 ] |
1029 | |
998 if (is_debug) { | 1030 if (is_debug) { |
999 rebased_gdbserver = rebase_path(android_gdbserver, root_build_dir) | 1031 rebased_gdbserver = rebase_path([ android_gdbserver ], root_build_dir) |
simonb (inactive)
2014/10/17 12:30:20
This seems unconnected with relocation packing wor
cjhopman
2014/10/17 20:55:19
We want gdbserver in the native libraries director
| |
1032 inputs += [ android_gdbserver ] | |
1000 args += [ | 1033 args += [ |
1001 "--files=[\"$rebased_gdbserver\"]" | 1034 "--libraries=$rebased_gdbserver" |
1002 ] | 1035 ] |
1003 } | 1036 } |
1004 } | 1037 } |
1005 } | 1038 } |
1006 | 1039 |
1007 final_deps += [":${_template_name}__create"] | 1040 final_deps += [":${_template_name}__create"] |
1008 create_apk("${_template_name}__create") { | 1041 create_apk("${_template_name}__create") { |
1009 apk_path = _final_apk_path | 1042 apk_path = _final_apk_path |
1010 android_manifest = invoker.android_manifest | 1043 android_manifest = invoker.android_manifest |
1011 resources_zip = all_resources_zip_path | 1044 resources_zip = all_resources_zip_path |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1294 } | 1327 } |
1295 | 1328 |
1296 # TODO(GYP): implement this. | 1329 # TODO(GYP): implement this. |
1297 template("uiautomator_test") { | 1330 template("uiautomator_test") { |
1298 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 1331 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
1299 assert(target_name != "") | 1332 assert(target_name != "") |
1300 assert(invoker.deps != [] || true) | 1333 assert(invoker.deps != [] || true) |
1301 group(target_name) { | 1334 group(target_name) { |
1302 } | 1335 } |
1303 } | 1336 } |
OLD | NEW |