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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 # deps: Specifies the dependencies of this target. These will be passed to | 1421 # deps: Specifies the dependencies of this target. These will be passed to |
1422 # the underlying android_apk invocation and should include the java and | 1422 # the underlying android_apk invocation and should include the java and |
1423 # resource dependencies of the apk. | 1423 # resource dependencies of the apk. |
1424 # unittests_dep: This should be the label of the gtest native target. This | 1424 # unittests_dep: This should be the label of the gtest native target. This |
1425 # target must be defined previously in the same file. | 1425 # target must be defined previously in the same file. |
1426 # unittests_binary: The basename of the library produced by the unittests_dep | 1426 # unittests_binary: The basename of the library produced by the unittests_dep |
1427 # target. If unspecified, it assumes the name of the unittests_dep target | 1427 # target. If unspecified, it assumes the name of the unittests_dep target |
1428 # (which will be correct unless that target specifies an "output_name". | 1428 # (which will be correct unless that target specifies an "output_name". |
1429 # TODO(brettw) make this automatic by allowing get_target_outputs to | 1429 # TODO(brettw) make this automatic by allowing get_target_outputs to |
1430 # support executables. | 1430 # support executables. |
| 1431 # apk_name: The name of the produced apk. If unspecified, it uses the name |
| 1432 # of the unittests_dep target postfixed with "_apk" |
1431 # | 1433 # |
1432 # Example | 1434 # Example |
1433 # unittest_apk("foo_unittests_apk") { | 1435 # unittest_apk("foo_unittests_apk") { |
1434 # deps = [ ":foo_java", ":foo_resources" ] | 1436 # deps = [ ":foo_java", ":foo_resources" ] |
1435 # unittests_dep = ":foo_unittests" | 1437 # unittests_dep = ":foo_unittests" |
1436 # } | 1438 # } |
1437 template("unittest_apk") { | 1439 template("unittest_apk") { |
1438 testonly = true | 1440 testonly = true |
1439 | 1441 |
1440 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") | 1442 assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name") |
1441 | 1443 |
1442 test_suite_name = get_label_info(invoker.unittests_dep, "name") | 1444 test_suite_name = get_label_info(invoker.unittests_dep, "name") |
1443 | 1445 |
| 1446 # This trivial assert is needed in case both unittests_binary and apk_name |
| 1447 # are defined, as otherwise test_suite_name would not be used. |
| 1448 assert(test_suite_name != "") |
| 1449 |
1444 if (defined(invoker.unittests_binary)) { | 1450 if (defined(invoker.unittests_binary)) { |
1445 unittests_binary = invoker.unittests_binary | 1451 unittests_binary = invoker.unittests_binary |
1446 } else { | 1452 } else { |
1447 unittests_binary = "lib" + test_suite_name + ".so" | 1453 unittests_binary = "lib" + test_suite_name + ".so" |
1448 } | 1454 } |
1449 | 1455 |
| 1456 if (defined(invoker.apk_name)) { |
| 1457 apk_name = invoker.apk_name |
| 1458 } else { |
| 1459 apk_name = test_suite_name |
| 1460 } |
| 1461 |
1450 android_apk(target_name) { | 1462 android_apk(target_name) { |
1451 _apk_name = test_suite_name | 1463 _apk_name = apk_name |
1452 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" | 1464 final_apk_path = "$root_build_dir/${_apk_name}_apk/${_apk_name}-debug.apk" |
1453 java_files = [ "//testing/android/java/src/org/chromium/native_test/ChromeNa
tiveTestActivity.java" ] | 1465 java_files = [ |
| 1466 "//testing/android/java/src/org/chromium/native_test/ChromeNativeTestActiv
ity.java", |
| 1467 "//testing/android/java/src/org/chromium/native_test/ChromiumNativeTestIns
trumentationTestRunner.java", |
| 1468 ] |
1454 android_manifest = "//testing/android/java/AndroidManifest.xml" | 1469 android_manifest = "//testing/android/java/AndroidManifest.xml" |
1455 native_libs = [ unittests_binary ] | 1470 native_libs = [ unittests_binary ] |
1456 if (defined(invoker.asset_location)) { | 1471 if (defined(invoker.asset_location)) { |
1457 asset_location = invoker.asset_location | 1472 asset_location = invoker.asset_location |
1458 } | 1473 } |
1459 deps = [ | 1474 deps = [ |
1460 "//base:base_java", | 1475 "//base:base_java", |
| 1476 "//build/android/pylib/remote/device/dummy:remote_device_dummy_apk", |
1461 ] | 1477 ] |
1462 if (defined(invoker.deps)) { | 1478 if (defined(invoker.deps)) { |
1463 deps += invoker.deps | 1479 deps += invoker.deps |
1464 } | 1480 } |
1465 datadeps = [ | 1481 datadeps = [ |
1466 "//tools/android/forwarder2", | 1482 "//tools/android/forwarder2", |
1467 "//tools/android/md5sum", | 1483 "//tools/android/md5sum", |
1468 ] | 1484 ] |
1469 if (defined(invoker.datadeps)) { | 1485 if (defined(invoker.datadeps)) { |
1470 datadeps += invoker.datadeps | 1486 datadeps += invoker.datadeps |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 # TODO(GYP): implement this. | 1706 # TODO(GYP): implement this. |
1691 template("uiautomator_test") { | 1707 template("uiautomator_test") { |
1692 if (defined(invoker.testonly)) { | 1708 if (defined(invoker.testonly)) { |
1693 testonly = invoker.testonly | 1709 testonly = invoker.testonly |
1694 } | 1710 } |
1695 assert(target_name != "") | 1711 assert(target_name != "") |
1696 assert(invoker.deps != [] || true) | 1712 assert(invoker.deps != [] || true) |
1697 group(target_name) { | 1713 group(target_name) { |
1698 } | 1714 } |
1699 } | 1715 } |
OLD | NEW |