load("@contrib_rules_jvm//java:defs.bzl", "spotbugs_config")
load(":defs.bzl", "artifact")

exports_files(
    srcs = [
        "CHANGELOG",
        "empty_test_template.txt",
        "java_stub_template.txt",
    ],
    visibility = [
        "//visibility:public",
    ],
)

java_plugin(
    name = "auto-service-plugin",
    processor_class = "com.google.auto.service.processor.AutoServiceProcessor",
    visibility = ["//visibility:private"],
    deps = [
        artifact("com.google.auto.service:auto-service"),
    ],
)

java_library(
    name = "auto-service",
    exported_plugins = [
        ":auto-service-plugin",
    ],
    visibility = [
        "//java:__subpackages__",
    ],
    exports = [
        artifact("com.google.auto.service:auto-service-annotations"),
    ],
)

spotbugs_config(
    name = "spotbugs-config",
    effort = "default",
    exclude_filter = "spotbugs-excludes.xml",
    fail_on_warning = True,
    visibility = [
        "//visibility:public",
    ],
)
