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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 } | 1551 } |
1552 | 1552 |
1553 group(target_name) { | 1553 group(target_name) { |
1554 deps = final_deps | 1554 deps = final_deps |
1555 if (defined(invoker.datadeps)) { | 1555 if (defined(invoker.datadeps)) { |
1556 datadeps = invoker.datadeps | 1556 datadeps = invoker.datadeps |
1557 } | 1557 } |
1558 } | 1558 } |
1559 } | 1559 } |
1560 | 1560 |
| 1561 # Declare an Android instrumentation test apk |
| 1562 # |
| 1563 # This target creates an Android instrumentation test apk. |
| 1564 # |
| 1565 # Variables |
| 1566 # android_manifest: Path to AndroidManifest.xml. |
| 1567 # datadeps: List of dependencies needed at runtime. These will be built but |
| 1568 # won't change the generated .apk in any way (in fact they may be built |
| 1569 # after the .apk is). |
| 1570 # deps: List of dependencies. All Android java resources and libraries in the |
| 1571 # "transitive closure" of these dependencies will be included in the apk. |
| 1572 # Note: this "transitive closure" actually only includes such targets if |
| 1573 # they are depended on through android_library or android_resources targets |
| 1574 # (and so not through builtin targets like 'action', 'group', etc). |
| 1575 # java_files: List of .java files to include in the apk. |
| 1576 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars |
| 1577 # will be added to java_files and be included in this apk. |
| 1578 # apk_name: Name for final apk. |
| 1579 # final_apk_path: Path to final built apk. Default is |
| 1580 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name. |
| 1581 # native_libs: List paths of native libraries to include in this apk. If these |
| 1582 # libraries depend on other shared_library targets, those dependencies will |
| 1583 # also be included in the apk. |
| 1584 # apk_under_test: The apk being tested. |
| 1585 # isolate_file: Isolate file containing the list of test data dependencies. |
| 1586 # |
| 1587 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in |
| 1588 # this directory will be included in the library. This is only supported to |
| 1589 # ease the gyp->gn conversion and will be removed in the future. |
| 1590 # |
| 1591 # Example |
| 1592 # instrumentation_test_apk("foo_test_apk") { |
| 1593 # android_manifest = "AndroidManifest.xml" |
| 1594 # apk_name = "FooTest" |
| 1595 # apk_under_test = "Foo" |
| 1596 # java_files = [ |
| 1597 # "android/org/chromium/foo/FooTestCase.java", |
| 1598 # "android/org/chromium/foo/FooExampleTest.java", |
| 1599 # ] |
| 1600 # deps = [ |
| 1601 # ":foo_test_support_java" |
| 1602 # ] |
| 1603 # } |
| 1604 template("instrumentation_test_apk") { |
| 1605 set_sources_assignment_filter([]) |
| 1606 testonly = true |
| 1607 _template_name = target_name |
| 1608 |
| 1609 if (defined(invoker.apk_name)) { |
| 1610 test_runner_datadep = [ ":${_template_name}__test_runner_script" ] |
| 1611 test_runner_script("${_template_name}__test_runner_script") { |
| 1612 test_name = invoker.target_name |
| 1613 test_type = "instrumentation" |
| 1614 test_apk = invoker.apk_name |
| 1615 if (defined(invoker.isolate_file)) { |
| 1616 isolate_file = invoker.isolate_file |
| 1617 } |
| 1618 } |
| 1619 } |
| 1620 |
| 1621 android_apk(target_name) { |
| 1622 if (defined(invoker.android_manifest)) { |
| 1623 android_manifest = invoker.android_manifest |
| 1624 } |
| 1625 datadeps = [ |
| 1626 "//testing/android/driver:driver_apk", |
| 1627 "//tools/android/forwarder2", |
| 1628 "//tools/android/md5sum", |
| 1629 ] |
| 1630 if (defined(test_runner_datadep)) { |
| 1631 datadeps += test_runner_datadep |
| 1632 } |
| 1633 if (defined(invoker.datadeps)) { |
| 1634 datadeps += invoker.datadeps |
| 1635 } |
| 1636 deps = [ |
| 1637 "//testing/android/broker:broker_java", |
| 1638 ] |
| 1639 if (defined(invoker.deps)) { |
| 1640 deps += invoker.deps |
| 1641 } |
| 1642 if (defined(invoker.java_files)) { |
| 1643 java_files = invoker.java_files |
| 1644 } |
| 1645 if (defined(invoker.srcjar_deps)) { |
| 1646 srcjar_deps = invoker.srcjar_deps |
| 1647 } |
| 1648 if (defined(invoker.apk_name)) { |
| 1649 apk_name = invoker.apk_name |
| 1650 } |
| 1651 if (defined(invoker.final_apk_path)) { |
| 1652 final_apk_path = invoker.final_apk_path |
| 1653 } |
| 1654 if (defined(invoker.native_libs)) { |
| 1655 native_libs = invoker.native_libs |
| 1656 } |
| 1657 if (defined(invoker.apk_under_test)) { |
| 1658 apk_under_test = invoker.apk_under_test |
| 1659 } |
| 1660 if (defined(invoker.DEPRECATED_java_in_dir)) { |
| 1661 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir |
| 1662 } |
| 1663 } |
| 1664 } |
| 1665 |
1561 # Declare an Android gtest apk | 1666 # Declare an Android gtest apk |
1562 # | 1667 # |
1563 # This target creates an Android apk for running gtest-based unittests. | 1668 # This target creates an Android apk for running gtest-based unittests. |
1564 # | 1669 # |
1565 # Variables | 1670 # Variables |
1566 # deps: Specifies the dependencies of this target. These will be passed to | 1671 # deps: Specifies the dependencies of this target. These will be passed to |
1567 # the underlying android_apk invocation and should include the java and | 1672 # the underlying android_apk invocation and should include the java and |
1568 # resource dependencies of the apk. | 1673 # resource dependencies of the apk. |
1569 # unittests_dep: This should be the label of the gtest native target. This | 1674 # unittests_dep: This should be the label of the gtest native target. This |
1570 # target must be defined previously in the same file. | 1675 # target must be defined previously in the same file. |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 template("uiautomator_test") { | 1963 template("uiautomator_test") { |
1859 set_sources_assignment_filter([]) | 1964 set_sources_assignment_filter([]) |
1860 if (defined(invoker.testonly)) { | 1965 if (defined(invoker.testonly)) { |
1861 testonly = invoker.testonly | 1966 testonly = invoker.testonly |
1862 } | 1967 } |
1863 assert(target_name != "") | 1968 assert(target_name != "") |
1864 assert(invoker.deps != [] || true) | 1969 assert(invoker.deps != [] || true) |
1865 group(target_name) { | 1970 group(target_name) { |
1866 } | 1971 } |
1867 } | 1972 } |
OLD | NEW |