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

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

Issue 2127013002: 🎣 Reland of Make Android .build_configs aware of prebuilts and java sources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN not knowing the list of inputs in javac and emma rules Created 4 years, 5 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
« no previous file with comments | « build/android/gyp/write_build_config.py ('k') | no next file » | 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("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/sanitizers/sanitizers.gni") 6 import("//build/config/sanitizers/sanitizers.gni")
7 7
8 assert(is_android) 8 assert(is_android)
9 9
10 # These identify targets that have .build_config files (except for android_apk, 10 # These identify targets that have .build_config files (except for android_apk,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 sources = [] 95 sources = []
96 } 96 }
97 97
98 action(target_name) { 98 action(target_name) {
99 set_sources_assignment_filter([]) 99 set_sources_assignment_filter([])
100 build_config = invoker.build_config 100 build_config = invoker.build_config
101 101
102 assert(type == "android_apk" || type == "java_library" || 102 assert(type == "android_apk" || type == "java_library" ||
103 type == "android_resources" || type == "deps_dex" || 103 type == "android_resources" || type == "deps_dex" ||
104 type == "android_assets" || type == "resource_rewriter" || 104 type == "android_assets" || type == "resource_rewriter" ||
105 type == "java_binary" || type == "group") 105 type == "java_binary" || type == "group" || type == "java_prebuilt")
106 106
107 forward_variables_from(invoker, 107 forward_variables_from(invoker,
108 [ 108 [
109 "deps", 109 "deps",
110 "testonly", 110 "testonly",
111 ]) 111 ])
112 if (!defined(deps)) { 112 if (!defined(deps)) {
113 deps = [] 113 deps = []
114 } 114 }
115 115
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 args = [ 152 args = [
153 "--type", 153 "--type",
154 type, 154 type,
155 "--depfile", 155 "--depfile",
156 rebase_path(depfile, root_build_dir), 156 rebase_path(depfile, root_build_dir),
157 "--deps-configs=$_rebased_deps_configs", 157 "--deps-configs=$_rebased_deps_configs",
158 "--build-config", 158 "--build-config",
159 rebase_path(build_config, root_build_dir), 159 rebase_path(build_config, root_build_dir),
160 ] 160 ]
161 161
162 is_java = type == "java_library" || type == "java_binary" 162 is_java = type == "java_library" || type == "java_binary" ||
163 type == "java_prebuilt"
163 is_apk = type == "android_apk" 164 is_apk = type == "android_apk"
164 is_android_assets = type == "android_assets" 165 is_android_assets = type == "android_assets"
165 is_android_resources = type == "android_resources" 166 is_android_resources = type == "android_resources"
166 is_deps_dex = type == "deps_dex" 167 is_deps_dex = type == "deps_dex"
167 is_group = type == "group" 168 is_group = type == "group"
168 169
169 supports_android = is_apk || is_android_assets || is_android_resources || 170 supports_android = is_apk || is_android_assets || is_android_resources ||
170 is_deps_dex || is_group || 171 is_deps_dex || is_group ||
171 (is_java && defined(invoker.supports_android) && 172 (is_java && defined(invoker.supports_android) &&
172 invoker.supports_android) 173 invoker.supports_android)
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 _rebased_incremental_apk_path = 308 _rebased_incremental_apk_path =
308 rebase_path(invoker.incremental_apk_path, root_build_dir) 309 rebase_path(invoker.incremental_apk_path, root_build_dir)
309 _rebased_incremental_install_script_path = 310 _rebased_incremental_install_script_path =
310 rebase_path(invoker.incremental_install_script_path, root_build_dir) 311 rebase_path(invoker.incremental_install_script_path, root_build_dir)
311 args += [ "--apk-path=$_rebased_apk_path" ] 312 args += [ "--apk-path=$_rebased_apk_path" ]
312 args += [ "--incremental-apk-path=$_rebased_incremental_apk_path" ] 313 args += [ "--incremental-apk-path=$_rebased_incremental_apk_path" ]
313 args += [ "--incremental-install-script-path=$_rebased_incremental_insta ll_script_path" ] 314 args += [ "--incremental-install-script-path=$_rebased_incremental_insta ll_script_path" ]
314 } 315 }
315 } 316 }
316 317
318 if (defined(invoker.java_sources_file)) {
319 args += [
320 "--java-sources-file",
321 rebase_path(invoker.java_sources_file, root_build_dir),
322 ]
323 }
317 if (defined(invoker.srcjar)) { 324 if (defined(invoker.srcjar)) {
318 args += [ 325 args += [
319 "--srcjar", 326 "--srcjar",
320 rebase_path(invoker.srcjar, root_build_dir), 327 rebase_path(invoker.srcjar, root_build_dir),
321 ] 328 ]
322 } 329 }
323 } 330 }
324 } 331 }
325 332
326 template("copy_ex") { 333 template("copy_ex") {
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 "data_deps", 1039 "data_deps",
1033 "visibility", 1040 "visibility",
1034 ]) 1041 ])
1035 public_deps = [ 1042 public_deps = [
1036 ":$_output_jar_target", 1043 ":$_output_jar_target",
1037 ] 1044 ]
1038 } 1045 }
1039 } 1046 }
1040 1047
1041 template("emma_instr") { 1048 template("emma_instr") {
1042 set_sources_assignment_filter([]) 1049 action(target_name) {
1043 forward_variables_from(invoker, [ "testonly" ]) 1050 forward_variables_from(invoker,
1051 [
1052 "deps",
1053 "testonly",
1054 ])
1044 1055
1045 assert(invoker.source_files != [] || true) # Mark as used
1046
1047 if (invoker.emma_instrument) {
1048 _output_jar_target = "${target_name}__process"
1049 _coverage_file = "$target_out_dir/${target_name}.em" 1056 _coverage_file = "$target_out_dir/${target_name}.em"
1050 _source_dirs_listing_file = "$target_out_dir/${target_name}_sources.txt" 1057 _source_dirs_listing_file = "$target_out_dir/${target_name}_sources.txt"
1051 _emma_jar = "${android_sdk_root}/tools/lib/emma.jar" 1058 _emma_jar = "${android_sdk_root}/tools/lib/emma.jar"
1052 _rebased_source_files = rebase_path(invoker.source_files, root_build_dir)
1053 action(_output_jar_target) {
1054 forward_variables_from(invoker, [ "deps" ])
1055 1059
1056 script = "//build/android/gyp/emma_instr.py" 1060 script = "//build/android/gyp/emma_instr.py"
1057 depfile = "${target_gen_dir}/${target_name}.d" 1061 depfile = "${target_gen_dir}/${target_name}.d"
1058 inputs = [ 1062 inputs = invoker.java_files + [
1059 _emma_jar, 1063 _emma_jar,
1060 invoker.input_jar_path, 1064 invoker.input_jar_path,
1061 ] 1065 ]
1062 outputs = [ 1066 outputs = [
1063 depfile, 1067 depfile,
1064 _coverage_file, 1068 _coverage_file,
1065 _source_dirs_listing_file, 1069 _source_dirs_listing_file,
1066 invoker.output_jar_path, 1070 invoker.output_jar_path,
1067 ] 1071 ]
1068 args = [ 1072 args = [
1069 "instrument_jar", 1073 "instrument_jar",
1070 "--input-path", 1074 "--input-path",
1071 rebase_path(invoker.input_jar_path, root_build_dir), 1075 rebase_path(invoker.input_jar_path, root_build_dir),
1072 "--output-path", 1076 "--output-path",
1073 rebase_path(invoker.output_jar_path, root_build_dir), 1077 rebase_path(invoker.output_jar_path, root_build_dir),
1074 "--depfile", 1078 "--depfile",
1075 rebase_path(depfile, root_build_dir), 1079 rebase_path(depfile, root_build_dir),
1076 "--coverage-file", 1080 "--coverage-file",
1077 rebase_path(_coverage_file, root_build_dir), 1081 rebase_path(_coverage_file, root_build_dir),
1078 "--sources-list-file", 1082 "--sources-list-file",
1079 rebase_path(_source_dirs_listing_file, root_build_dir), 1083 rebase_path(_source_dirs_listing_file, root_build_dir),
1080 "--source-files=$_rebased_source_files", 1084 "--src-root",
1081 "--src-root", 1085 rebase_path("//", root_build_dir),
1082 rebase_path("//", root_build_dir), 1086 "--emma-jar",
1083 "--emma-jar", 1087 rebase_path(_emma_jar, root_build_dir),
1084 rebase_path(_emma_jar, root_build_dir), 1088 ]
1085 ] 1089 _rebased_java_sources_file =
1090 rebase_path(invoker.java_sources_file, root_build_dir)
1091 args += [ "--java-sources-file=$_rebased_java_sources_file" ]
1086 1092
1087 if (emma_filter != "") { 1093 if (emma_filter != "") {
1088 args += [ 1094 args += [
1089 "--filter-string", 1095 "--filter-string",
1090 emma_filter, 1096 emma_filter,
1091 ]
1092 }
1093 }
1094 } else {
1095 _output_jar_target = "${target_name}__copy_jar"
1096 copy(_output_jar_target) {
1097 forward_variables_from(invoker, [ "deps" ])
1098
1099 sources = [
1100 invoker.input_jar_path,
1101 ]
1102 outputs = [
1103 invoker.output_jar_path,
1104 ] 1097 ]
1105 } 1098 }
1106 } 1099 }
1107
1108 group(target_name) {
1109 forward_variables_from(invoker, [ "visibility" ])
1110 public_deps = [
1111 ":$_output_jar_target",
1112 ]
1113 }
1114 } 1100 }
1115 1101
1116 # Creates an unsigned .apk. 1102 # Creates an unsigned .apk.
1117 # 1103 #
1118 # Variables 1104 # Variables
1119 # assets_build_config: Path to android_apk .build_config containing merged 1105 # assets_build_config: Path to android_apk .build_config containing merged
1120 # asset information. 1106 # asset information.
1121 # deps: Specifies the dependencies of this target. 1107 # deps: Specifies the dependencies of this target.
1122 # dex_path: Path to classes.dex file to include (optional). 1108 # dex_path: Path to classes.dex file to include (optional).
1123 # resource_packaged_apk_path: Path to .ap_ to use. 1109 # resource_packaged_apk_path: Path to .ap_ to use.
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 _template_name = target_name 1667 _template_name = target_name
1682 1668
1683 _build_config_target_name = "${_template_name}__build_config" 1669 _build_config_target_name = "${_template_name}__build_config"
1684 _process_jar_target_name = "${_template_name}__process_jar" 1670 _process_jar_target_name = "${_template_name}__process_jar"
1685 _ijar_target_name = "${_template_name}__ijar" 1671 _ijar_target_name = "${_template_name}__ijar"
1686 if (_supports_android) { 1672 if (_supports_android) {
1687 _dex_target_name = "${_template_name}__dex" 1673 _dex_target_name = "${_template_name}__dex"
1688 } 1674 }
1689 1675
1690 write_build_config(_build_config_target_name) { 1676 write_build_config(_build_config_target_name) {
1691 type = "java_library" 1677 type = "java_prebuilt"
1692 supports_android = _supports_android 1678 supports_android = _supports_android
1693 requires_android = 1679 requires_android =
1694 defined(invoker.requires_android) && invoker.requires_android 1680 defined(invoker.requires_android) && invoker.requires_android
1695 1681
1696 if (defined(invoker.deps)) { 1682 if (defined(invoker.deps)) {
1697 possible_config_deps = _deps 1683 possible_config_deps = _deps
1698 } 1684 }
1699 build_config = _build_config 1685 build_config = _build_config
1700 jar_path = _jar_path 1686 jar_path = _jar_path
1701 if (_supports_android) { 1687 if (_supports_android) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 } 1776 }
1791 } 1777 }
1792 1778
1793 # Compiles and jars a set of java files. 1779 # Compiles and jars a set of java files.
1794 # 1780 #
1795 # Outputs: 1781 # Outputs:
1796 # $jar_path.jar 1782 # $jar_path.jar
1797 # $jar_path.interface.jar 1783 # $jar_path.interface.jar
1798 # 1784 #
1799 # Variables 1785 # Variables
1800 # java_files: List of .java files to compile. 1786 # java_files: List of .java files to compile (same as exists in java_sources _file)
1787 # java_sources_file: Path to file containing list of files to compile.
1801 # chromium_code: If true, enable extra warnings. 1788 # chromium_code: If true, enable extra warnings.
1802 # srcjar_deps: List of srcjar dependencies. The .java files contained in the 1789 # srcjar_deps: List of srcjar dependencies. The .java files contained in the
1803 # dependencies srcjar outputs will be compiled and added to the output jar . 1790 # dependencies srcjar outputs will be compiled and added to the output jar .
1804 # jar_path: Use this to explicitly set the output jar path. Defaults to 1791 # jar_path: Use this to explicitly set the output jar path. Defaults to
1805 # "${target_gen_dir}/${target_name}.jar. 1792 # "${target_gen_dir}/${target_name}.jar.
1806 template("compile_java") { 1793 template("compile_java") {
1807 set_sources_assignment_filter([]) 1794 set_sources_assignment_filter([])
1808 forward_variables_from(invoker, [ "testonly" ]) 1795 forward_variables_from(invoker, [ "testonly" ])
1809 1796
1810 assert(defined(invoker.java_files))
1811 assert(defined(invoker.build_config)) 1797 assert(defined(invoker.build_config))
1812 assert(defined(invoker.jar_path)) 1798 assert(defined(invoker.jar_path))
1813 1799
1814 _java_files = invoker.java_files
1815 _final_jar_path = invoker.jar_path
1816 _javac_jar_path = "$target_gen_dir/$target_name.javac.jar"
1817 _process_prebuilt_jar_path =
1818 "$target_gen_dir/$target_name.process_prebuilt.jar"
1819 _final_ijar_path = get_path_info(_final_jar_path, "dir") + "/" +
1820 get_path_info(_final_jar_path, "name") + ".interface.jar"
1821
1822 _build_config = invoker.build_config 1800 _build_config = invoker.build_config
1823 1801
1824 _input_jars_paths = [] 1802 _input_jars_paths = []
1825 if (defined(invoker.input_jars_paths)) { 1803 if (defined(invoker.input_jars_paths)) {
1826 _input_jars_paths += invoker.input_jars_paths 1804 _input_jars_paths += invoker.input_jars_paths
1827 } 1805 }
1828 1806
1829 _chromium_code = false 1807 _chromium_code = false
1830 if (defined(invoker.chromium_code)) { 1808 if (defined(invoker.chromium_code)) {
1831 _chromium_code = invoker.chromium_code 1809 _chromium_code = invoker.chromium_code
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 } 1862 }
1885 foreach(dep, _srcjar_deps) { 1863 foreach(dep, _srcjar_deps) {
1886 _dep_gen_dir = get_label_info(dep, "target_gen_dir") 1864 _dep_gen_dir = get_label_info(dep, "target_gen_dir")
1887 _dep_name = get_label_info(dep, "name") 1865 _dep_name = get_label_info(dep, "name")
1888 _java_srcjars += [ "$_dep_gen_dir/$_dep_name.srcjar" ] 1866 _java_srcjars += [ "$_dep_gen_dir/$_dep_name.srcjar" ]
1889 } 1867 }
1890 1868
1891 # Mark srcjar_deps as used. 1869 # Mark srcjar_deps as used.
1892 assert(_srcjar_deps == [] || true) 1870 assert(_srcjar_deps == [] || true)
1893 1871
1872 _javac_target_name = "${target_name}__javac"
1873 _process_prebuilt_target_name = "${target_name}__process_prebuilt"
1874 _ijar_target_name = "${target_name}__ijar"
1875 _final_target_name = target_name
1876
1877 _final_jar_path = invoker.jar_path
1878 _javac_jar_path = "$target_gen_dir/$target_name.javac.jar"
1879 _process_prebuilt_jar_path = _final_jar_path
1880 _final_ijar_path = get_path_info(_final_jar_path, "dir") + "/" +
1881 get_path_info(_final_jar_path, "name") + ".interface.jar"
1882
1883 _emma_instrument = defined(invoker.emma_instrument) &&
1884 invoker.emma_instrument && invoker.java_files != []
1885 if (_emma_instrument) {
1886 _emma_instr_target_name = "${target_name}__emma_instr"
1887 _process_prebuilt_jar_path =
1888 "$target_gen_dir/$target_name.process_prebuilt.jar"
1889 }
1890
1894 _rebased_build_config = rebase_path(_build_config, root_build_dir) 1891 _rebased_build_config = rebase_path(_build_config, root_build_dir)
1895 _rebased_jar_path = rebase_path(_javac_jar_path, root_build_dir) 1892 _rebased_jar_path = rebase_path(_javac_jar_path, root_build_dir)
1896 1893
1897 _javac_target_name = "${target_name}__javac"
1898 _process_prebuilt_target_name = "${target_name}__process_prebuilt"
1899 _emma_instr_target_name = "${target_name}__emma_instr"
1900 _ijar_target_name = "${target_name}__ijar"
1901 _final_target_name = target_name
1902
1903 action(_javac_target_name) { 1894 action(_javac_target_name) {
1904 script = "//build/android/gyp/javac.py" 1895 script = "//build/android/gyp/javac.py"
1905 depfile = "$target_gen_dir/$target_name.d" 1896 depfile = "$target_gen_dir/$target_name.d"
1906 deps = _srcjar_deps 1897 deps = _srcjar_deps
1907 if (defined(invoker.deps)) { 1898 if (defined(invoker.deps)) {
1908 deps += invoker.deps 1899 deps += invoker.deps
1909 } 1900 }
1910 1901
1911 outputs = [ 1902 outputs = [
1912 depfile, 1903 depfile,
1913 _javac_jar_path, 1904 _javac_jar_path,
1914 _javac_jar_path + ".md5.stamp", 1905 _javac_jar_path + ".md5.stamp",
1915 ] 1906 ]
1916 sources = _java_files + _java_srcjars 1907 sources = invoker.java_files + _java_srcjars
1917 inputs = [ 1908 inputs = [
1918 _build_config, 1909 _build_config,
1919 ] 1910 ]
1911 if (invoker.java_files != []) {
1912 inputs += [ invoker.java_sources_file ]
1913 }
1920 1914
1921 _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir) 1915 _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir)
1922 _rebased_depfile = rebase_path(depfile, root_build_dir) 1916 _rebased_depfile = rebase_path(depfile, root_build_dir)
1923 args = [ 1917 args = [
1924 "--depfile=$_rebased_depfile", 1918 "--depfile=$_rebased_depfile",
1925 "--jar-path=$_rebased_jar_path", 1919 "--jar-path=$_rebased_jar_path",
1926 "--java-srcjars=$_rebased_java_srcjars", 1920 "--java-srcjars=$_rebased_java_srcjars",
1927 "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)", 1921 "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)",
1928 ] 1922 ]
1929 if (_enable_interface_jars_javac) { 1923 if (_enable_interface_jars_javac) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1969 } 1963 }
1970 foreach(e, _provider_configurations) { 1964 foreach(e, _provider_configurations) {
1971 args += [ "--provider-configuration=" + rebase_path(e, root_build_dir) ] 1965 args += [ "--provider-configuration=" + rebase_path(e, root_build_dir) ]
1972 } 1966 }
1973 foreach(e, _processors) { 1967 foreach(e, _processors) {
1974 args += [ "--processor=" + e ] 1968 args += [ "--processor=" + e ]
1975 } 1969 }
1976 foreach(e, _processor_args) { 1970 foreach(e, _processor_args) {
1977 args += [ "--processor-arg=" + e ] 1971 args += [ "--processor-arg=" + e ]
1978 } 1972 }
1979 args += rebase_path(_java_files, root_build_dir) 1973 if (invoker.java_files != []) {
1974 args += [ "@" + rebase_path(invoker.java_sources_file, root_build_dir) ]
1975 }
1980 } 1976 }
1981 1977
1982 process_java_prebuilt(_process_prebuilt_target_name) { 1978 process_java_prebuilt(_process_prebuilt_target_name) {
1983 forward_variables_from(invoker, [ "jar_excluded_patterns" ]) 1979 forward_variables_from(invoker, [ "jar_excluded_patterns" ])
1984 build_config = _build_config 1980 build_config = _build_config
1985 input_jar_path = _javac_jar_path 1981 input_jar_path = _javac_jar_path
1986 output_jar_path = _process_prebuilt_jar_path 1982 output_jar_path = _process_prebuilt_jar_path
1987 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { 1983 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) {
1988 proguard_preprocess = invoker.proguard_preprocess 1984 proguard_preprocess = invoker.proguard_preprocess
1989 proguard_config = invoker.proguard_config 1985 proguard_config = invoker.proguard_config
1990 } 1986 }
1991 deps = [ 1987 deps = [
1992 ":$_javac_target_name", 1988 ":$_javac_target_name",
1993 ] 1989 ]
1994 if (defined(invoker.deps)) { 1990 if (defined(invoker.deps)) {
1995 deps += invoker.deps 1991 deps += invoker.deps
1996 } 1992 }
1997 } 1993 }
1998 1994
1999 emma_instr(_emma_instr_target_name) { 1995 if (_emma_instrument) {
2000 visibility = [ 1996 emma_instr(_emma_instr_target_name) {
2001 ":$_ijar_target_name", 1997 forward_variables_from(invoker,
2002 ":$_final_target_name", 1998 [
2003 ] 1999 "java_files",
2000 "java_sources_file",
2001 ])
2004 2002
2005 forward_variables_from(invoker, [ "emma_instrument" ]) 2003 input_jar_path = _process_prebuilt_jar_path
2004 output_jar_path = _final_jar_path
2006 2005
2007 input_jar_path = _process_prebuilt_jar_path 2006 deps = [
2008 output_jar_path = _final_jar_path 2007 ":$_process_prebuilt_target_name",
2009 source_files = _java_files 2008 ]
2010 2009 }
2011 deps = [
2012 ":$_process_prebuilt_target_name",
2013 ]
2014 } 2010 }
2015 2011
2016 generate_interface_jar(_ijar_target_name) { 2012 generate_interface_jar(_ijar_target_name) {
2017 input_jar = _final_jar_path 2013 input_jar = _final_jar_path
2018 output_jar = _final_ijar_path 2014 output_jar = _final_ijar_path
2019 deps = [ 2015 if (_emma_instrument) {
2020 ":$_emma_instr_target_name", 2016 deps = [
2021 ] 2017 ":$_emma_instr_target_name",
2018 ]
2019 } else {
2020 deps = [
2021 ":$_process_prebuilt_target_name",
2022 ]
2023 }
2022 } 2024 }
2023 2025
2024 group(_final_target_name) { 2026 group(_final_target_name) {
2025 forward_variables_from(invoker, [ "visibility" ]) 2027 forward_variables_from(invoker, [ "visibility" ])
2026 public_deps = [ 2028 public_deps = [
2027 ":$_emma_instr_target_name",
2028 ":$_ijar_target_name", 2029 ":$_ijar_target_name",
2029 ] 2030 ]
2031 if (_emma_instrument) {
2032 public_deps += [ ":$_emma_instr_target_name" ]
2033 } else {
2034 public_deps += [ ":$_process_prebuilt_target_name" ]
2035 }
2030 } 2036 }
2031 } 2037 }
2032 2038
2033 template("java_library_impl") { 2039 template("java_library_impl") {
2034 set_sources_assignment_filter([]) 2040 set_sources_assignment_filter([])
2035 forward_variables_from(invoker, [ "testonly" ]) 2041 forward_variables_from(invoker, [ "testonly" ])
2036 _accumulated_deps = [] 2042 _accumulated_deps = []
2037 if (defined(invoker.deps)) { 2043 if (defined(invoker.deps)) {
2038 _accumulated_deps = invoker.deps 2044 _accumulated_deps = invoker.deps
2039 } 2045 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 assert(_emma_never_instrument || true) # Mark as used 2111 assert(_emma_never_instrument || true) # Mark as used
2106 _emma_instrument = emma_coverage && !_emma_never_instrument 2112 _emma_instrument = emma_coverage && !_emma_never_instrument
2107 2113
2108 if (_supports_android) { 2114 if (_supports_android) {
2109 _dex_path = _base_path + ".dex.jar" 2115 _dex_path = _base_path + ".dex.jar"
2110 if (defined(invoker.dex_path)) { 2116 if (defined(invoker.dex_path)) {
2111 _dex_path = invoker.dex_path 2117 _dex_path = invoker.dex_path
2112 } 2118 }
2113 } 2119 }
2114 2120
2121 _java_files = []
2122 if (defined(invoker.java_files)) {
2123 _java_files += invoker.java_files
2124 }
2125 if (_java_files != []) {
2126 _java_sources_file = "$_base_path.sources"
2127 write_file(_java_sources_file, rebase_path(_java_files, root_build_dir))
2128 }
2129
2115 # Define build_config_deps which will be a list of targets required to 2130 # Define build_config_deps which will be a list of targets required to
2116 # build the _build_config. 2131 # build the _build_config.
2117 if (defined(invoker.override_build_config)) { 2132 if (defined(invoker.override_build_config)) {
2118 _build_config = invoker.override_build_config 2133 _build_config = invoker.override_build_config
2119 } else { 2134 } else {
2120 _build_config = _base_path + ".build_config" 2135 _build_config = _base_path + ".build_config"
2121 build_config_target_name = "${_template_name}__build_config" 2136 build_config_target_name = "${_template_name}__build_config"
2122 2137
2123 write_build_config(build_config_target_name) { 2138 write_build_config(build_config_target_name) {
2124 if (defined(invoker.is_java_binary) && invoker.is_java_binary) { 2139 if (defined(invoker.is_java_binary) && invoker.is_java_binary) {
2125 type = "java_binary" 2140 type = "java_binary"
2126 } else { 2141 } else {
2127 type = "java_library" 2142 type = "java_library"
2128 } 2143 }
2129 if (defined(invoker.deps)) { 2144 if (defined(invoker.deps)) {
2130 possible_config_deps = invoker.deps 2145 possible_config_deps = invoker.deps
2131 } 2146 }
2132 supports_android = _supports_android 2147 supports_android = _supports_android
2133 requires_android = _requires_android 2148 requires_android = _requires_android
2134 bypass_platform_checks = defined(invoker.bypass_platform_checks) && 2149 bypass_platform_checks = defined(invoker.bypass_platform_checks) &&
2135 invoker.bypass_platform_checks 2150 invoker.bypass_platform_checks
2136 2151
2137 build_config = _build_config 2152 build_config = _build_config
2138 jar_path = _jar_path 2153 jar_path = _jar_path
2139 if (_supports_android) { 2154 if (_supports_android) {
2140 dex_path = _dex_path 2155 dex_path = _dex_path
2141 } 2156 }
2157 if (_java_files != []) {
2158 java_sources_file = _java_sources_file
2159 }
2142 } 2160 }
2143 _accumulated_deps += [ ":$build_config_target_name" ] 2161 _accumulated_deps += [ ":$build_config_target_name" ]
2144 } 2162 }
2145 2163
2146 _srcjar_deps = [] 2164 _srcjar_deps = []
2147 if (defined(invoker.srcjar_deps)) { 2165 if (defined(invoker.srcjar_deps)) {
2148 _srcjar_deps = invoker.srcjar_deps 2166 _srcjar_deps = invoker.srcjar_deps
2149 } 2167 }
2150 2168
2151 _srcjars = [] 2169 _srcjars = []
2152 if (defined(invoker.srcjars)) { 2170 if (defined(invoker.srcjars)) {
2153 _srcjars = invoker.srcjars 2171 _srcjars = invoker.srcjars
2154 } 2172 }
2155 2173
2156 _java_files = []
2157 if (defined(invoker.java_files)) {
2158 _java_files += invoker.java_files
2159 }
2160 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != []) 2174 assert(_java_files != [] || _srcjar_deps != [] || _srcjars != [])
2161 2175
2162 _compile_java_target = "${_template_name}__compile_java" 2176 _compile_java_target = "${_template_name}__compile_java"
2163 _final_deps += [ ":$_compile_java_target" ] 2177 _final_deps += [ ":$_compile_java_target" ]
2164 compile_java(_compile_java_target) { 2178 compile_java(_compile_java_target) {
2165 forward_variables_from(invoker, 2179 forward_variables_from(invoker,
2166 [ 2180 [
2167 "alternative_android_sdk_ijar", 2181 "alternative_android_sdk_ijar",
2168 "alternative_android_sdk_ijar_dep", 2182 "alternative_android_sdk_ijar_dep",
2169 "dist_jar_path", 2183 "dist_jar_path",
2170 "enable_errorprone", 2184 "enable_errorprone",
2171 "enable_incremental_javac_override", 2185 "enable_incremental_javac_override",
2172 "input_jars_paths", 2186 "input_jars_paths",
2173 "jar_excluded_patterns", 2187 "jar_excluded_patterns",
2174 "manifest_entries", 2188 "manifest_entries",
2175 "processors_javac", 2189 "processors_javac",
2176 "processor_args_javac", 2190 "processor_args_javac",
2177 "proguard_config", 2191 "proguard_config",
2178 "proguard_preprocess", 2192 "proguard_preprocess",
2179 "provider_configurations", 2193 "provider_configurations",
2180 ]) 2194 ])
2181 jar_path = _jar_path 2195 jar_path = _jar_path
2182 build_config = _build_config 2196 build_config = _build_config
2183 java_files = _java_files 2197 java_files = _java_files
2198 if (_java_files != []) {
2199 java_sources_file = _java_sources_file
2200 }
2184 srcjar_deps = _srcjar_deps 2201 srcjar_deps = _srcjar_deps
2185 srcjars = _srcjars 2202 srcjars = _srcjars
2186 chromium_code = _chromium_code 2203 chromium_code = _chromium_code
2187 supports_android = _supports_android 2204 supports_android = _supports_android
2188 emma_instrument = _emma_instrument 2205 emma_instrument = _emma_instrument
2189 deps = _accumulated_deps 2206 deps = _accumulated_deps
2190 } 2207 }
2191 _accumulated_deps += [ ":$_compile_java_target" ] 2208 _accumulated_deps += [ ":$_compile_java_target" ]
2192 assert(_accumulated_deps != []) # Mark used. 2209 assert(_accumulated_deps != []) # Mark used.
2193 2210
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2504 outputs = [ 2521 outputs = [
2505 depfile, 2522 depfile,
2506 invoker.out_manifest, 2523 invoker.out_manifest,
2507 ] 2524 ]
2508 inputs = [ 2525 inputs = [
2509 invoker.main_manifest, 2526 invoker.main_manifest,
2510 ] 2527 ]
2511 } 2528 }
2512 } 2529 }
2513 } 2530 }
OLDNEW
« no previous file with comments | « build/android/gyp/write_build_config.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698