• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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# BUILD rules for https://github.com/google/auto
16
17load("@rules_java//java:defs.bzl", "java_library", "java_plugin")
18
19package(default_visibility = ["//:src"])
20
21alias(
22    name = "common",
23    actual = "@maven//:com_google_auto_auto_common",
24)
25
26java_plugin(
27    name = "auto_value_processor",
28    processor_class = "com.google.auto.value.processor.AutoValueProcessor",
29    deps = [
30        ":common",
31        ":service",
32        "//third_party/java/guava",
33        "@maven//:com_google_auto_value_auto_value",
34    ],
35)
36
37java_plugin(
38    name = "auto_annotation_processor",
39    processor_class = "com.google.auto.value.processor.AutoAnnotationProcessor",
40    visibility = ["//visibility:private"],
41    deps = [
42        ":common",
43        ":service",
44        "//third_party/java/guava",
45        "@maven//:com_google_auto_value_auto_value",
46    ],
47)
48
49java_plugin(
50    name = "auto_oneof_processor",
51    processor_class = "com.google.auto.value.processor.AutoOneOfProcessor",
52    visibility = ["//visibility:private"],
53    deps = [
54        ":common",
55        ":service",
56        "//third_party/java/guava",
57        "@maven//:com_google_auto_value_auto_value",
58    ],
59)
60
61java_library(
62    name = "value",
63    exported_plugins = [
64        ":auto_annotation_processor",
65        ":auto_oneof_processor",
66        ":auto_value_processor",
67    ],
68    tags = ["maven:compile_only"],
69    exports = [
70        "//third_party/java/error_prone:annotations",
71        "@maven//:com_google_auto_value_auto_value_annotations",
72    ],
73)
74
75java_plugin(
76    name = "auto_factory_processor",
77    generates_api = 1,
78    processor_class = "com.google.auto.factory.processor.AutoFactoryProcessor",
79    visibility = ["//visibility:private"],
80    deps = [
81        ":common",
82        ":service",
83        "//third_party/java/google_java_format",
84        "//third_party/java/guava",
85        "//third_party/java/javapoet",
86        "@maven//:com_google_auto_factory_auto_factory",
87    ],
88)
89
90java_library(
91    name = "factory",
92    exported_plugins = [":auto_factory_processor"],
93    exports = ["@maven//:com_google_auto_factory_auto_factory"],
94)
95
96java_plugin(
97    name = "auto_service_processor",
98    processor_class = "com.google.auto.service.processor.AutoServiceProcessor",
99    visibility = ["//visibility:private"],
100    deps = [
101        ":common",
102        "//third_party/java/guava",
103        "@maven//:com_google_auto_service_auto_service",
104        "@maven//:com_google_auto_service_auto_service_annotations",
105    ],
106)
107
108java_library(
109    name = "service",
110    exported_plugins = [":auto_service_processor"],
111    tags = ["maven:compile_only"],
112    exports = ["@maven//:com_google_auto_service_auto_service_annotations"],
113)
114