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# Hilt ViewModel integration. 17 18load("@rules_java//java:defs.bzl", "java_library") 19load("//tools:bazel_compat.bzl", "compat_kt_android_library") 20 21package(default_visibility = ["//:src"]) 22 23java_library( 24 name = "package_info", 25 srcs = ["package-info.java"], 26 deps = [ 27 "//third_party/java/jsr305_annotations", 28 ], 29) 30 31android_library( 32 name = "hilt_view_model", 33 srcs = ["HiltViewModel.java"], 34 exported_plugins = [ 35 "//java/dagger/hilt/android/processor/internal/viewmodel:processor", 36 ], 37 exports = [ 38 "//:dagger_with_compiler", 39 "//java/dagger/hilt:install_in", 40 "//java/dagger/hilt/android/components", 41 "//java/dagger/hilt/android/internal/lifecycle", 42 "//java/dagger/hilt/codegen:originating_element", 43 ], 44 deps = [ 45 ":package_info", 46 "//java/dagger/hilt:generates_root_input", 47 ], 48) 49 50android_library( 51 name = "retained_lifecycle", 52 srcs = ["RetainedLifecycle.java"], 53 deps = [ 54 ":package_info", 55 "@maven//:androidx_annotation_annotation", 56 ], 57) 58 59android_library( 60 name = "activity_retained_saved_state", 61 srcs = ["ActivityRetainedSavedState.java"], 62 deps = [ 63 "//java/dagger/hilt/android:unstable_api", 64 "//third_party/java/jsr330_inject", 65 ], 66) 67 68compat_kt_android_library( 69 name = "hilt_view_model_extensions", 70 srcs = ["HiltViewModelExtensions.kt"], 71 deps = [ 72 ":package_info", 73 "//java/dagger/hilt/android/internal/lifecycle", 74 "@maven//:androidx_annotation_annotation", 75 "@maven//:androidx_lifecycle_lifecycle_viewmodel", 76 ], 77) 78 79filegroup( 80 name = "srcs_filegroup", 81 srcs = glob(["*"]), 82) 83