1# Copyright (C) 2017 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# Tests for the Dagger compiler/codegen 17 18load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library") 19load("//:build_defs.bzl", "DOCLINT_HTML_AND_SYNTAX") 20load("//:test_defs.bzl", "GenJavaTests") 21 22package(default_visibility = ["//:src"]) 23 24kt_jvm_library( 25 name = "kotlin_sources", 26 srcs = [ 27 "KotlinInjectedQualifier.kt", 28 "KotlinObjectWithMemberInjection.kt", 29 ], 30 deps = [ 31 "//java/dagger:core", 32 ], 33) 34 35# TODO(bcorso): Move this into a subpackage. 36java_library( 37 name = "compilers", 38 srcs = [ 39 "CompilerMode.java", 40 "Compilers.java", 41 "JavaFileBuilder.java", 42 ], 43 deps = [ 44 "//java/dagger/internal/codegen:package_info", 45 "//java/dagger/internal/codegen:processor", 46 "//java/dagger/internal/guava:base", 47 "//java/dagger/internal/guava:collect", 48 "@com_google_auto_value_auto_value//jar", 49 "@google_bazel_common//third_party/java/compile_testing", 50 ], 51) 52 53GenJavaTests( 54 name = "compiler_tests", 55 srcs = glob( 56 ["*.java"], 57 exclude = [ 58 "CompilerMode.java", 59 "Compilers.java", 60 "JavaFileBuilder.java", 61 ], 62 ), 63 functional = False, 64 javacopts = DOCLINT_HTML_AND_SYNTAX, 65 plugins = ["//java/dagger/internal/codegen/bootstrap"], 66 deps = [ 67 ":compilers", 68 ":kotlin_sources", 69 "//java/dagger:core", 70 "//java/dagger/internal/codegen:package_info", 71 "//java/dagger/internal/codegen:processor", 72 "//java/dagger/internal/codegen/base", 73 "//java/dagger/internal/codegen/binding", 74 "//java/dagger/internal/codegen/bindinggraphvalidation", 75 "//java/dagger/internal/codegen/compileroption", 76 "//java/dagger/internal/codegen/javapoet", 77 "//java/dagger/internal/codegen/kotlin", 78 "//java/dagger/internal/codegen/langmodel", 79 "//java/dagger/internal/codegen/validation", 80 "//java/dagger/internal/codegen/writing", 81 "//java/dagger/internal/guava:base", 82 "//java/dagger/internal/guava:collect", 83 "//java/dagger/internal/guava:concurrent", 84 "//java/dagger/model/testing", 85 "//java/dagger/producers", 86 "//java/dagger/spi", 87 "@com_google_auto_value_auto_value//jar", 88 "@google_bazel_common//third_party/java/auto:value", 89 "@google_bazel_common//third_party/java/compile_testing", 90 "@google_bazel_common//third_party/java/javapoet", 91 "@google_bazel_common//third_party/java/jsr250_annotations", 92 "@google_bazel_common//third_party/java/jsr330_inject", 93 "@google_bazel_common//third_party/java/junit", 94 "@google_bazel_common//third_party/java/mockito", 95 "@google_bazel_common//third_party/java/truth", 96 "@maven//:com_google_auto_auto_common", 97 ], 98) 99