Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: build/config/android/rules.gni

Issue 1120883002: [Android] Generate scripts at build time to run android tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed jbudorick's nits. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 } 1512 }
1513 1513
1514 group(target_name) { 1514 group(target_name) {
1515 deps = final_deps 1515 deps = final_deps
1516 if (defined(invoker.datadeps)) { 1516 if (defined(invoker.datadeps)) {
1517 datadeps = invoker.datadeps 1517 datadeps = invoker.datadeps
1518 } 1518 }
1519 } 1519 }
1520 } 1520 }
1521 1521
1522 # Declare an Android instrumentation test apk
1523 #
1524 # This target creates an Android instrumentation test apk.
1525 #
1526 # Variables
1527 # android_manifest: Path to AndroidManifest.xml.
1528 # datadeps: List of dependencies needed at runtime. These will be built but
1529 # won't change the generated .apk in any way (in fact they may be built
1530 # after the .apk is).
1531 # deps: List of dependencies. All Android java resources and libraries in the
1532 # "transitive closure" of these dependencies will be included in the apk.
1533 # Note: this "transitive closure" actually only includes such targets if
1534 # they are depended on through android_library or android_resources targets
1535 # (and so not through builtin targets like 'action', 'group', etc).
1536 # java_files: List of .java files to include in the apk.
1537 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
1538 # will be added to java_files and be included in this apk.
1539 # apk_name: Name for final apk.
1540 # final_apk_path: Path to final built apk. Default is
1541 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name.
1542 # native_libs: List paths of native libraries to include in this apk. If these
1543 # libraries depend on other shared_library targets, those dependencies will
1544 # also be included in the apk.
1545 # apk_under_test: The apk being tested.
1546 # isolate_file: Isolate file containing the list of test data dependencies.
1547 #
1548 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in
1549 # this directory will be included in the library. This is only supported to
1550 # ease the gyp->gn conversion and will be removed in the future.
1551 #
1552 # Example
1553 # instrumentation_test_apk("foo_test_apk") {
1554 # android_manifest = "AndroidManifest.xml"
1555 # apk_name = "FooTest"
1556 # apk_under_test = "Foo"
1557 # java_files = [
1558 # "android/org/chromium/foo/FooTestCase.java",
1559 # "android/org/chromium/foo/FooExampleTest.java",
1560 # ]
1561 # deps = [
1562 # ":foo_test_support_java"
1563 # ]
1564 # }
1565 template("instrumentation_test_apk") {
1566 set_sources_assignment_filter([])
1567 testonly = true
1568 _template_name = target_name
1569
1570 if (defined(invoker.apk_name)) {
1571 test_runner_datadep = [ ":${_template_name}__test_runner_script" ]
1572 test_runner_script("${_template_name}__test_runner_script") {
1573 test_type = "instrumentation"
1574 test_apk = invoker.apk_name
1575 if (defined(invoker.isolate_file)) {
1576 isolate_file = invoker.isolate_file
1577 }
1578 }
1579 }
1580
1581 android_apk(target_name) {
1582 if (defined(invoker.android_manifest)) {
1583 android_manifest = invoker.android_manifest
1584 }
1585 datadeps = [
1586 "//testing/android/driver:driver_apk",
1587 "//tools/android/forwarder2",
1588 "//tools/android/md5sum",
1589 ]
1590 if (defined(test_runner_datadep)) {
1591 datadeps += test_runner_datadep
1592 }
1593 if (defined(invoker.datadeps)) {
1594 datadeps += invoker.datadeps
1595 }
1596 deps = [
1597 "//testing/android/broker:broker_java",
1598 ]
1599 if (defined(invoker.deps)) {
1600 deps += invoker.deps
1601 }
1602 if (defined(invoker.java_files)) {
1603 java_files = invoker.java_files
1604 }
1605 if (defined(invoker.srcjar_deps)) {
1606 srcjar_deps = invoker.srcjar_deps
1607 }
1608 if (defined(invoker.apk_name)) {
1609 apk_name = invoker.apk_name
1610 }
1611 if (defined(invoker.final_apk_path)) {
1612 final_apk_path = invoker.final_apk_path
1613 }
1614 if (defined(invoker.native_libs)) {
1615 native_libs = invoker.native_libs
1616 }
1617 if (defined(invoker.apk_under_test)) {
1618 apk_under_test = invoker.apk_under_test
1619 }
1620 if (defined(invoker.DEPRECATED_java_in_dir)) {
1621 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
1622 }
1623 }
1624 }
1625
1522 # Declare an Android gtest apk 1626 # Declare an Android gtest apk
1523 # 1627 #
1524 # This target creates an Android apk for running gtest-based unittests. 1628 # This target creates an Android apk for running gtest-based unittests.
1525 # 1629 #
1526 # Variables 1630 # Variables
1527 # deps: Specifies the dependencies of this target. These will be passed to 1631 # deps: Specifies the dependencies of this target. These will be passed to
1528 # the underlying android_apk invocation and should include the java and 1632 # the underlying android_apk invocation and should include the java and
1529 # resource dependencies of the apk. 1633 # resource dependencies of the apk.
1530 # unittests_dep: This should be the label of the gtest native target. This 1634 # unittests_dep: This should be the label of the gtest native target. This
1531 # target must be defined previously in the same file. 1635 # target must be defined previously in the same file.
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 template("uiautomator_test") { 1923 template("uiautomator_test") {
1820 set_sources_assignment_filter([]) 1924 set_sources_assignment_filter([])
1821 if (defined(invoker.testonly)) { 1925 if (defined(invoker.testonly)) {
1822 testonly = invoker.testonly 1926 testonly = invoker.testonly
1823 } 1927 }
1824 assert(target_name != "") 1928 assert(target_name != "")
1825 assert(invoker.deps != [] || true) 1929 assert(invoker.deps != [] || true)
1826 group(target_name) { 1930 group(target_name) {
1827 } 1931 }
1828 } 1932 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698