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

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

Issue 1462363002: [Android] Make generated test scripts pass apk paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | build/java_apk.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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("//build/toolchain/toolchain.gni") 8 import("//build/toolchain/toolchain.gni")
9 import("//third_party/android_platform/config.gni") 9 import("//third_party/android_platform/config.gni")
10 import("//tools/grit/grit_rule.gni") 10 import("//tools/grit/grit_rule.gni")
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 wrapper_script_args = [ 931 wrapper_script_args = [
932 "-test-jars", 932 "-test-jars",
933 "$target_name.jar", 933 "$target_name.jar",
934 ] 934 ]
935 testonly = true 935 testonly = true
936 936
937 deps += [ 937 deps += [
938 "//testing/android/junit:junit_test_support", 938 "//testing/android/junit:junit_test_support",
939 "//third_party/junit", 939 "//third_party/junit",
940 "//third_party/mockito:mockito_java", 940 "//third_party/mockito:mockito_java",
941 "//third_party/robolectric:android-all-4.3_r2-robolectric-0",
941 "//third_party/robolectric:robolectric_java", 942 "//third_party/robolectric:robolectric_java",
942 "//third_party/robolectric:android-all-4.3_r2-robolectric-0",
943 ] 943 ]
944 } 944 }
945 } 945 }
946 946
947 # Declare a java library target 947 # Declare a java library target
948 # 948 #
949 # Variables 949 # Variables
950 # deps: Specifies the dependencies of this target. Java targets in this list 950 # deps: Specifies the dependencies of this target. Java targets in this list
951 # will be added to the javac classpath. 951 # will be added to the javac classpath.
952 # 952 #
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 if (_proguard_enabled) { 1364 if (_proguard_enabled) {
1365 _proguard_jar_path = "$base_path.proguard.jar" 1365 _proguard_jar_path = "$base_path.proguard.jar"
1366 } 1366 }
1367 1367
1368 build_config_target = "${_template_name}__build_config" 1368 build_config_target = "${_template_name}__build_config"
1369 write_build_config(build_config_target) { 1369 write_build_config(build_config_target) {
1370 forward_variables_from(invoker, [ "apk_under_test" ]) 1370 forward_variables_from(invoker, [ "apk_under_test" ])
1371 type = "android_apk" 1371 type = "android_apk"
1372 jar_path = _jar_path 1372 jar_path = _jar_path
1373 dex_path = final_dex_path 1373 dex_path = final_dex_path
1374 apk_path = _final_apk_path
1374 resources_zip = resources_zip_path 1375 resources_zip = resources_zip_path
1375 build_config = _build_config 1376 build_config = _build_config
1376 android_manifest = _android_manifest 1377 android_manifest = _android_manifest
1377 1378
1378 deps = _chromium_linker_dep + _android_manifest_deps 1379 deps = _chromium_linker_dep + _android_manifest_deps
1379 if (defined(invoker.deps)) { 1380 if (defined(invoker.deps)) {
1380 deps += invoker.deps 1381 deps += invoker.deps
1381 } 1382 }
1382 1383
1383 proguard_enabled = _proguard_enabled 1384 proguard_enabled = _proguard_enabled
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 1521
1521 if (_proguard_enabled) { 1522 if (_proguard_enabled) {
1522 _proguard_configs = [ _generated_proguard_config ] 1523 _proguard_configs = [ _generated_proguard_config ]
1523 if (defined(invoker.proguard_configs)) { 1524 if (defined(invoker.proguard_configs)) {
1524 _proguard_configs += invoker.proguard_configs 1525 _proguard_configs += invoker.proguard_configs
1525 } 1526 }
1526 _proguard_target = "${_template_name}__proguard" 1527 _proguard_target = "${_template_name}__proguard"
1527 proguard(_proguard_target) { 1528 proguard(_proguard_target) {
1528 deps = [ 1529 deps = [
1529 ":$build_config_target", 1530 ":$build_config_target",
1531 ":$java_target",
1530 ":$process_resources_target", 1532 ":$process_resources_target",
1531 ":$java_target",
1532 ] 1533 ]
1533 inputs = [ 1534 inputs = [
1534 _build_config, 1535 _build_config,
1535 _jar_path, 1536 _jar_path,
1536 ] + _proguard_configs 1537 ] + _proguard_configs
1537 1538
1538 output_jar_path = _proguard_jar_path 1539 output_jar_path = _proguard_jar_path
1539 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir) 1540 rebased_proguard_configs = rebase_path(_proguard_configs, root_build_dir)
1540 args = [ 1541 args = [
1541 "--proguard-configs=$rebased_proguard_configs", 1542 "--proguard-configs=$rebased_proguard_configs",
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 1702
1702 version_code = _version_code 1703 version_code = _version_code
1703 version_name = _version_name 1704 version_name = _version_name
1704 1705
1705 keystore_name = _keystore_name 1706 keystore_name = _keystore_name
1706 keystore_path = _keystore_path 1707 keystore_path = _keystore_path
1707 keystore_password = _keystore_password 1708 keystore_password = _keystore_password
1708 1709
1709 native_libs_dir = _native_libs_dir 1710 native_libs_dir = _native_libs_dir
1710 deps = [ 1711 deps = [
1712 ":${_manifest_rule}",
1711 ":${_prepare_native_target_name}", 1713 ":${_prepare_native_target_name}",
1712 ":${_manifest_rule}",
1713 ] 1714 ]
1714 incremental_deps = deps 1715 incremental_deps = deps
1715 } 1716 }
1716 } 1717 }
1717 1718
1718 _create_incremental_script_rule_name = "${_template_name}__incremental_script" 1719 _create_incremental_script_rule_name = "${_template_name}__incremental_script"
1719 action(_create_incremental_script_rule_name) { 1720 action(_create_incremental_script_rule_name) {
1720 script = "//build/android/incremental_install/create_install_script.py" 1721 script = "//build/android/incremental_install/create_install_script.py"
1721 depfile = "$target_gen_dir/$target_name.d" 1722 depfile = "$target_gen_dir/$target_name.d"
1722 deps = [ 1723 deps = [
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 data_deps = [] 1764 data_deps = []
1764 forward_variables_from(invoker, [ "data_deps" ]) 1765 forward_variables_from(invoker, [ "data_deps" ])
1765 1766
1766 # device/commands is used by the installer script to push files via .zip. 1767 # device/commands is used by the installer script to push files via .zip.
1767 data_deps += [ "//build/android/pylib/device/commands" ] 1768 data_deps += [ "//build/android/pylib/device/commands" ]
1768 1769
1769 # Since the _incremental.apk does not include use .so nor .dex from the 1770 # Since the _incremental.apk does not include use .so nor .dex from the
1770 # actual target, but instead loads them at runtime, we need to explicitly 1771 # actual target, but instead loads them at runtime, we need to explicitly
1771 # depend on them here. 1772 # depend on them here.
1772 public_deps = [ 1773 public_deps = [
1774 ":${_create_incremental_script_rule_name}",
1773 ":${_template_name}__create_incremental", 1775 ":${_template_name}__create_incremental",
1774 ":${_create_incremental_script_rule_name}",
1775 ":${java_target}", 1776 ":${java_target}",
1776 ] 1777 ]
1777 if (_native_libs != []) { 1778 if (_native_libs != []) {
1778 public_deps += [ ":$_prepare_native_target_name" ] 1779 public_deps += [ ":$_prepare_native_target_name" ]
1779 } 1780 }
1780 } 1781 }
1781 } 1782 }
1782 1783
1783 # Declare an Android instrumentation test apk 1784 # Declare an Android instrumentation test apk
1784 # 1785 #
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 # apk_under_test = "Foo" 1818 # apk_under_test = "Foo"
1818 # java_files = [ 1819 # java_files = [
1819 # "android/org/chromium/foo/FooTestCase.java", 1820 # "android/org/chromium/foo/FooTestCase.java",
1820 # "android/org/chromium/foo/FooExampleTest.java", 1821 # "android/org/chromium/foo/FooExampleTest.java",
1821 # ] 1822 # ]
1822 # deps = [ 1823 # deps = [
1823 # ":foo_test_support_java" 1824 # ":foo_test_support_java"
1824 # ] 1825 # ]
1825 # } 1826 # }
1826 template("instrumentation_test_apk") { 1827 template("instrumentation_test_apk") {
1827 set_sources_assignment_filter([])
1828 testonly = true 1828 testonly = true
1829 _template_name = target_name 1829 _apk_target_name = "${target_name}__apk"
1830 _test_runner_target_name = "${target_name}__test_runner_script"
1830 1831
1831 if (defined(invoker.apk_name)) { 1832 test_runner_script(_test_runner_target_name) {
1832 test_runner_data_dep = [ ":${_template_name}__test_runner_script" ] 1833 forward_variables_from(invoker, [ "isolate_file" ])
1833 test_runner_script("${_template_name}__test_runner_script") { 1834 test_name = invoker.target_name
1834 forward_variables_from(invoker, [ "isolate_file" ]) 1835 test_type = "instrumentation"
1835 test_name = invoker.target_name 1836 apk_target = ":$_apk_target_name"
1836 test_type = "instrumentation"
1837 test_apk = invoker.apk_name
1838 }
1839 } 1837 }
1840 1838
1841 android_apk(target_name) { 1839 android_apk(_apk_target_name) {
1842 deps = [] 1840 deps = []
1843 data_deps = [] 1841 data_deps = []
1844 forward_variables_from(invoker, "*") 1842 forward_variables_from(invoker, "*")
1843 deps += [ "//testing/android/broker:broker_java" ]
1845 data_deps += [ 1844 data_deps += [
1846 "//testing/android/driver:driver_apk", 1845 "//testing/android/driver:driver_apk",
1847 "//tools/android/forwarder2", 1846 "//tools/android/forwarder2",
1848 "//tools/android/md5sum", 1847 "//tools/android/md5sum",
1849 ] 1848 ]
1850 if (defined(test_runner_data_dep)) {
1851 data_deps += test_runner_data_dep
1852 }
1853 deps += [ "//testing/android/broker:broker_java" ]
1854 run_findbugs = false 1849 run_findbugs = false
1855 } 1850 }
1851
1852 group(target_name) {
1853 public_deps = [
1854 ":$_apk_target_name",
1855 ":$_test_runner_target_name",
1856 ]
1857 }
1856 } 1858 }
1857 1859
1858 # Declare an Android gtest apk 1860 # Declare an Android gtest apk
1859 # 1861 #
1860 # This target creates an Android apk for running gtest-based unittests. 1862 # This target creates an Android apk for running gtest-based unittests.
1861 # 1863 #
1862 # Variables 1864 # Variables
1863 # deps: Specifies the dependencies of this target. These will be passed to 1865 # deps: Specifies the dependencies of this target. These will be passed to
1864 # the underlying android_apk invocation and should include the java and 1866 # the underlying android_apk invocation and should include the java and
1865 # resource dependencies of the apk. 1867 # resource dependencies of the apk.
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 } 2171 }
2170 2172
2171 android_library(target_name) { 2173 android_library(target_name) {
2172 java_files = [] 2174 java_files = []
2173 srcjar_deps = [ ":${_template_name}__protoc_java" ] 2175 srcjar_deps = [ ":${_template_name}__protoc_java" ]
2174 deps = [ 2176 deps = [
2175 "//third_party/android_protobuf:protobuf_nano_javalib", 2177 "//third_party/android_protobuf:protobuf_nano_javalib",
2176 ] 2178 ]
2177 } 2179 }
2178 } 2180 }
OLDNEW
« no previous file with comments | « build/config/android/internal_rules.gni ('k') | build/java_apk.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698