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 # Do not add any imports to non-//build directories here. | 5 # Do not add any imports to non-//build directories here. |
6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. | 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. |
7 import("//build_overrides/build.gni") | 7 import("//build_overrides/build.gni") |
8 import("//build/config/android/config.gni") | 8 import("//build/config/android/config.gni") |
9 import("//build/config/sanitizers/sanitizers.gni") | 9 import("//build/config/sanitizers/sanitizers.gni") |
10 | 10 |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1008 | 1008 |
1009 template("process_java_prebuilt") { | 1009 template("process_java_prebuilt") { |
1010 set_sources_assignment_filter([]) | 1010 set_sources_assignment_filter([]) |
1011 forward_variables_from(invoker, [ "testonly" ]) | 1011 forward_variables_from(invoker, [ "testonly" ]) |
1012 | 1012 |
1013 assert(invoker.build_config != "") | 1013 assert(invoker.build_config != "") |
1014 _build_config = invoker.build_config | 1014 _build_config = invoker.build_config |
1015 _rebased_build_config = rebase_path(_build_config, root_build_dir) | 1015 _rebased_build_config = rebase_path(_build_config, root_build_dir) |
1016 assert(_rebased_build_config != "" || true) # Mark used. | 1016 assert(_rebased_build_config != "" || true) # Mark used. |
1017 | 1017 |
1018 _input_jar_path = invoker.input_jar_path | |
1019 _output_jar_path = invoker.output_jar_path | |
1020 | |
1018 _proguard_preprocess = | 1021 _proguard_preprocess = |
1019 defined(invoker.proguard_preprocess) && invoker.proguard_preprocess | 1022 defined(invoker.proguard_preprocess) && invoker.proguard_preprocess |
1020 _input_jar_path = invoker.input_jar_path | |
1021 _output_jar_path = invoker.output_jar_path | |
1022 | 1023 |
1023 _jar_excluded_patterns = [] | 1024 _jar_excluded_patterns = [] |
1024 if (defined(invoker.jar_excluded_patterns)) { | 1025 if (defined(invoker.jar_excluded_patterns)) { |
1025 _jar_excluded_patterns = invoker.jar_excluded_patterns | 1026 _jar_excluded_patterns = invoker.jar_excluded_patterns |
1026 } | 1027 } |
1027 _strip_resource_classes = defined(invoker.strip_resource_classes) && | 1028 _strip_resource_classes = defined(invoker.strip_resource_classes) && |
1028 invoker.strip_resource_classes | 1029 invoker.strip_resource_classes |
1029 _filter_jar = _jar_excluded_patterns != [] || _strip_resource_classes | 1030 _filter_jar = _jar_excluded_patterns != [] || _strip_resource_classes |
1030 | 1031 |
1032 _enable_assert = is_java_debug && defined(invoker.supports_android) && | |
agrieve
2016/11/11 21:30:47
nit: also enable when dcheck_always_on is set (thi
F
2016/11/14 18:43:44
Done.
| |
1033 invoker.supports_android | |
agrieve
2016/11/11 21:30:47
nit: you have supports_android here twice :P.
jbudorick
2016/11/11 21:50:20
defined & checking the value?
| |
1034 assert(_enable_assert || true) # Mark used. | |
1035 | |
1031 if (_filter_jar) { | 1036 if (_filter_jar) { |
1032 _filter_target = "${target_name}__filter" | 1037 _filter_target = "${target_name}__filter" |
1033 _output_jar_target = _filter_target | |
1034 } | |
1035 if (_proguard_preprocess) { | |
1036 _proguard_target = "${target_name}__proguard_process" | |
1037 _output_jar_target = _proguard_target | |
1038 } | |
1039 if (!_filter_jar && !_proguard_preprocess) { | |
1040 _copy_target = "${target_name}__copy" | |
1041 _output_jar_target = _copy_target | |
1042 } | |
1043 | 1038 |
1044 if (_filter_jar) { | 1039 _filter_jar_path = "$target_out_dir/$target_name-filtered.jar" |
1045 _filtered_jar_path = _output_jar_path | |
1046 if (_proguard_preprocess) { | |
1047 _filtered_jar_path = "$target_out_dir/$target_name-filtered.jar" | |
1048 } | |
1049 action(_filter_target) { | 1040 action(_filter_target) { |
1050 script = "//build/android/gyp/jar.py" | 1041 script = "//build/android/gyp/jar.py" |
1051 forward_variables_from(invoker, | 1042 forward_variables_from(invoker, |
1052 [ | 1043 [ |
1053 "deps", | 1044 "deps", |
1054 "public_deps", | 1045 "public_deps", |
1055 ]) | 1046 ]) |
1056 inputs = [ | 1047 inputs = [ |
1057 _build_config, | 1048 _build_config, |
1058 _input_jar_path, | 1049 _input_jar_path, |
1059 ] | 1050 ] |
1060 outputs = [ | 1051 outputs = [ |
1061 _filtered_jar_path, | 1052 _filter_jar_path, |
1062 ] | 1053 ] |
1063 args = [ | 1054 args = [ |
1064 "--input-jar", | 1055 "--input-jar", |
1065 rebase_path(_input_jar_path, root_build_dir), | 1056 rebase_path(_input_jar_path, root_build_dir), |
1066 "--jar-path", | 1057 "--jar-path", |
1067 rebase_path(_filtered_jar_path, root_build_dir), | 1058 rebase_path(_filter_jar_path, root_build_dir), |
1068 "--excluded-classes=$_jar_excluded_patterns", | 1059 "--excluded-classes=$_jar_excluded_patterns", |
1069 ] | 1060 ] |
1070 if (_strip_resource_classes) { | 1061 if (_strip_resource_classes) { |
1071 args += [ "--strip-resource-classes-for=@FileArg($_rebased_build_confi g:javac:resource_packages)" ] | 1062 args += [ "--strip-resource-classes-for=@FileArg($_rebased_build_confi g:javac:resource_packages)" ] |
1072 } | 1063 } |
1073 } | 1064 } |
1074 } | 1065 } |
1075 | 1066 |
1076 if (_proguard_preprocess) { | 1067 if (_proguard_preprocess) { |
1068 _output_jar_target = "${target_name}__proguard_process" | |
1069 _proguard_output_jar = _output_jar_path | |
1077 _proguard_config_path = invoker.proguard_preprocess_config | 1070 _proguard_config_path = invoker.proguard_preprocess_config |
1078 proguard(_proguard_target) { | 1071 proguard(_output_jar_target) { |
1079 if (_filter_jar) { | 1072 if (_filter_jar) { |
1080 _proguard_input_jar = _filtered_jar_path | 1073 _proguard_input_jar = _filter_jar_path |
1081 public_deps = [ | 1074 public_deps = [ |
1082 ":$_filter_target", | 1075 ":$_filter_target", |
1083 ] | 1076 ] |
1084 } else { | 1077 } else { |
1085 _proguard_input_jar = _input_jar_path | 1078 _proguard_input_jar = _input_jar_path |
1086 public_deps = [] | 1079 public_deps = [] |
1087 } | 1080 } |
1088 if (defined(invoker.deps)) { | 1081 if (defined(invoker.deps)) { |
1089 deps = invoker.deps | 1082 deps = invoker.deps |
1090 } | 1083 } |
1091 if (defined(invoker.public_deps)) { | 1084 if (defined(invoker.public_deps)) { |
1092 public_deps += invoker.public_deps | 1085 public_deps += invoker.public_deps |
1093 } | 1086 } |
1094 inputs = [ | 1087 inputs = [ |
1095 _build_config, | 1088 _build_config, |
1096 _proguard_config_path, | 1089 _proguard_config_path, |
1097 _proguard_input_jar, | 1090 _proguard_input_jar, |
1098 ] | 1091 ] |
1099 output_jar_path = _output_jar_path | 1092 output_jar_path = _proguard_output_jar |
1100 | 1093 |
1101 _rebased_input_paths = [ rebase_path(_input_jar_path, root_build_dir) ] | 1094 _rebased_input_paths = |
1095 [ rebase_path(_proguard_input_jar, root_build_dir) ] | |
1102 _rebased_proguard_configs = | 1096 _rebased_proguard_configs = |
1103 [ rebase_path(_proguard_config_path, root_build_dir) ] | 1097 [ rebase_path(_proguard_config_path, root_build_dir) ] |
1104 args = [ | 1098 args = [ |
1105 "--input-paths=$_rebased_input_paths", | 1099 "--input-paths=$_rebased_input_paths", |
1106 "--proguard-configs=$_rebased_proguard_configs", | 1100 "--proguard-configs=$_rebased_proguard_configs", |
1107 "--classpath=@FileArg($_rebased_build_config:javac:classpath)", | 1101 "--classpath=@FileArg($_rebased_build_config:javac:classpath)", |
1108 ] | 1102 ] |
1109 } | 1103 } |
1110 } else if (!_filter_jar) { | 1104 } else if (_enable_assert) { |
1111 copy(_copy_target) { | 1105 _output_jar_target = "${target_name}__assert" |
1112 forward_variables_from(invoker, | 1106 _assert_output_jar = _output_jar_path |
1113 [ | 1107 action(_output_jar_target) { |
jbudorick
2016/11/11 21:50:20
This should have some kind of stated dependency on
F
2016/11/14 18:43:44
Done.
| |
1114 "deps", | 1108 script = "$root_out_dir/bin/java_assertion_enabler" |
jbudorick
2016/11/11 21:50:20
I would prefer if this wasn't in $root_out_dir/bin
F
2016/11/14 18:43:44
Done.
| |
1115 "public_deps", | 1109 if (_filter_jar) { |
1116 ]) | 1110 _assert_input_jar = _filter_jar_path |
1111 public_deps = [ | |
1112 ":$_filter_target", | |
1113 ] | |
1114 } else { | |
1115 _assert_input_jar = _input_jar_path | |
1116 public_deps = [] | |
1117 } | |
1118 if (defined(invoker.deps)) { | |
1119 deps = invoker.deps | |
1120 } | |
1121 if (defined(invoker.public_deps)) { | |
1122 public_deps += invoker.public_deps | |
1123 } | |
1124 inputs = [ | |
1125 _build_config, | |
agrieve
2016/11/11 21:30:47
nit: this isn't an input and can be removed.
F
2016/11/14 18:43:44
Done.
| |
1126 _assert_input_jar, | |
1127 ] | |
1128 outputs = [ | |
1129 _assert_output_jar, | |
1130 ] | |
1131 args = [ | |
1132 rebase_path(_assert_input_jar, root_build_dir), | |
1133 rebase_path(_assert_output_jar, root_build_dir), | |
1134 ] | |
1135 } | |
1136 } else { | |
1137 _output_jar_target = "${target_name}__copy" | |
1138 copy(_output_jar_target) { | |
1139 if (_filter_jar) { | |
1140 _copy_input_jar = _filter_jar_path | |
1141 public_deps = [ | |
1142 ":$_filter_target", | |
1143 ] | |
1144 } else { | |
1145 _copy_input_jar = _input_jar_path | |
1146 public_deps = [] | |
1147 } | |
1148 if (defined(invoker.deps)) { | |
1149 deps = invoker.deps | |
1150 } | |
1151 if (defined(invoker.public_deps)) { | |
1152 public_deps += invoker.public_deps | |
1153 } | |
1117 sources = [ | 1154 sources = [ |
1118 _input_jar_path, | 1155 _copy_input_jar, |
1119 ] | 1156 ] |
1120 outputs = [ | 1157 outputs = [ |
1121 _output_jar_path, | 1158 _output_jar_path, |
1122 ] | 1159 ] |
1123 } | 1160 } |
1124 } | 1161 } |
1125 | 1162 |
1126 group(target_name) { | 1163 group(target_name) { |
1127 forward_variables_from(invoker, | 1164 forward_variables_from(invoker, |
1128 [ | 1165 [ |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1803 ]) | 1840 ]) |
1804 | 1841 |
1805 visibility = [ | 1842 visibility = [ |
1806 ":$_ijar_target_name", | 1843 ":$_ijar_target_name", |
1807 ":$_template_name", | 1844 ":$_template_name", |
1808 ] | 1845 ] |
1809 if (_supports_android) { | 1846 if (_supports_android) { |
1810 visibility += [ ":$_dex_target_name" ] | 1847 visibility += [ ":$_dex_target_name" ] |
1811 } | 1848 } |
1812 | 1849 |
1850 supports_android = _supports_android | |
1813 build_config = _build_config | 1851 build_config = _build_config |
1814 input_jar_path = invoker.jar_path | 1852 input_jar_path = invoker.jar_path |
1815 output_jar_path = _jar_path | 1853 output_jar_path = _jar_path |
1816 | 1854 |
1817 deps = [ ":$_build_config_target_name" ] + _deps + _jar_deps | 1855 deps = [ ":$_build_config_target_name" ] + _deps + _jar_deps |
1818 } | 1856 } |
1819 | 1857 |
1820 generate_interface_jar(_ijar_target_name) { | 1858 generate_interface_jar(_ijar_target_name) { |
1821 if (!defined(invoker.proguard_preprocess) || | 1859 if (!defined(invoker.proguard_preprocess) || |
1822 !invoker.proguard_preprocess) { | 1860 !invoker.proguard_preprocess) { |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2094 } | 2132 } |
2095 } | 2133 } |
2096 | 2134 |
2097 process_java_prebuilt(_process_prebuilt_target_name) { | 2135 process_java_prebuilt(_process_prebuilt_target_name) { |
2098 forward_variables_from(invoker, | 2136 forward_variables_from(invoker, |
2099 [ | 2137 [ |
2100 "jar_excluded_patterns", | 2138 "jar_excluded_patterns", |
2101 "proguard_preprocess", | 2139 "proguard_preprocess", |
2102 "proguard_preprocess_config", | 2140 "proguard_preprocess_config", |
2103 ]) | 2141 ]) |
2142 supports_android = _supports_android | |
2104 build_config = _build_config | 2143 build_config = _build_config |
2105 input_jar_path = _javac_jar_path | 2144 input_jar_path = _javac_jar_path |
2106 output_jar_path = _process_prebuilt_jar_path | 2145 output_jar_path = _process_prebuilt_jar_path |
2107 | 2146 |
2108 deps = [ | 2147 deps = [ |
2109 ":$_javac_target_name", | 2148 ":$_javac_target_name", |
2110 ] | 2149 ] |
2111 if (defined(invoker.deps)) { | 2150 if (defined(invoker.deps)) { |
2112 deps += invoker.deps | 2151 deps += invoker.deps |
2113 } | 2152 } |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2704 rebase_path(root_build_dir, root_build_dir), | 2743 rebase_path(root_build_dir, root_build_dir), |
2705 "--packed-libraries-dir", | 2744 "--packed-libraries-dir", |
2706 rebase_path(_packed_libraries_dir, root_build_dir), | 2745 rebase_path(_packed_libraries_dir, root_build_dir), |
2707 "--libraries=${invoker.libraries_filearg}", | 2746 "--libraries=${invoker.libraries_filearg}", |
2708 "--filelistjson", | 2747 "--filelistjson", |
2709 rebase_path(invoker.file_list_json, root_build_dir), | 2748 rebase_path(invoker.file_list_json, root_build_dir), |
2710 ] | 2749 ] |
2711 } | 2750 } |
2712 } | 2751 } |
2713 } | 2752 } |
OLD | NEW |