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# ViewModelInject processor. 17load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library") 18 19package(default_visibility = ["//:src"]) 20 21java_plugin( 22 name = "processor", 23 generates_api = 1, 24 processor_class = "dagger.hilt.android.processor.internal.viewmodel.ViewModelProcessor", 25 deps = [":processor_lib"], 26) 27 28kt_jvm_library( 29 name = "processor_lib", 30 srcs = [ 31 "KspViewModelProcessor.kt", 32 "ViewModelMetadata.kt", 33 "ViewModelModuleGenerator.kt", 34 "ViewModelProcessingStep.kt", 35 "ViewModelProcessor.kt", 36 ], 37 deps = [ 38 "//java/dagger/hilt/android/processor/internal:android_classnames", 39 "//java/dagger/hilt/processor/internal:base_processor", 40 "//java/dagger/hilt/processor/internal:classnames", 41 "//java/dagger/hilt/processor/internal:compiler_options", 42 "//java/dagger/hilt/processor/internal:processor_errors", 43 "//java/dagger/hilt/processor/internal:processors", 44 "//java/dagger/internal/codegen/xprocessing", 45 "//third_party/java/auto:service", 46 "//third_party/java/guava/collect", 47 "//third_party/java/incap", 48 "//third_party/java/javapoet", 49 "@maven//:com_google_devtools_ksp_symbol_processing_api", 50 ], 51) 52 53java_plugin( 54 name = "validation_plugin", 55 deps = [":validation_plugin_lib"], 56) 57 58kt_jvm_library( 59 name = "validation_plugin_lib", 60 srcs = [ 61 "ViewModelValidationPlugin.kt", 62 ], 63 deps = [ 64 "//:spi", 65 "//java/dagger/hilt/android/processor/internal:android_classnames", 66 "//java/dagger/hilt/processor/internal:dagger_models", 67 "//java/dagger/internal/codegen/xprocessing", 68 "//third_party/java/auto:service", 69 "//third_party/java/guava/graph", 70 "//third_party/java/javapoet", 71 ], 72) 73 74# See: https://github.com/bazelbuild/rules_kotlin/issues/324 75alias( 76 name = "libprocessor_lib-src.jar", 77 actual = ":processor_lib-sources.jar", 78) 79 80alias( 81 name = "libvalidation_plugin_lib-src.jar", 82 actual = ":validation_plugin_lib-sources.jar", 83) 84 85filegroup( 86 name = "srcs_filegroup", 87 srcs = glob(["*"]), 88) 89