aboutsummaryrefslogtreecommitdiff
path: root/test/rules/android_local_test/BUILD
blob: 590a523a12a639477b7f44973fd52744ba97885a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
load("//rules:rules.bzl", "android_local_test")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(":java_launcher_integration_test.bzl", "android_local_test_launcher_integration_test_suite")
load(":java_launcher_test.bzl", "android_local_test_launcher_test_suite")

package(
    default_applicable_licenses = ["//:license"],
    default_visibility = ["//visibility:public"],
)

licenses(["notice"])

exports_files([
    "EmptyTest.java",
    "integration_test_stub_script.sh",
])

bzl_library(
    name = "bzl",
    srcs = glob(["*.bzl"]),
    visibility = ["//visibility:private"],
)

android_local_test(
    name = "sample_test_default_launcher",
    srcs = ["EmptyTest.java"],
    custom_package = "com.google.android.emptytest",
    test_class = "com.google.android.emptytest.EmptyTest",
    deps = [
        "@robolectric//bazel:android-all",
        "@rules_android_maven//:androidx_test_ext_junit",
        "@rules_android_maven//:junit_junit",
    ],
)

android_local_test(
    name = "sample_test_default_launcher_integration",
    srcs = ["EmptyTest.java"],
    custom_package = "com.google.android.emptytest",
    test_class = "com.google.android.emptytest.EmptyTest",
    deps = [
        "@robolectric//bazel:android-all",
        "@rules_android_maven//:androidx_test_ext_junit",
        "@rules_android_maven//:junit_junit",
    ],
)

config_setting(
    name = "jdk17",
    values = {
        "java_runtime_version": "17",
    },
)

android_local_test_launcher_test_suite(
    name = "android_local_test_launcher_tests",
    expected_executable = select({
        ":jdk17": "../remotejdk17_linux/bin/java",
        "//conditions:default": "third_party/java/jdk/jdk-sts-k8/bin/java",
    }),
)

android_local_test_launcher_integration_test_suite(
    name = "android_local_test_launcher_integration_tests",
    expected_executable = select({
        ":jdk17": "rules_android/../remotejdk17_linux/bin/java",
        "//conditions:default": "rules_android/third_party/java/jdk/jdk-sts-k8/bin/java",
    }),
)