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 # An asynchronous dependency injection system that extends JSR-330. 17 18 load("@rules_java//java:defs.bzl", "java_library") 19 load( 20 "//:build_defs.bzl", 21 "DOCLINT_HTML_AND_SYNTAX", 22 "DOCLINT_REFERENCES", 23 "POM_VERSION", 24 "SOURCE_7_TARGET_7", 25 ) 26 load("//tools:maven.bzl", "gen_maven_artifact") 27 28 package(default_visibility = ["//:src"]) 29 30 # Work around b/70476182 which prevents Kythe from connecting :producers to the .java files it 31 # contains. 32 SRCS = glob(["**/*.java"]) 33 34 filegroup( 35 name = "producers-srcs", 36 srcs = SRCS, 37 ) 38 39 java_library( 40 name = "producers", 41 srcs = SRCS, 42 javacopts = SOURCE_7_TARGET_7 + DOCLINT_HTML_AND_SYNTAX + DOCLINT_REFERENCES, 43 tags = ["maven_coordinates=com.google.dagger:dagger-producers:" + POM_VERSION], 44 exports = [ 45 "//java/dagger/internal/guava:base", 46 "//java/dagger/internal/guava:concurrent", 47 "@google_bazel_common//third_party/java/jsr330_inject", 48 ], 49 deps = [ 50 "//java/dagger:core", 51 "//java/dagger/internal/guava:base", 52 "//java/dagger/internal/guava:collect", 53 "//java/dagger/internal/guava:concurrent", 54 "@google_bazel_common//third_party/java/checker_framework_annotations", 55 "@google_bazel_common//third_party/java/error_prone:annotations", 56 "@google_bazel_common//third_party/java/jsr330_inject", 57 ], 58 ) 59 60 gen_maven_artifact( 61 name = "artifact", 62 artifact_coordinates = "com.google.dagger:dagger-producers:" + POM_VERSION, 63 artifact_name = "Dagger Producers", 64 artifact_target = ":producers", 65 artifact_target_maven_deps = [ 66 "com.google.dagger:dagger", 67 "com.google.guava:failureaccess", 68 "com.google.guava:guava", # TODO(bcorso): Remove guava dependency and ban it? 69 "javax.inject:javax.inject", 70 "org.checkerframework:checker-compat-qual", 71 ], 72 javadoc_exclude_packages = [ 73 "dagger.producers.internal", 74 "dagger.producers.monitoring.internal", 75 ], 76 javadoc_root_packages = ["dagger.producers"], 77 javadoc_srcs = SRCS, 78 # TODO(bcorso): Look more into why auto/common shading isn't needed here. 79 ) 80