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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 } | 986 } |
987 | 987 |
988 _enable_relocation_packing = false | 988 _enable_relocation_packing = false |
989 if (defined(invoker.enable_relocation_packing) && | 989 if (defined(invoker.enable_relocation_packing) && |
990 invoker.enable_relocation_packing) { | 990 invoker.enable_relocation_packing) { |
991 _enable_relocation_packing = relocation_packing_supported | 991 _enable_relocation_packing = relocation_packing_supported |
992 assert(_use_chromium_linker, "Relocation packing requires use of the" + | 992 assert(_use_chromium_linker, "Relocation packing requires use of the" + |
993 " Chromium linker.") | 993 " Chromium linker.") |
994 } | 994 } |
995 | 995 |
996 _native_libs = invoker.native_libs | 996 _native_libs = process_file_template( |
| 997 invoker.native_libs, |
| 998 "$root_build_dir/lib.stripped/{{source_file_part}}") |
| 999 |
997 _native_libs_dir = base_path + "/libs" | 1000 _native_libs_dir = base_path + "/libs" |
998 | 1001 |
999 if (_use_chromium_linker) { | 1002 if (_use_chromium_linker) { |
1000 _native_libs += [ | 1003 _native_libs += [ |
1001 "$root_build_dir/lib.stripped/libchromium_android_linker.so" | 1004 "$root_build_dir/lib.stripped/libchromium_android_linker.so" |
1002 ] | 1005 ] |
1003 } | 1006 } |
1004 | 1007 |
1005 _enable_relocation_packing = false | 1008 _enable_relocation_packing = false |
1006 if (_use_chromium_linker && defined(invoker.enable_relocation_packing) && | 1009 if (_use_chromium_linker && defined(invoker.enable_relocation_packing) && |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 # Declare an Android gtest apk | 1216 # Declare an Android gtest apk |
1214 # | 1217 # |
1215 # This target creates an Android apk for running gtest-based unittests. | 1218 # This target creates an Android apk for running gtest-based unittests. |
1216 # | 1219 # |
1217 # Variables | 1220 # Variables |
1218 # deps: Specifies the dependencies of this target. These will be passed to | 1221 # deps: Specifies the dependencies of this target. These will be passed to |
1219 # the underlying android_apk invocation and should include the java and | 1222 # the underlying android_apk invocation and should include the java and |
1220 # resource dependencies of the apk. | 1223 # resource dependencies of the apk. |
1221 # unittests_dep: This should be the label of the gtest native target. This | 1224 # unittests_dep: This should be the label of the gtest native target. This |
1222 # target must be defined previously in the same file. | 1225 # target must be defined previously in the same file. |
1223 # unittests_binary: The name of the binary produced by the unittests_dep | 1226 # unittests_binary: The basename of the library produced by the unittests_dep |
1224 # target, relative to the root build directory. If unspecified, it assumes | 1227 # target. If unspecified, it assumes the name of the unittests_dep target |
1225 # the name of the unittests_dep target (which will be correct unless that | 1228 # (which will be correct unless that target specifies an "output_name". |
1226 # target specifies an "output_name". | |
1227 # TODO(brettw) make this automatic by allowing get_target_outputs to | 1229 # TODO(brettw) make this automatic by allowing get_target_outputs to |
1228 # support executables. | 1230 # support executables. |
1229 # | 1231 # |
1230 # Example | 1232 # Example |
1231 # unittest_apk("foo_unittests_apk") { | 1233 # unittest_apk("foo_unittests_apk") { |
1232 # deps = [ ":foo_java", ":foo_resources" ] | 1234 # deps = [ ":foo_java", ":foo_resources" ] |
1233 # unittests_dep = ":foo_unittests" | 1235 # unittests_dep = ":foo_unittests" |
1234 # } | 1236 # } |
1235 template("unittest_apk") { | 1237 template("unittest_apk") { |
1236 testonly = true | 1238 testonly = true |
1237 | 1239 |
1238 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") | 1240 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") |
1239 | 1241 |
1240 test_suite_name = get_label_info(invoker.unittests_dep, "name") | 1242 test_suite_name = get_label_info(invoker.unittests_dep, "name") |
1241 | 1243 |
1242 if (defined(invoker.unittests_binary)) { | 1244 if (defined(invoker.unittests_binary)) { |
1243 unittests_binary = root_out_dir + "/" + invoker.unittests_binary | 1245 unittests_binary = invoker.unittests_binary |
1244 } else { | 1246 } else { |
1245 unittests_binary = root_out_dir + "/lib.stripped/lib" + test_suite_name + ".
so" | 1247 unittests_binary = "lib" + test_suite_name + ".so" |
1246 } | 1248 } |
1247 | 1249 |
1248 android_apk(target_name) { | 1250 android_apk(target_name) { |
1249 _apk_name = test_suite_name | 1251 _apk_name = test_suite_name |
1250 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" | 1252 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" |
1251 java_files = [ | 1253 java_files = [ |
1252 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" | 1254 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java" |
1253 ] | 1255 ] |
1254 android_manifest = "//testing/android/java/AndroidManifest.xml" | 1256 android_manifest = "//testing/android/java/AndroidManifest.xml" |
1255 unittests_outputs = [ unittests_binary ] | 1257 native_libs = [ unittests_binary ] |
1256 native_libs = [unittests_outputs[0]] | |
1257 deps = [ "//base:base_java" ] | 1258 deps = [ "//base:base_java" ] |
1258 if (defined(invoker.deps)) { | 1259 if (defined(invoker.deps)) { |
1259 deps += invoker.deps | 1260 deps += invoker.deps |
1260 } | 1261 } |
1261 datadeps = [ | 1262 datadeps = [ |
1262 "//tools/android/forwarder2", | 1263 "//tools/android/forwarder2", |
1263 "//tools/android/md5sum", | 1264 "//tools/android/md5sum", |
1264 ] | 1265 ] |
1265 } | 1266 } |
1266 } | 1267 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 } | 1470 } |
1470 | 1471 |
1471 # TODO(GYP): implement this. | 1472 # TODO(GYP): implement this. |
1472 template("uiautomator_test") { | 1473 template("uiautomator_test") { |
1473 if (defined(invoker.testonly)) { testonly = invoker.testonly } | 1474 if (defined(invoker.testonly)) { testonly = invoker.testonly } |
1474 assert(target_name != "") | 1475 assert(target_name != "") |
1475 assert(invoker.deps != [] || true) | 1476 assert(invoker.deps != [] || true) |
1476 group(target_name) { | 1477 group(target_name) { |
1477 } | 1478 } |
1478 } | 1479 } |
OLD | NEW |