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

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

Issue 1233453010: GN: Fix support errorprone and java_binary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn12
Patch Set: Add errorprone target only for OS=android Created 5 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/javac.py ('k') | build/config/android/rules.gni » ('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("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 6
7 assert(is_android) 7 assert(is_android)
8 8
9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir)
10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir)
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 _jar_path = _base_path + ".jar" 831 _jar_path = _base_path + ".jar"
832 _build_config = _base_path + ".build_config" 832 _build_config = _base_path + ".build_config"
833 833
834 if (_supports_android) { 834 if (_supports_android) {
835 _dex_path = _base_path + ".dex.jar" 835 _dex_path = _base_path + ".dex.jar"
836 } 836 }
837 _deps = [] 837 _deps = []
838 if (defined(invoker.deps)) { 838 if (defined(invoker.deps)) {
839 _deps = invoker.deps 839 _deps = invoker.deps
840 } 840 }
841 _jar_deps = []
842 if (defined(invoker.jar_dep)) {
843 _jar_deps = [ invoker.jar_dep ]
844 }
841 845
842 _template_name = target_name 846 _template_name = target_name
843 847
844 build_config_target_name = "${_template_name}__build_config" 848 build_config_target_name = "${_template_name}__build_config"
845 process_jar_target_name = "${_template_name}__process_jar" 849 process_jar_target_name = "${_template_name}__process_jar"
846 if (_supports_android) { 850 if (_supports_android) {
847 dex_target_name = "${_template_name}__dex" 851 dex_target_name = "${_template_name}__dex"
848 } 852 }
849 853
850 write_build_config(build_config_target_name) { 854 write_build_config(build_config_target_name) {
(...skipping 18 matching lines...) Expand all
869 873
870 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { 874 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) {
871 proguard_preprocess = true 875 proguard_preprocess = true
872 proguard_config = invoker.proguard_config 876 proguard_config = invoker.proguard_config
873 } 877 }
874 878
875 build_config = _build_config 879 build_config = _build_config
876 input_jar_path = invoker.jar_path 880 input_jar_path = invoker.jar_path
877 output_jar_path = _jar_path 881 output_jar_path = _jar_path
878 882
879 deps = [ ":$build_config_target_name" ] + _deps 883 deps = [ ":$build_config_target_name" ] + _deps + _jar_deps
880 } 884 }
881 885
882 if (_supports_android) { 886 if (_supports_android) {
883 dex(dex_target_name) { 887 dex(dex_target_name) {
884 sources = [ 888 sources = [
885 _jar_path, 889 _jar_path,
886 ] 890 ]
887 output = _dex_path 891 output = _dex_path
888 deps = [ 892 deps = [ ":$process_jar_target_name" ] + _deps + _jar_deps
889 ":$process_jar_target_name",
890 ]
891 } 893 }
892 } 894 }
893 895
894 group(target_name) { 896 group(target_name) {
895 deps = [ 897 deps = [
896 ":$process_jar_target_name", 898 ":$process_jar_target_name",
897 ] 899 ]
898 if (defined(invoker.data_deps)) { 900 if (defined(invoker.data_deps)) {
899 data_deps = invoker.data_deps 901 data_deps = invoker.data_deps
900 } 902 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 _jar_excluded_patterns = [] 940 _jar_excluded_patterns = []
939 if (defined(invoker.jar_excluded_patterns)) { 941 if (defined(invoker.jar_excluded_patterns)) {
940 _jar_excluded_patterns += invoker.jar_excluded_patterns 942 _jar_excluded_patterns += invoker.jar_excluded_patterns
941 } 943 }
942 944
943 _chromium_code = false 945 _chromium_code = false
944 if (defined(invoker.chromium_code)) { 946 if (defined(invoker.chromium_code)) {
945 _chromium_code = invoker.chromium_code 947 _chromium_code = invoker.chromium_code
946 } 948 }
947 949
950 _supports_android = true
951 if (defined(invoker.supports_android)) {
952 _supports_android = invoker.supports_android
953 }
954
948 _enable_errorprone = use_errorprone_java_compiler 955 _enable_errorprone = use_errorprone_java_compiler
949 if (defined(invoker.enable_errorprone)) { 956 if (defined(invoker.enable_errorprone)) {
950 _enable_errorprone = invoker.enable_errorprone 957 _enable_errorprone = invoker.enable_errorprone
951 } 958 }
952 959
953 _manifest_entries = [] 960 _manifest_entries = []
954 if (defined(invoker.manifest_entries)) { 961 if (defined(invoker.manifest_entries)) {
955 _manifest_entries = invoker.manifest_entries 962 _manifest_entries = invoker.manifest_entries
956 } 963 }
957 964
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 } 1001 }
995 1002
996 outputs = [ 1003 outputs = [
997 depfile, 1004 depfile,
998 _intermediate_jar_path, 1005 _intermediate_jar_path,
999 _intermediate_jar_path + ".md5.stamp", 1006 _intermediate_jar_path + ".md5.stamp",
1000 ] 1007 ]
1001 sources = _java_files + _java_srcjars 1008 sources = _java_files + _java_srcjars
1002 inputs = _system_jars + [ _build_config ] 1009 inputs = _system_jars + [ _build_config ]
1003 1010
1004 _rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
1005 _rebased_system_jars = rebase_path(_system_jars, root_build_dir) 1011 _rebased_system_jars = rebase_path(_system_jars, root_build_dir)
1006 _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir) 1012 _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir)
1007 _rebased_depfile = rebase_path(depfile, root_build_dir) 1013 _rebased_depfile = rebase_path(depfile, root_build_dir)
1008 args = [ 1014 args = [
1009 "--depfile=$_rebased_depfile", 1015 "--depfile=$_rebased_depfile",
1010 "--bootclasspath=$_rebased_android_sdk_jar",
1011 "--classpath=$_rebased_system_jars", 1016 "--classpath=$_rebased_system_jars",
1012 "--classpath=@FileArg($_rebased_build_config:javac:classpath)", 1017 "--classpath=@FileArg($_rebased_build_config:javac:classpath)",
1013 "--jar-path=$_rebased_jar_path", 1018 "--jar-path=$_rebased_jar_path",
1014 "--java-srcjars=$_rebased_java_srcjars", 1019 "--java-srcjars=$_rebased_java_srcjars",
1015 "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)", 1020 "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)",
1016 "--jar-excluded-classes=$_jar_excluded_patterns", 1021 "--jar-excluded-classes=$_jar_excluded_patterns",
1017 ] 1022 ]
1023 if (_supports_android) {
1024 _rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
1025 args += [ "--bootclasspath=$_rebased_android_sdk_jar" ]
1026 }
1018 foreach(e, _manifest_entries) { 1027 foreach(e, _manifest_entries) {
1019 args += [ "--manifest-entry=" + e ] 1028 args += [ "--manifest-entry=" + e ]
1020 } 1029 }
1021 if (_chromium_code) { 1030 if (_chromium_code) {
1022 args += [ "--chromium-code=1" ] 1031 args += [ "--chromium-code=1" ]
1023 } 1032 }
1024 if (_enable_errorprone) { 1033 if (_enable_errorprone) {
1025 deps += [ "//third_party/errorprone:chromium_errorprone" ] 1034 deps += [ "//third_party/errorprone:chromium_errorprone" ]
1026 args += [ 1035 args += [
1027 "--use-errorprone-path", 1036 "--use-errorprone-path",
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1171 compile_java(_compile_java_target) { 1180 compile_java(_compile_java_target) {
1172 jar_path = _jar_path 1181 jar_path = _jar_path
1173 build_config = _build_config 1182 build_config = _build_config
1174 java_files = _java_files 1183 java_files = _java_files
1175 srcjar_deps = _srcjar_deps 1184 srcjar_deps = _srcjar_deps
1176 srcjars = _srcjars 1185 srcjars = _srcjars
1177 chromium_code = _chromium_code 1186 chromium_code = _chromium_code
1178 android = _requires_android 1187 android = _requires_android
1179 1188
1180 if (defined(invoker.enable_errorprone)) { 1189 if (defined(invoker.enable_errorprone)) {
1181 _enable_errorprone = invoker.enable_errorprone 1190 enable_errorprone = invoker.enable_errorprone
1182 } 1191 }
1183 if (defined(invoker.jar_excluded_patterns)) { 1192 if (defined(invoker.jar_excluded_patterns)) {
1184 jar_excluded_patterns = invoker.jar_excluded_patterns 1193 jar_excluded_patterns = invoker.jar_excluded_patterns
1185 } 1194 }
1186 if (defined(invoker.proguard_preprocess)) { 1195 if (defined(invoker.proguard_preprocess)) {
1187 proguard_preprocess = invoker.proguard_preprocess 1196 proguard_preprocess = invoker.proguard_preprocess
1188 } 1197 }
1189 if (defined(invoker.proguard_config)) { 1198 if (defined(invoker.proguard_config)) {
1190 proguard_config = invoker.proguard_config 1199 proguard_config = invoker.proguard_config
1191 } 1200 }
1192 if (defined(invoker.dist_jar_path)) { 1201 if (defined(invoker.dist_jar_path)) {
1193 dist_jar_path = invoker.dist_jar_path 1202 dist_jar_path = invoker.dist_jar_path
1194 } 1203 }
1195 if (defined(invoker.manifest_entries)) { 1204 if (defined(invoker.manifest_entries)) {
1196 manifest_entries = invoker.manifest_entries 1205 manifest_entries = invoker.manifest_entries
1197 } 1206 }
1198 1207
1208 supports_android = _supports_android
1199 deps = build_config_deps 1209 deps = build_config_deps
1200 } 1210 }
1201 1211
1202 if (defined(invoker.main_class)) { 1212 if (defined(invoker.main_class)) {
1203 _final_deps += [ ":${_template_name}__binary_script" ] 1213 _final_deps += [ ":${_template_name}__binary_script" ]
1204 action("${_template_name}__binary_script") { 1214 action("${_template_name}__binary_script") {
1205 script = "//build/android/gyp/create_java_binary_script.py" 1215 script = "//build/android/gyp/create_java_binary_script.py"
1206 depfile = "$target_gen_dir/$target_name.d" 1216 depfile = "$target_gen_dir/$target_name.d"
1207 java_script = "$root_build_dir/bin/$_template_name" 1217 java_script = "$root_build_dir/bin/$_template_name"
1208 inputs = [ 1218 inputs = [
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 ] 1581 ]
1572 args = [ 1582 args = [
1573 "--depfile", 1583 "--depfile",
1574 rebase_path(depfile, root_build_dir), 1584 rebase_path(depfile, root_build_dir),
1575 "--script-output-path", 1585 "--script-output-path",
1576 rebase_path(generated_script, root_build_dir), 1586 rebase_path(generated_script, root_build_dir),
1577 ] 1587 ]
1578 args += test_runner_args 1588 args += test_runner_args
1579 } 1589 }
1580 } 1590 }
OLDNEW
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698