xref: /aosp_15_r20/external/dagger2/java/dagger/spi/model/BUILD (revision f585d8a307d0621d6060bd7e80091fdcbf94fe27)
1# Copyright (C) 2021 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#   Dagger's core APIs exposed for plugins
17
18load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
19
20package(default_visibility = [
21    # The dagger/spi should be the only direct dependent on this target.
22    # If you need to depend on :model, depend on dagger/spi instead so
23    # that pom files correctly pick up the spi maven dependency.
24    # TODO(bcorso): Consider if :model should have its own maven coordinates.
25    "//java/dagger/spi:__pkg__",
26])
27
28filegroup(
29    name = "model-srcs",
30    srcs = glob([
31        "*.java",
32        "*.kt",
33    ]),
34)
35
36kt_jvm_library(
37    name = "model",
38    srcs = [":model-srcs"],
39    # TODO(wanyingd): Add javacopts explicitly once kt_jvm_library supports them.
40    deps = [
41        "//java/dagger:core",
42        "//java/dagger/internal/codegen/extension",
43        "//third_party/java/auto:common",
44        "//third_party/java/auto:value",
45        "//third_party/java/error_prone:annotations",
46        "//third_party/java/guava/base",
47        "//third_party/java/guava/collect",
48        "//third_party/java/guava/graph",
49        "//third_party/java/javapoet",
50        "//third_party/java/jsr330_inject",
51        "@maven//:com_google_devtools_ksp_symbol_processing_api",
52    ],
53)
54
55# See: https://github.com/bazelbuild/rules_kotlin/issues/324
56alias(
57    name = "libmodel-src.jar",
58    actual = ":model-sources.jar",
59)
60