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/config/android/config.gni") | 7 import("//build/config/android/config.gni") |
8 import("//build/config/android/internal_rules.gni") | 8 import("//build/config/android/internal_rules.gni") |
9 import("//build/config/compiler/compiler.gni") | 9 import("//build/config/compiler/compiler.gni") |
10 import("//build/config/dcheck_always_on.gni") | 10 import("//build/config/dcheck_always_on.gni") |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 | 891 |
892 write_build_config("${target_name}__build_config") { | 892 write_build_config("${target_name}__build_config") { |
893 type = "android_resources" | 893 type = "android_resources" |
894 } | 894 } |
895 | 895 |
896 # Put grit files into this subdirectory of target_gen_dir. | 896 # Put grit files into this subdirectory of target_gen_dir. |
897 extra_output_path = target_name + "_grit_output" | 897 extra_output_path = target_name + "_grit_output" |
898 | 898 |
899 grit_target_name = "${target_name}__grit" | 899 grit_target_name = "${target_name}__grit" |
900 grit_output_dir = "$target_gen_dir/$extra_output_path" | 900 grit_output_dir = "$target_gen_dir/$extra_output_path" |
901 | |
902 grit(grit_target_name) { | 901 grit(grit_target_name) { |
903 forward_variables_from(invoker, [ "deps" ]) | 902 forward_variables_from(invoker, [ "deps" ]) |
904 grit_flags = [ | 903 grit_flags = [ |
905 "-E", | 904 "-E", |
906 "ANDROID_JAVA_TAGGED_ONLY=false", | 905 "ANDROID_JAVA_TAGGED_ONLY=false", |
907 ] | 906 ] |
908 output_dir = grit_output_dir | 907 output_dir = grit_output_dir |
909 resource_ids = "" | 908 resource_ids = "" |
910 source = invoker.grd_file | 909 source = invoker.grd_file |
911 outputs = invoker.outputs | 910 outputs = invoker.outputs |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 # java_files = [ "org/chromium/foo/FooTest.java" ] | 1051 # java_files = [ "org/chromium/foo/FooTest.java" ] |
1053 # deps = [ ":bar_java" ] | 1052 # deps = [ ":bar_java" ] |
1054 # } | 1053 # } |
1055 template("junit_binary") { | 1054 template("junit_binary") { |
1056 set_sources_assignment_filter([]) | 1055 set_sources_assignment_filter([]) |
1057 testonly = true | 1056 testonly = true |
1058 | 1057 |
1059 _java_binary_target_name = "${target_name}__java_binary" | 1058 _java_binary_target_name = "${target_name}__java_binary" |
1060 _test_runner_target_name = "${target_name}__test_runner_script" | 1059 _test_runner_target_name = "${target_name}__test_runner_script" |
1061 | 1060 |
1062 _build_config = "$target_gen_dir/$target_name.build_config" | |
1063 _build_config_target_name = "${target_name}__build_config" | |
1064 | |
1065 write_build_config(_build_config_target_name) { | |
1066 type = "junit_binary" | |
1067 build_config = _build_config | |
1068 if (defined(invoker.deps)) { | |
1069 possible_config_deps = invoker.deps | |
1070 } | |
1071 } | |
1072 | |
1073 test_runner_script(_test_runner_target_name) { | 1061 test_runner_script(_test_runner_target_name) { |
1074 test_name = invoker.target_name | 1062 test_name = invoker.target_name |
1075 test_suite = invoker.target_name | 1063 test_suite = invoker.target_name |
1076 test_type = "junit" | 1064 test_type = "junit" |
1077 ignore_all_data_deps = true | 1065 ignore_all_data_deps = true |
1078 forward_variables_from(invoker, | |
1079 [ | |
1080 "android_manifest_path", | |
1081 "package_name", | |
1082 ]) | |
1083 } | 1066 } |
1084 | 1067 |
1085 java_binary(_java_binary_target_name) { | 1068 java_binary(_java_binary_target_name) { |
1086 deps = [] | 1069 deps = [] |
1087 output_name = invoker.target_name | 1070 output_name = invoker.target_name |
1088 forward_variables_from(invoker, "*") | 1071 forward_variables_from(invoker, "*") |
1089 testonly = true | 1072 testonly = true |
1090 bypass_platform_checks = true | 1073 bypass_platform_checks = true |
1091 main_class = "org.chromium.testing.local.JunitTestMain" | 1074 main_class = "org.chromium.testing.local.JunitTestMain" |
1092 wrapper_script_name = "helper/$target_name" | 1075 wrapper_script_name = "helper/$target_name" |
1093 deps += [ | 1076 deps += [ |
1094 "//testing/android/junit:junit_test_support", | 1077 "//testing/android/junit:junit_test_support", |
1095 "//third_party/junit", | 1078 "//third_party/junit", |
1096 "//third_party/mockito:mockito_java", | 1079 "//third_party/mockito:mockito_java", |
1097 "//third_party/robolectric:robolectric_all_java", | 1080 "//third_party/robolectric:robolectric_all_java", |
1098 ] | 1081 ] |
1099 } | 1082 } |
1100 group(target_name) { | 1083 group(target_name) { |
1101 public_deps = [ | 1084 public_deps = [ |
1102 ":$_build_config_target_name", | |
1103 ":$_java_binary_target_name", | 1085 ":$_java_binary_target_name", |
1104 ":$_test_runner_target_name", | 1086 ":$_test_runner_target_name", |
1105 ] | 1087 ] |
1106 } | 1088 } |
1107 } | 1089 } |
1108 | 1090 |
1109 # Declare a java library target | 1091 # Declare a java library target |
1110 # | 1092 # |
1111 # Variables | 1093 # Variables |
1112 # deps: Specifies the dependencies of this target. Java targets in this list | 1094 # deps: Specifies the dependencies of this target. Java targets in this list |
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2911 # because in practice they seem to contain classes required to be in the | 2893 # because in practice they seem to contain classes required to be in the |
2912 # classpath. | 2894 # classpath. |
2913 deps += _subjar_targets | 2895 deps += _subjar_targets |
2914 } | 2896 } |
2915 if (defined(_res_target_name)) { | 2897 if (defined(_res_target_name)) { |
2916 deps += [ ":$_res_target_name" ] | 2898 deps += [ ":$_res_target_name" ] |
2917 } | 2899 } |
2918 } | 2900 } |
2919 } | 2901 } |
2920 } | 2902 } |
OLD | NEW |