1# Copyright (C) 2018 The Dagger Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# Description:
16#   The Service Provider Interface for Dagger's binding graph model
17
18load("@rules_java//java:defs.bzl", "java_library")
19load(
20    "//:build_defs.bzl",
21    "DOCLINT_HTML_AND_SYNTAX",
22    "DOCLINT_REFERENCES",
23    "POM_VERSION",
24)
25load("//tools:maven.bzl", "gen_maven_artifact")
26
27package(default_visibility = ["//:src"])
28
29filegroup(
30    name = "spi-srcs",
31    srcs = glob(["*.java"]) + [
32        "//java/dagger/model:model-srcs",
33    ],
34)
35
36java_library(
37    name = "spi",
38    srcs = glob(["*.java"]),
39    javacopts = DOCLINT_HTML_AND_SYNTAX + DOCLINT_REFERENCES,
40    tags = ["maven_coordinates=com.google.dagger:dagger-spi:" + POM_VERSION],
41    exports = [
42        "//java/dagger/model",
43    ],
44    deps = [
45        "//java/dagger:core",
46        "//java/dagger/internal/guava:base",
47        "//java/dagger/internal/guava:collect",
48        "//java/dagger/model",
49        "@google_bazel_common//third_party/java/auto:value",
50        "@google_bazel_common//third_party/java/error_prone:annotations",
51        "@google_bazel_common//third_party/java/jsr330_inject",
52    ],
53)
54
55gen_maven_artifact(
56    name = "artifact",
57    artifact_coordinates = "com.google.dagger:dagger-spi:" + POM_VERSION,
58    artifact_name = "Dagger SPI",
59    artifact_target = ":spi",
60    artifact_target_libs = [
61        "//java/dagger/internal/codegen/extension",
62        "//java/dagger/model",
63    ],
64    artifact_target_maven_deps = [
65        "com.google.auto:auto-common",
66        "com.google.code.findbugs:jsr305",
67        "com.google.dagger:dagger-producers",
68        "com.google.dagger:dagger",
69        "com.google.guava:failureaccess",
70        "com.google.guava:guava",
71        "com.squareup:javapoet",
72        "javax.inject:javax.inject",
73    ],
74    javadoc_root_packages = [
75        "dagger.model",
76        "dagger.spi",
77    ],
78    javadoc_srcs = [":spi-srcs"],
79    shaded_deps = ["@maven//:com_google_auto_auto_common"],
80    shaded_rules = ["rule com.google.auto.common.** dagger.spi.shaded.auto.common.@1"],
81)
82