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

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: 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 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 } 1508 }
1509 1509
1510 group(target_name) { 1510 group(target_name) {
1511 deps = final_deps 1511 deps = final_deps
1512 if (defined(invoker.datadeps)) { 1512 if (defined(invoker.datadeps)) {
1513 datadeps = invoker.datadeps 1513 datadeps = invoker.datadeps
1514 } 1514 }
1515 } 1515 }
1516 } 1516 }
1517 1517
1518 # Declare an Android instrumentation test apk
1519 #
1520 # This target creates an Android instrumentation test apk.
1521 #
1522 # Variables
1523 # android_manifest: Path to AndroidManifest.xml.
1524 # datadeps: List of dependencies needed at runtime. These will be built but
1525 # won't change the generated .apk in any way (in fact they may be built
1526 # after the .apk is).
1527 # deps: List of dependencies. All Android java resources and libraries in the
1528 # "transitive closure" of these dependencies will be included in the apk.
1529 # Note: this "transitive closure" actually only includes such targets if
1530 # they are depended on through android_library or android_resources targets
1531 # (and so not through builtin targets like 'action', 'group', etc).
1532 # java_files: List of .java files to include in the apk.
1533 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars
1534 # will be added to java_files and be included in this apk.
1535 # apk_name: Name for final apk.
1536 # final_apk_path: Path to final built apk. Default is
1537 # $root_out_dir/apks/$apk_name.apk. Setting this will override apk_name.
1538 # native_libs: List paths of native libraries to include in this apk. If these
1539 # libraries depend on other shared_library targets, those dependencies will
1540 # also be included in the apk.
1541 # apk_under_test: The apk being tested.
1542 # isolate_file: Isolate file containing the list of test data dependencies.
1543 #
1544 # DEPRECATED_java_in_dir: Directory containing java files. All .java files in
1545 # this directory will be included in the library. This is only supported to
1546 # ease the gyp->gn conversion and will be removed in the future.
1547 #
1548 # Example
1549 # instrumentation_test_apk("foo_test_apk") {
1550 # android_manifest = "AndroidManifest.xml"
1551 # apk_name = "FooTest"
1552 # apk_under_test = "Foo"
1553 # java_files = [
1554 # "android/org/chromium/foo/FooTestCase.java",
1555 # "android/org/chromium/foo/FooExampleTest.java",
1556 # ]
1557 # deps = [
1558 # ":foo_test_support_java"
1559 # ]
1560 # }
1561 template("instrumentation_test_apk") {
jbudorick 2015/05/15 13:19:57 What was the reasoning behind adding this?
mikecase (-- gone --) 2015/05/18 17:39:03 There wasn't a clear way to determine which tests
jbudorick 2015/05/18 18:20:23 sgtm
1562 set_sources_assignment_filter([])
1563 testonly = true
1564 _template_name = target_name
1565
1566 if (defined(invoker.apk_name)) {
1567 test_runner_datadep = [ ":${_template_name}__test_runner_script" ]
1568 test_runner_script("${_template_name}__test_runner_script") {
1569 test_type = "instrumentation"
1570 test_apk = invoker.apk_name
1571 if (defined(invoker.isolate_file)) {
1572 isolate_file = invoker.isolate_file
1573 }
1574 }
1575 }
1576
1577 android_apk(target_name) {
1578 if (defined(invoker.android_manifest)) {
1579 android_manifest = invoker.android_manifest
1580 }
1581 datadeps = [
1582 "//testing/android/driver:driver_apk",
1583 "//tools/android/forwarder2",
1584 "//tools/android/md5sum",
1585 ]
1586 if (defined(test_runner_datadep)) {
1587 datadeps += test_runner_datadep
1588 }
1589 if (defined(invoker.datadeps)) {
1590 datadeps += invoker.datadeps
1591 }
1592 deps = [
1593 "//testing/android/broker:broker_java",
1594 ]
1595 if (defined(invoker.deps)) {
1596 deps += invoker.deps
1597 }
1598 if (defined(invoker.java_files)) {
1599 java_files = invoker.java_files
1600 }
1601 if (defined(invoker.srcjar_deps)) {
1602 srcjar_deps = invoker.srcjar_deps
1603 }
1604 if (defined(invoker.apk_name)) {
1605 apk_name = invoker.apk_name
1606 }
1607 if (defined(invoker.final_apk_path)) {
1608 final_apk_path = invoker.final_apk_path
1609 }
1610 if (defined(invoker.native_libs)) {
1611 native_libs = invoker.native_libs
1612 }
1613 if (defined(invoker.apk_under_test)) {
1614 apk_under_test = invoker.apk_under_test
1615 }
1616 if (defined(invoker.DEPRECATED_java_in_dir)) {
1617 DEPRECATED_java_in_dir = invoker.DEPRECATED_java_in_dir
1618 }
1619 }
1620 }
1621
1518 # Declare an Android gtest apk 1622 # Declare an Android gtest apk
1519 # 1623 #
1520 # This target creates an Android apk for running gtest-based unittests. 1624 # This target creates an Android apk for running gtest-based unittests.
1521 # 1625 #
1522 # Variables 1626 # Variables
1523 # deps: Specifies the dependencies of this target. These will be passed to 1627 # deps: Specifies the dependencies of this target. These will be passed to
1524 # the underlying android_apk invocation and should include the java and 1628 # the underlying android_apk invocation and should include the java and
1525 # resource dependencies of the apk. 1629 # resource dependencies of the apk.
1526 # unittests_dep: This should be the label of the gtest native target. This 1630 # unittests_dep: This should be the label of the gtest native target. This
1527 # target must be defined previously in the same file. 1631 # target must be defined previously in the same file.
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 template("uiautomator_test") { 1917 template("uiautomator_test") {
1814 set_sources_assignment_filter([]) 1918 set_sources_assignment_filter([])
1815 if (defined(invoker.testonly)) { 1919 if (defined(invoker.testonly)) {
1816 testonly = invoker.testonly 1920 testonly = invoker.testonly
1817 } 1921 }
1818 assert(target_name != "") 1922 assert(target_name != "")
1819 assert(invoker.deps != [] || true) 1923 assert(invoker.deps != [] || true)
1820 group(target_name) { 1924 group(target_name) {
1821 } 1925 }
1822 } 1926 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698