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# Description: 15# Tests for internal code for implementing Hilt processors. 16 17load("//java/dagger/testing/compile:macros.bzl", "compiler_test") 18 19package(default_visibility = ["//:src"]) 20 21android_library( 22 name = "MyAppPreviousCompilation", 23 srcs = ["MyAppPreviousCompilation.java"], 24 deps = [ 25 "//java/dagger/hilt/android:hilt_android_app", 26 ], 27) 28 29compiler_test( 30 name = "MyAppPreviousCompilationTest", 31 srcs = ["MyAppPreviousCompilationTest.java"], 32 compiler_deps = [ 33 ":MyAppPreviousCompilation", 34 "//java/dagger/hilt/android:hilt_android_app", 35 "//java/dagger/hilt/android/testing:hilt_android_test", 36 "@androidsdk//:platforms/android-30/android.jar", 37 "@maven//:androidx_annotation_annotation", 38 "@maven//:org_robolectric_robolectric", 39 "@maven//:androidx_test_ext_junit", 40 "@maven//:androidx_test_core", 41 ], 42 deps = [ 43 "//java/dagger/hilt/android/testing/compile", 44 "//third_party/java/compile_testing", 45 "//third_party/java/guava/collect", 46 "//third_party/java/junit", 47 "//third_party/java/truth", 48 ], 49) 50 51android_library( 52 name = "MyTestPreviousCompilation", 53 srcs = ["MyTestPreviousCompilation.java"], 54 deps = [ 55 "//:android_local_test_exports", 56 "//java/dagger/hilt/android/testing:hilt_android_test", 57 ], 58) 59 60compiler_test( 61 name = "MyTestPreviousCompilationTest", 62 srcs = ["MyTestPreviousCompilationTest.java"], 63 compiler_deps = [ 64 ":MyTestPreviousCompilation", 65 "//java/dagger/hilt/android:hilt_android_app", 66 "//java/dagger/hilt/android/testing:hilt_android_test", 67 "@androidsdk//:platforms/android-30/android.jar", 68 "@maven//:androidx_annotation_annotation", 69 "@maven//:org_robolectric_robolectric", 70 "@maven//:androidx_test_ext_junit", 71 "@maven//:androidx_test_core", 72 ], 73 deps = [ 74 "//java/dagger/hilt/android/testing/compile", 75 "//third_party/java/compile_testing", 76 "//third_party/java/guava/collect", 77 "//third_party/java/junit", 78 "//third_party/java/truth", 79 ], 80) 81 82compiler_test( 83 name = "RootProcessorErrorsTest", 84 srcs = ["RootProcessorErrorsTest.java"], 85 compiler_deps = [ 86 "//java/dagger/hilt/android:hilt_android_app", 87 "//java/dagger/hilt/android/testing:hilt_android_test", 88 "@androidsdk//:platforms/android-30/android.jar", 89 "@maven//:androidx_annotation_annotation", 90 "@maven//:org_robolectric_robolectric", 91 "@maven//:androidx_test_ext_junit", 92 "@maven//:androidx_test_core", 93 ], 94 deps = [ 95 "//java/dagger/hilt/android/testing/compile", 96 "//third_party/java/compile_testing", 97 "//third_party/java/guava/collect", 98 "//third_party/java/junit", 99 "//third_party/java/truth", 100 ], 101) 102 103compiler_test( 104 name = "RootFileFormatterTest", 105 srcs = ["RootFileFormatterTest.java"], 106 compiler_deps = [ 107 "//java/dagger/hilt/android:hilt_android_app", 108 "//java/dagger/hilt/android/testing:hilt_android_test", 109 "@androidsdk//:platforms/android-30/android.jar", 110 "@maven//:androidx_annotation_annotation", 111 "@maven//:org_robolectric_robolectric", 112 "@maven//:androidx_test_ext_junit", 113 "@maven//:androidx_test_core", 114 ], 115 deps = [ 116 "//java/dagger/hilt/android/testing/compile", 117 "//third_party/java/compile_testing", 118 "//third_party/java/guava/base", 119 "//third_party/java/junit", 120 "//third_party/java/truth", 121 ], 122) 123 124filegroup( 125 name = "srcs_filegroup", 126 srcs = glob(["*"]), 127) 128