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 15# Description: 16# Annotation processor for Hilt. 17 18load("@rules_java//java:defs.bzl", "java_library", "java_plugin") 19 20package(default_visibility = ["//:src"]) 21 22java_plugin( 23 name = "component_tree_deps_plugin", 24 generates_api = 1, 25 processor_class = "dagger.hilt.processor.internal.root.ComponentTreeDepsProcessor", 26 deps = [ 27 ":component_tree_deps_processor_lib", 28 ], 29) 30 31java_library( 32 name = "component_tree_deps_processor_lib", 33 srcs = [ 34 "ComponentGenerator.java", 35 "ComponentTreeDepsProcessingStep.java", 36 "ComponentTreeDepsProcessor.java", 37 "EarlySingletonComponentCreatorGenerator.java", 38 "KspComponentTreeDepsProcessor.java", 39 "RootFileFormatter.java", 40 "RootGenerator.java", 41 "TestComponentDataGenerator.java", 42 ], 43 deps = [ 44 ":root_metadata", 45 "//java/dagger/hilt/android/processor/internal/androidentrypoint:android_generators", 46 "//java/dagger/hilt/android/processor/internal/androidentrypoint:metadata", 47 "//java/dagger/hilt/processor/internal:base_processor", 48 "//java/dagger/hilt/processor/internal:classnames", 49 "//java/dagger/hilt/processor/internal:compiler_options", 50 "//java/dagger/hilt/processor/internal:component_descriptor", 51 "//java/dagger/hilt/processor/internal:component_names", 52 "//java/dagger/hilt/processor/internal:processor_errors", 53 "//java/dagger/hilt/processor/internal:processors", 54 "//java/dagger/hilt/processor/internal/aggregateddeps:component_dependencies", 55 "//java/dagger/hilt/processor/internal/aliasof:alias_ofs", 56 "//java/dagger/hilt/processor/internal/definecomponent:define_components", 57 "//java/dagger/hilt/processor/internal/earlyentrypoint:aggregated_early_entry_point_metadata", 58 "//java/dagger/hilt/processor/internal/uninstallmodules:aggregated_uninstall_modules_metadata", 59 "//java/dagger/internal/codegen/extension", 60 "//java/dagger/internal/codegen/xprocessing", 61 "//third_party/java/auto:service", 62 "//third_party/java/error_prone:annotations", 63 "//third_party/java/guava/base", 64 "//third_party/java/guava/collect", 65 "//third_party/java/guava/graph", 66 "//third_party/java/incap", 67 "//third_party/java/javapoet", 68 "@maven//:com_google_devtools_ksp_symbol_processing_api", 69 ], 70) 71 72java_plugin( 73 name = "root_plugin", 74 generates_api = 1, 75 processor_class = "dagger.hilt.processor.internal.root.RootProcessor", 76 deps = [ 77 ":root_processor_lib", 78 ], 79) 80 81java_library( 82 name = "root_processor_lib", 83 srcs = [ 84 "AggregatedRootGenerator.java", 85 "ComponentTreeDepsGenerator.java", 86 "KspRootProcessor.java", 87 "ProcessedRootSentinelGenerator.java", 88 "RootProcessingStep.java", 89 "RootProcessor.java", 90 "TestInjectorGenerator.java", 91 ], 92 deps = [ 93 ":root_metadata", 94 ":root_type", 95 "//java/dagger/hilt/android/processor/internal/androidentrypoint:android_generators", 96 "//java/dagger/hilt/android/processor/internal/androidentrypoint:metadata", 97 "//java/dagger/hilt/processor/internal:aggregated_elements", 98 "//java/dagger/hilt/processor/internal:base_processor", 99 "//java/dagger/hilt/processor/internal:classnames", 100 "//java/dagger/hilt/processor/internal:compiler_options", 101 "//java/dagger/hilt/processor/internal:processor_errors", 102 "//java/dagger/hilt/processor/internal:processors", 103 "//java/dagger/hilt/processor/internal/aggregateddeps:component_dependencies", 104 "//java/dagger/hilt/processor/internal/aliasof:alias_ofs", 105 "//java/dagger/hilt/processor/internal/definecomponent:define_components", 106 "//java/dagger/hilt/processor/internal/earlyentrypoint:aggregated_early_entry_point_metadata", 107 "//java/dagger/hilt/processor/internal/generatesrootinput:generates_root_inputs", 108 "//java/dagger/hilt/processor/internal/root/ir", 109 "//java/dagger/hilt/processor/internal/uninstallmodules:aggregated_uninstall_modules_metadata", 110 "//java/dagger/internal/codegen/extension", 111 "//java/dagger/internal/codegen/xprocessing", 112 "//third_party/java/auto:service", 113 "//third_party/java/guava/base", 114 "//third_party/java/guava/collect", 115 "//third_party/java/incap", 116 "//third_party/java/javapoet", 117 "@maven//:com_google_devtools_ksp_symbol_processing_api", 118 ], 119) 120 121java_library( 122 name = "root_metadata", 123 srcs = [ 124 "AggregatedRootMetadata.java", 125 "ComponentTree.java", 126 "ComponentTreeDepsMetadata.java", 127 "ProcessedRootSentinelMetadata.java", 128 "Root.java", 129 "RootMetadata.java", 130 "TestRootMetadata.java", 131 ], 132 deps = [ 133 ":root_type", 134 "//java/dagger/hilt/processor/internal:aggregated_elements", 135 "//java/dagger/hilt/processor/internal:classnames", 136 "//java/dagger/hilt/processor/internal:component_descriptor", 137 "//java/dagger/hilt/processor/internal:processor_errors", 138 "//java/dagger/hilt/processor/internal:processors", 139 "//java/dagger/hilt/processor/internal/aggregateddeps:component_dependencies", 140 "//java/dagger/hilt/processor/internal/aliasof:alias_ofs", 141 "//java/dagger/hilt/processor/internal/kotlin", 142 "//java/dagger/hilt/processor/internal/root/ir", 143 "//java/dagger/internal/codegen/extension", 144 "//java/dagger/internal/codegen/xprocessing", 145 "//third_party/java/auto:common", 146 "//third_party/java/auto:value", 147 "//third_party/java/guava/base", 148 "//third_party/java/guava/collect", 149 "//third_party/java/guava/graph", 150 "//third_party/java/javapoet", 151 ], 152) 153 154java_library( 155 name = "root_type", 156 srcs = ["RootType.java"], 157 deps = [ 158 "//java/dagger/hilt/processor/internal:classnames", 159 "//java/dagger/hilt/processor/internal:processors", 160 "//java/dagger/internal/codegen/xprocessing", 161 "//third_party/java/javapoet", 162 ], 163) 164 165filegroup( 166 name = "srcs_filegroup", 167 srcs = glob(["*"]), 168) 169