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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 } | 1593 } |
1594 | 1594 |
1595 group(target_name) { | 1595 group(target_name) { |
1596 deps = final_deps | 1596 deps = final_deps |
1597 if (defined(invoker.data_deps)) { | 1597 if (defined(invoker.data_deps)) { |
1598 data_deps = invoker.data_deps | 1598 data_deps = invoker.data_deps |
1599 } | 1599 } |
1600 } | 1600 } |
1601 } | 1601 } |
1602 | 1602 |
| 1603 # Declare an Android instrumentation test apk |
| 1604 # |
| 1605 # This target creates an Android instrumentation test apk. |
| 1606 # |
| 1607 # Variables |
| 1608 # android_manifest: Path to AndroidManifest.xml. |
| 1609 # data_deps: List of dependencies needed at runtime. These will be built but |
| 1610 # won't change the generated .apk in any way (in fact they may be built |
| 1611 # after the .apk is). |
| 1612 # deps: List of dependencies. All Android java resources and libraries in the |
| 1613 # "transitive closure" of these dependencies will be included in the apk. |
| 1614 # Note: this "transitive closure" actually only includes such targets if |
| 1615 # they are depended on through android_library or android_resources targets |
| 1616 # (and so not through builtin targets like 'action', 'group', etc). |
| 1617 # java_files: List of .java files to include in the apk. |
| 1618 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars |
| 1619 # will be added to java_files and be included in this apk. |
| 1620 # apk_name: Name for final apk. |
| 1621 # final_apk_path: Path to final built apk. Default is |
| 1622 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. |
| 1623 # native_libs: List paths of native libraries to include in this apk. If these |
| 1624 # libraries depend on other shared_library targets, those dependencies will |
| 1625 # also be included in the apk. |
| 1626 # apk_under_test: The apk being tested. |
| 1627 # isolate_file: Isolate file containing the list of test data dependencies. |
| 1628 # |
| 1629 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in |
| 1630 # this directory will be included in the library. This is only supported to |
| 1631 # ease the gyp->gn conversion and will be removed in the future. |
| 1632 # |
| 1633 # Example |
| 1634 # instrumentation_test_apk("foo_test_apk") { |
| 1635 # android_manifest = "AndroidManifest.xml" |
| 1636 # apk_name = "FooTest" |
| 1637 # apk_under_test = "Foo" |
| 1638 # java_files = [ |
| 1639 # "android/org/chromium/foo/FooTestCase.java", |
| 1640 # "android/org/chromium/foo/FooExampleTest.java", |
| 1641 # ] |
| 1642 # deps = [ |
| 1643 # ":foo_test_support_java" |
| 1644 # ] |
| 1645 # } |
| 1646 template("instrumentation_test_apk") { |
| 1647 set_sources_assignment_filter([]) |
| 1648 testonly = true |
| 1649 _template_name = target_name |
| 1650 |
| 1651 if (defined(invoker.apk_name)) { |
| 1652 test_runner_data_dep = [ ":${_template_name}__test_runner_script" ] |
| 1653 test_runner_script("${_template_name}__test_runner_script") { |
| 1654 test_name = invoker.target_name |
| 1655 test_type = "instrumentation" |
| 1656 test_apk = invoker.apk_name |
| 1657 if (defined(invoker.isolate_file)) { |
| 1658 isolate_file = invoker.isolate_file |
| 1659 } |
| 1660 } |
| 1661 } |
| 1662 |
| 1663 android_apk(target_name) { |
| 1664 if (defined(invoker.android_manifest)) { |
| 1665 android_manifest = invoker.android_manifest |
| 1666 } |
| 1667 data_deps = [ |
| 1668 "//testing/android/driver:driver_apk", |
| 1669 "//tools/android/forwarder2", |
| 1670 "//tools/android/md5sum", |
| 1671 ] |
| 1672 if (defined(test_runner_data_dep)) { |
| 1673 data_deps += test_runner_data_dep |
| 1674 } |
| 1675 if (defined(invoker.data_deps)) { |
| 1676 data_deps += invoker.data_deps |
| 1677 } |
| 1678 deps = [ |
| 1679 "//testing/android/broker:broker_java", |
| 1680 ] |
| 1681 if (defined(invoker.deps)) { |
| 1682 deps += invoker.deps |
| 1683 } |
| 1684 if (defined(invoker.java_files)) { |
| 1685 java_files = invoker.java_files |
| 1686 } |
| 1687 if (defined(invoker.srcjar_deps)) { |
| 1688 srcjar_deps = invoker.srcjar_deps |
| 1689 } |
| 1690 if (defined(invoker.apk_name)) { |
| 1691 apk_name = invoker.apk_name |
| 1692 } |
| 1693 if (defined(invoker.final_apk_path)) { |
| 1694 final_apk_path = invoker.final_apk_path |
| 1695 } |
| 1696 if (defined(invoker.native_libs)) { |
| 1697 native_libs = invoker.native_libs |
| 1698 } |
| 1699 if (defined(invoker.apk_under_test)) { |
| 1700 apk_under_test = invoker.apk_under_test |
| 1701 } |
| 1702 if (defined(invoker.DEPRECATED_java_in_dir)) { |
| 1703 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir |
| 1704 } |
| 1705 } |
| 1706 } |
| 1707 |
1603 # Declare an Android gtest apk | 1708 # Declare an Android gtest apk |
1604 # | 1709 # |
1605 # This target creates an Android apk for running gtest-based unittests. | 1710 # This target creates an Android apk for running gtest-based unittests. |
1606 # | 1711 # |
1607 # Variables | 1712 # Variables |
1608 # deps: Specifies the dependencies of this target. These will be passed to | 1713 # deps: Specifies the dependencies of this target. These will be passed to |
1609 # the underlying android_apk invocation and should include the java and | 1714 # the underlying android_apk invocation and should include the java and |
1610 # resource dependencies of the apk. | 1715 # resource dependencies of the apk. |
1611 # unittests_dep: This should be the label of the gtest native target. This | 1716 # unittests_dep: This should be the label of the gtest native target. This |
1612 # target must be defined previously in the same file. | 1717 # target must be defined previously in the same file. |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 template("uiautomator_test") { | 2005 template("uiautomator_test") { |
1901 set_sources_assignment_filter([]) | 2006 set_sources_assignment_filter([]) |
1902 if (defined(invoker.testonly)) { | 2007 if (defined(invoker.testonly)) { |
1903 testonly = invoker.testonly | 2008 testonly = invoker.testonly |
1904 } | 2009 } |
1905 assert(target_name != "") | 2010 assert(target_name != "") |
1906 assert(invoker.deps != [] || true) | 2011 assert(invoker.deps != [] || true) |
1907 group(target_name) { | 2012 group(target_name) { |
1908 } | 2013 } |
1909 } | 2014 } |
OLD | NEW |