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 "ViewModelMetadata.kt", 32 "ViewModelModuleGenerator.kt", 33 "ViewModelProcessor.kt", 34 ], 35 deps = [ 36 "//java/dagger/hilt/android/processor/internal:android_classnames", 37 "//java/dagger/hilt/processor/internal:base_processor", 38 "//java/dagger/hilt/processor/internal:classnames", 39 "//java/dagger/hilt/processor/internal:processor_errors", 40 "//java/dagger/hilt/processor/internal:processors", 41 "//java/dagger/internal/guava:collect", 42 "@google_bazel_common//third_party/java/auto:service", 43 "@google_bazel_common//third_party/java/incap", 44 "@google_bazel_common//third_party/java/javapoet", 45 "@maven//:com_google_auto_auto_common", 46 ], 47) 48 49java_plugin( 50 name = "validation_plugin", 51 deps = [":validation_plugin_lib"], 52) 53 54kt_jvm_library( 55 name = "validation_plugin_lib", 56 srcs = [ 57 "ViewModelValidationPlugin.kt", 58 ], 59 deps = [ 60 "//:spi", 61 "//java/dagger/hilt/android/processor/internal:android_classnames", 62 "//java/dagger/hilt/processor/internal:processors", 63 "//java/dagger/internal/guava:graph", 64 "@google_bazel_common//third_party/java/auto:service", 65 "@google_bazel_common//third_party/java/javapoet", 66 "@maven//:com_google_auto_auto_common", 67 ], 68) 69 70# See: https://github.com/bazelbuild/rules_kotlin/issues/324 71alias( 72 name = "libprocessor_lib-src.jar", 73 actual = ":processor_lib-sources.jar", 74) 75 76alias( 77 name = "libvalidation_plugin_lib-src.jar", 78 actual = ":validation_plugin_lib-sources.jar", 79) 80 81filegroup( 82 name = "srcs_filegroup", 83 srcs = glob(["*"]), 84) 85