1# Copyright (C) 2019 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#   Sources related to compiler options.
17
18load("@rules_java//java:defs.bzl", "java_library")
19
20package(default_visibility = ["//:src"])
21
22SHARED_SOURCES = [
23    "ClearableCache.java",
24    "MoreAnnotationMirrors.java",
25    "MoreAnnotationValues.java",
26]
27
28java_library(
29    name = "base",
30    srcs = glob(
31        ["*.java"],
32        exclude = SHARED_SOURCES,
33    ),
34    plugins = ["//java/dagger/internal/codegen/bootstrap"],
35    tags = ["maven:merged"],
36    exports = [":shared"],
37    deps = [
38        ":shared",
39        "//java/dagger:core",
40        "//java/dagger/internal/codegen/extension",
41        "//java/dagger/internal/codegen/javapoet",
42        "//java/dagger/internal/codegen/langmodel",
43        "//java/dagger/internal/guava:base",
44        "//java/dagger/internal/guava:collect",
45        "//java/dagger/internal/guava:concurrent",
46        "//java/dagger/producers",
47        "//java/dagger/spi",
48        "@google_bazel_common//third_party/java/auto:value",
49        "@google_bazel_common//third_party/java/javapoet",
50        "@google_bazel_common//third_party/java/jsr330_inject",
51        "@maven//:com_google_auto_auto_common",
52    ],
53)
54
55# TODO(bcorso): Remove this target but first remove spi and producers from :base
56java_library(
57    name = "shared",
58    srcs = SHARED_SOURCES,
59    tags = ["maven:merged"],
60    deps = [
61        "//java/dagger/internal/codegen/extension",
62        "//java/dagger/internal/guava:base",
63        "//java/dagger/internal/guava:collect",
64        "@maven//:com_google_auto_auto_common",
65    ],
66)
67