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