1# Copyright (C) 2020 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# Description:
15#   Hilt android processors.
16
17package(default_visibility = ["//:src"])
18
19java_plugin(
20    name = "plugin",
21    generates_api = 1,
22    processor_class = "dagger.hilt.android.processor.internal.androidentrypoint.AndroidEntryPointProcessor",
23    tags = [
24        "annotation=dagger.hilt.android.AndroidEntryPoint;" +
25        "genclass=${package}.Hilt_${outerclasses}${classname};" +
26        "genclass=${package}.${outerclasses}${classname}_EntryPoint",
27    ],
28    deps = [
29        ":processor_lib",
30    ],
31)
32
33java_library(
34    name = "processor_lib",
35    srcs = ["AndroidEntryPointProcessor.java"],
36    deps = [
37        ":android_generators",
38        ":compiler_options",
39        ":metadata",
40        "//java/dagger/hilt/android/processor/internal:android_classnames",
41        "//java/dagger/hilt/processor/internal:base_processor",
42        "//java/dagger/hilt/processor/internal:processors",
43        "//java/dagger/internal/guava:collect",
44        "@google_bazel_common//third_party/java/auto:service",
45        "@google_bazel_common//third_party/java/incap",
46    ],
47)
48
49java_library(
50    name = "android_generators",
51    srcs = [
52        "ActivityGenerator.java",
53        "ApplicationGenerator.java",
54        "BroadcastReceiverGenerator.java",
55        "FragmentGenerator.java",
56        "Generators.java",
57        "InjectorEntryPointGenerator.java",
58        "ServiceGenerator.java",
59        "ViewGenerator.java",
60    ],
61    deps = [
62        ":metadata",
63        "//java/dagger/hilt/android/processor/internal:android_classnames",
64        "//java/dagger/hilt/android/processor/internal:utils",
65        "//java/dagger/hilt/processor/internal:classnames",
66        "//java/dagger/hilt/processor/internal:component_names",
67        "//java/dagger/hilt/processor/internal:processor_errors",
68        "//java/dagger/hilt/processor/internal:processors",
69        "//java/dagger/internal/codegen/extension",
70        "//java/dagger/internal/codegen/langmodel",
71        "//java/dagger/internal/guava:base",
72        "//java/dagger/internal/guava:collect",
73        "@google_bazel_common//third_party/java/javapoet",
74        "@maven//:com_google_auto_auto_common",
75    ],
76)
77
78java_library(
79    name = "metadata",
80    srcs = [
81        "AndroidEntryPointMetadata.java",
82    ],
83    deps = [
84        ":compiler_options",
85        "//java/dagger/hilt/android/processor/internal:android_classnames",
86        "//java/dagger/hilt/processor/internal:classnames",
87        "//java/dagger/hilt/processor/internal:components",
88        "//java/dagger/hilt/processor/internal:kotlin",
89        "//java/dagger/hilt/processor/internal:processor_errors",
90        "//java/dagger/hilt/processor/internal:processors",
91        "//java/dagger/internal/codegen/extension",
92        "//java/dagger/internal/codegen/kotlin",
93        "//java/dagger/internal/guava:base",
94        "//java/dagger/internal/guava:collect",
95        "@google_bazel_common//third_party/java/auto:value",
96        "@google_bazel_common//third_party/java/javapoet",
97        "@maven//:com_google_auto_auto_common",
98    ],
99)
100
101java_library(
102    name = "compiler_options",
103    srcs = ["HiltCompilerOptions.java"],
104)
105
106filegroup(
107    name = "srcs_filegroup",
108    srcs = glob(["*"]),
109)
110