1# Copyright (C) 2019 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# Functional test code for Dagger-Android 17 18load("@rules_java//java:defs.bzl", "java_library") 19load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library") 20load("//:test_defs.bzl", "GenJavaTests") 21 22package(default_visibility = ["//:src"]) 23 24kt_jvm_library( 25 name = "kotlin", 26 srcs = glob( 27 [ 28 "*.java", 29 "*.kt", 30 ], 31 exclude = [ 32 "*Test.java", 33 "JavaTestQualifier.java", 34 "FooWithInjectedQualifier.kt", 35 ], 36 ), 37 # TODO(danysantiago): Remove 'plugins' once kt_jvm_library supports 'exported_plugins'. 38 plugins = ["//javatests/dagger/functional/kotlin/processor:plugin"], 39 deps = [ 40 ":foo_with_injected_qualifier", 41 ":java_qualifier", 42 "//:dagger_with_compiler", 43 "//javatests/dagger/functional/kotlin/processor:annotation", 44 "//third_party/java/auto:factory", 45 ], 46) 47 48kt_jvm_library( 49 name = "foo_with_injected_qualifier", 50 srcs = ["FooWithInjectedQualifier.kt"], 51 deps = [ 52 ":java_qualifier", 53 "//:dagger_with_compiler", 54 ], 55) 56 57java_library( 58 name = "java_qualifier", 59 srcs = ["JavaTestQualifier.java"], 60 deps = [ 61 "//:dagger_with_compiler", 62 ], 63) 64 65GenJavaTests( 66 name = "kotlin_tests", 67 srcs = glob(["*Test.java"]), 68 functional = True, 69 test_only_deps = [ 70 "//third_party/java/guava/base", 71 "//third_party/java/guava/collect", 72 "//third_party/java/junit", 73 "//third_party/java/truth", 74 ], 75 deps = [ 76 ":foo_with_injected_qualifier", 77 ":kotlin", 78 "//:dagger_with_compiler", 79 ], 80) 81