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 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/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
10 import("//third_party/android_platform/config.gni") | 10 import("//third_party/android_platform/config.gni") |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 # | 925 # |
926 # chromium_code: If true, extra analysis warning/errors will be enabled. | 926 # chromium_code: If true, extra analysis warning/errors will be enabled. |
927 # | 927 # |
928 # Example | 928 # Example |
929 # junit_binary("foo") { | 929 # junit_binary("foo") { |
930 # java_files = [ "org/chromium/foo/FooTest.java" ] | 930 # java_files = [ "org/chromium/foo/FooTest.java" ] |
931 # deps = [ ":bar_java" ] | 931 # deps = [ ":bar_java" ] |
932 # } | 932 # } |
933 template("junit_binary") { | 933 template("junit_binary") { |
934 set_sources_assignment_filter([]) | 934 set_sources_assignment_filter([]) |
| 935 testonly = true |
935 | 936 |
936 java_binary(target_name) { | 937 _java_binary_target_name = "${target_name}__java_binary" |
| 938 _test_runner_target_name = "${target_name}__test_runner_script" |
| 939 |
| 940 test_runner_script(_test_runner_target_name) { |
| 941 test_name = invoker.target_name |
| 942 test_suite = invoker.target_name |
| 943 test_type = "junit" |
| 944 } |
| 945 |
| 946 java_binary(_java_binary_target_name) { |
937 deps = [] | 947 deps = [] |
| 948 jar_name = invoker.target_name |
938 forward_variables_from(invoker, "*") | 949 forward_variables_from(invoker, "*") |
| 950 testonly = true |
939 bypass_platform_checks = true | 951 bypass_platform_checks = true |
940 main_class = "org.chromium.testing.local.JunitTestMain" | 952 main_class = "org.chromium.testing.local.JunitTestMain" |
941 wrapper_script_args = [ | 953 wrapper_script_name = "$target_name" |
942 "-test-jars", | |
943 "$target_name.jar", | |
944 ] | |
945 testonly = true | |
946 | 954 |
947 deps += [ | 955 deps += [ |
948 "//testing/android/junit:junit_test_support", | 956 "//testing/android/junit:junit_test_support", |
949 "//third_party/junit", | 957 "//third_party/junit", |
950 "//third_party/mockito:mockito_java", | 958 "//third_party/mockito:mockito_java", |
951 "//third_party/robolectric:android-all-4.3_r2-robolectric-0", | 959 "//third_party/robolectric:android-all-4.3_r2-robolectric-0", |
952 "//third_party/robolectric:robolectric_java", | 960 "//third_party/robolectric:robolectric_java", |
953 ] | 961 ] |
954 } | 962 } |
| 963 group(target_name) { |
| 964 public_deps = [ |
| 965 ":$_java_binary_target_name", |
| 966 ":$_test_runner_target_name", |
| 967 ] |
| 968 } |
955 } | 969 } |
956 | 970 |
957 # Declare a java library target | 971 # Declare a java library target |
958 # | 972 # |
959 # Variables | 973 # Variables |
960 # deps: Specifies the dependencies of this target. Java targets in this list | 974 # deps: Specifies the dependencies of this target. Java targets in this list |
961 # will be added to the javac classpath. | 975 # will be added to the javac classpath. |
962 # | 976 # |
963 # java_files: List of .java files included in this library. | 977 # java_files: List of .java files included in this library. |
964 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars | 978 # srcjar_deps: List of srcjar dependencies. The .java files in the srcjars |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 } | 2298 } |
2285 | 2299 |
2286 android_library(target_name) { | 2300 android_library(target_name) { |
2287 java_files = [] | 2301 java_files = [] |
2288 srcjar_deps = [ ":${_template_name}__protoc_java" ] | 2302 srcjar_deps = [ ":${_template_name}__protoc_java" ] |
2289 deps = [ | 2303 deps = [ |
2290 "//third_party/android_protobuf:protobuf_nano_javalib", | 2304 "//third_party/android_protobuf:protobuf_nano_javalib", |
2291 ] | 2305 ] |
2292 } | 2306 } |
2293 } | 2307 } |
OLD | NEW |