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# Internal Hilt android testing libraries 17 18load("@rules_java//java:defs.bzl", "java_library") 19 20package(default_visibility = ["//:src"]) 21 22java_library( 23 name = "test_injector", 24 testonly = 1, 25 srcs = [ 26 "TestInjector.java", 27 ], 28) 29 30android_library( 31 name = "internal_test_root", 32 srcs = [ 33 "InternalTestRoot.java", 34 ], 35 deps = [ 36 "//java/dagger/hilt:generates_root_input", 37 ], 38) 39 40android_library( 41 name = "early_test_singleton_component_creator", 42 testonly = 1, 43 srcs = ["EarlySingletonComponentCreator.java"], 44) 45 46android_library( 47 name = "test_application_component_manager", 48 testonly = 1, 49 srcs = ["TestApplicationComponentManager.java"], 50 deps = [ 51 ":early_test_singleton_component_creator", 52 ":test_component_data", 53 ":test_injector", 54 "//java/dagger/hilt/android/testing:on_component_ready_runner", 55 "//java/dagger/hilt/internal:component_manager", 56 "//java/dagger/hilt/internal:preconditions", 57 "//java/dagger/hilt/internal:test_singleton_component_manager", 58 "@maven//:junit_junit", 59 ], 60) 61 62android_library( 63 name = "test_component_data", 64 testonly = 1, 65 srcs = [ 66 "TestComponentData.java", 67 "TestComponentDataSupplier.java", 68 ], 69 deps = [ 70 ":test_injector", 71 "//java/dagger/hilt/internal:component_manager", 72 ], 73) 74 75android_library( 76 name = "test_application_component_manager_holder", 77 testonly = 1, 78 srcs = ["TestApplicationComponentManagerHolder.java"], 79 deps = [ 80 "//java/dagger/hilt/internal:component_manager", 81 ], 82) 83 84android_library( 85 name = "mark_that_rules_ran_rule", 86 testonly = 1, 87 srcs = ["MarkThatRulesRanRule.java"], 88 deps = [ 89 ":test_application_component_manager", 90 ":test_application_component_manager_holder", 91 "//java/dagger/hilt/android/internal", 92 "//java/dagger/hilt/internal:component_manager", 93 "//java/dagger/hilt/internal:preconditions", 94 "@maven//:androidx_test_core", 95 "@maven//:junit_junit", 96 ], 97) 98 99filegroup( 100 name = "srcs_filegroup", 101 srcs = glob(["**/*"]), 102) 103