1package(default_visibility = ["//visibility:public"])
2
3licenses(["notice"])  # MIT
4
5filegroup(
6    name = "jni_src",
7    srcs = ["decoder_jni.cc"],
8)
9
10java_library(
11    name = "dec",
12    srcs = glob(
13        ["*.java"],
14        exclude = ["*Test*.java"],
15    ),
16    resource_jars = ["//:license"],
17)
18
19java_library(
20    name = "test_lib",
21    testonly = 1,
22    srcs = glob(["*Test*.java"]),
23    deps = [
24        ":dec",
25        "//org/brotli/integration:brotli_jni_test_base",
26        "//org/brotli/integration:bundle_helper",
27        "@junit_junit//jar",
28    ],
29)
30
31filegroup(
32    name = "brotli_jni",
33    srcs = ["//:brotli_jni.dll"],
34)
35
36filegroup(
37    name = "test_bundle",
38    srcs = ["//org/brotli/integration:test_data"],
39)
40
41java_test(
42    name = "BrotliDecoderChannelTest",
43    size = "large",
44    data = [
45        ":brotli_jni",  # Bazel JNI workaround
46        ":test_bundle",
47    ],
48    jvm_flags = [
49        "-DBROTLI_JNI_LIBRARY=$(location :brotli_jni)",
50        "-DTEST_BUNDLE=$(location :test_bundle)",
51    ],
52    test_class = "org.brotli.wrapper.dec.BrotliDecoderChannelTest",
53    runtime_deps = [":test_lib"],
54)
55
56java_test(
57    name = "BrotliInputStreamTest",
58    size = "large",
59    data = [
60        ":brotli_jni",  # Bazel JNI workaround
61        ":test_bundle",
62    ],
63    jvm_flags = [
64        "-DBROTLI_JNI_LIBRARY=$(location :brotli_jni)",
65        "-DTEST_BUNDLE=$(location :test_bundle)",
66    ],
67    test_class = "org.brotli.wrapper.dec.BrotliInputStreamTest",
68    runtime_deps = [":test_lib"],
69)
70
71java_test(
72    name = "DecoderTest",
73    size = "large",
74    data = [
75        ":brotli_jni",  # Bazel JNI workaround
76        ":test_bundle",
77    ],
78    jvm_flags = [
79        "-DBROTLI_JNI_LIBRARY=$(location :brotli_jni)",
80        "-DTEST_BUNDLE=$(location :test_bundle)",
81    ],
82    test_class = "org.brotli.wrapper.dec.DecoderTest",
83    runtime_deps = [":test_lib"],
84)
85