diff --git a/BUILD b/BUILD index e683e5f5be..475e5ef0d3 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,53 @@ +load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library") + +package(default_visibility = ["//visibility:public"]) + package_group( name = "src", packages = ["//..."], ) + +javadoc_library( + name = "javadoc", + testonly = 1, # some dependencies are testonly, + srcs = [ + "//core/src/com/google/inject:javadoc-srcs", + "//extensions/assistedinject/src/com/google/inject/assistedinject:javadoc-srcs", + "//extensions/dagger-adapter/src/com/google/inject/daggeradapter:javadoc-srcs", + "//extensions/grapher/src/com/google/inject/grapher:javadoc-srcs", + "//extensions/jmx/src/com/google/inject/tools/jmx:javadoc-srcs", + "//extensions/jndi/src/com/google/inject/jndi:javadoc-srcs", + "//extensions/persist/src/com/google/inject/persist:javadoc-srcs", + "//extensions/service/src/com/google/inject/service:javadoc-srcs", + "//extensions/servlet/src/com/google/inject/servlet:javadoc-srcs", + "//extensions/spring/src/com/google/inject/spring:javadoc-srcs", + "//extensions/struts2/src/com/google/inject/struts2:javadoc-srcs", + "//extensions/testlib/src/com/google/inject/testing/fieldbinder:javadoc-srcs", + "//extensions/testlib/src/com/google/inject/testing/throwingproviders:javadoc-srcs", + "//extensions/throwingproviders/src/com/google/inject/throwingproviders:javadoc-srcs", + ], + doctitle = "Guice Dependency Injection API", + external_javadoc_links = [ + "https://google.github.io/guava/releases/30.1-jre/api/docs/", + "https://google.github.io/truth/api/0.45/", + "http://errorprone.info/api/latest/", + "https://tomcat.apache.org/tomcat-5.5-doc/servletapi/", + "http://aopalliance.sourceforge.net/doc/", + ], + deps = [ + "//core/src/com/google/inject", + "//extensions/assistedinject/src/com/google/inject/assistedinject", + "//extensions/dagger-adapter/src/com/google/inject/daggeradapter", + "//extensions/grapher/src/com/google/inject/grapher", + "//extensions/jmx/src/com/google/inject/tools/jmx", + "//extensions/jndi/src/com/google/inject/jndi", + "//extensions/persist/src/com/google/inject/persist", + "//extensions/service/src/com/google/inject/service", + "//extensions/servlet/src/com/google/inject/servlet", + "//extensions/spring/src/com/google/inject/spring", + "//extensions/struts2/src/com/google/inject/struts2", + "//extensions/testlib/src/com/google/inject/testing/fieldbinder", + "//extensions/testlib/src/com/google/inject/testing/throwingproviders", + "//extensions/throwingproviders/src/com/google/inject/throwingproviders", + ], +) diff --git a/core/src/com/google/inject/BUILD b/core/src/com/google/inject/BUILD index fa15bcff1d..48e7caba03 100644 --- a/core/src/com/google/inject/BUILD +++ b/core/src/com/google/inject/BUILD @@ -71,3 +71,8 @@ java_library( "//third_party/java/jsr330_inject", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["**/*.java"]), +) diff --git a/extensions/assistedinject/src/com/google/inject/assistedinject/BUILD b/extensions/assistedinject/src/com/google/inject/assistedinject/BUILD index c1fc230163..8564d57621 100644 --- a/extensions/assistedinject/src/com/google/inject/assistedinject/BUILD +++ b/extensions/assistedinject/src/com/google/inject/assistedinject/BUILD @@ -19,3 +19,8 @@ java_library( "//third_party/java/jsr330_inject", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/dagger-adapter/src/com/google/inject/daggeradapter/BUILD b/extensions/dagger-adapter/src/com/google/inject/daggeradapter/BUILD index 5a65f8af77..a829374cc1 100644 --- a/extensions/dagger-adapter/src/com/google/inject/daggeradapter/BUILD +++ b/extensions/dagger-adapter/src/com/google/inject/daggeradapter/BUILD @@ -8,7 +8,7 @@ package( java_library( name = "daggeradapter", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), plugins = [ ], deps = [ @@ -19,3 +19,8 @@ java_library( "//third_party/java/jsr330_inject", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/grapher/src/com/google/inject/grapher/BUILD b/extensions/grapher/src/com/google/inject/grapher/BUILD index 1f6d9c25c8..0df87b4e02 100644 --- a/extensions/grapher/src/com/google/inject/grapher/BUILD +++ b/extensions/grapher/src/com/google/inject/grapher/BUILD @@ -17,3 +17,8 @@ java_library( "//third_party/java/guava/collect", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["**/*.java"]), +) diff --git a/extensions/jmx/src/com/google/inject/tools/jmx/BUILD b/extensions/jmx/src/com/google/inject/tools/jmx/BUILD index ef44f0cf0c..ac4d45d4f1 100644 --- a/extensions/jmx/src/com/google/inject/tools/jmx/BUILD +++ b/extensions/jmx/src/com/google/inject/tools/jmx/BUILD @@ -1,13 +1,20 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") + package( default_visibility = ["//:src"], ) java_library( name = "jmx", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), deps = [ "//core/src/com/google/inject", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/jndi/src/com/google/inject/jndi/BUILD b/extensions/jndi/src/com/google/inject/jndi/BUILD index ee3bdd4681..d7d5739780 100644 --- a/extensions/jndi/src/com/google/inject/jndi/BUILD +++ b/extensions/jndi/src/com/google/inject/jndi/BUILD @@ -8,8 +8,13 @@ package( java_library( name = "jndi", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), deps = [ "//core/src/com/google/inject", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/mini/src/com/google/inject/mini/BUILD b/extensions/mini/src/com/google/inject/mini/BUILD index 3aeb353838..8b8d8e1261 100644 --- a/extensions/mini/src/com/google/inject/mini/BUILD +++ b/extensions/mini/src/com/google/inject/mini/BUILD @@ -1,5 +1,7 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") + package( default_visibility = ["//:src"], ) @@ -12,3 +14,8 @@ java_library( "//third_party/java/jsr330_inject", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/persist/src/com/google/inject/persist/BUILD b/extensions/persist/src/com/google/inject/persist/BUILD index 876ad2e034..5e015a0be5 100644 --- a/extensions/persist/src/com/google/inject/persist/BUILD +++ b/extensions/persist/src/com/google/inject/persist/BUILD @@ -1,5 +1,7 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") + package( default_visibility = ["//:src"], ) @@ -21,3 +23,8 @@ java_library( "//third_party/java/servlet/servlet_api", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["**/*.java"]), +) diff --git a/extensions/service/src/com/google/inject/service/BUILD b/extensions/service/src/com/google/inject/service/BUILD index c27d5e80dd..1ad655f228 100644 --- a/extensions/service/src/com/google/inject/service/BUILD +++ b/extensions/service/src/com/google/inject/service/BUILD @@ -1,12 +1,14 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") + package( default_visibility = ["//:src"], ) java_library( name = "service", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), plugins = [ ], deps = [ @@ -16,3 +18,8 @@ java_library( "//third_party/java/guava/util/concurrent", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/servlet/src/com/google/inject/servlet/BUILD b/extensions/servlet/src/com/google/inject/servlet/BUILD index c6b8c1cd6b..332ea0f32d 100644 --- a/extensions/servlet/src/com/google/inject/servlet/BUILD +++ b/extensions/servlet/src/com/google/inject/servlet/BUILD @@ -1,5 +1,7 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") + package( default_visibility = ["//:src"], ) @@ -17,7 +19,7 @@ java_library( java_library( name = "servlet", srcs = glob( - ["**/*.java"], + ["*.java"], exclude = ["RequestScoped.java"], ), plugins = [ @@ -34,3 +36,8 @@ java_library( "//third_party/java/servlet/servlet_api", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/spring/src/com/google/inject/spring/BUILD b/extensions/spring/src/com/google/inject/spring/BUILD index 776074a596..f33cd380de 100644 --- a/extensions/spring/src/com/google/inject/spring/BUILD +++ b/extensions/spring/src/com/google/inject/spring/BUILD @@ -1,5 +1,6 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") package( default_visibility = ["//:src"], @@ -7,7 +8,7 @@ package( java_library( name = "spring", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), plugins = [ ], deps = [ @@ -16,3 +17,8 @@ java_library( "//third_party/java/spring:beans", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/struts2/src/com/google/inject/struts2/BUILD b/extensions/struts2/src/com/google/inject/struts2/BUILD index 9ecae59830..9d8357856f 100644 --- a/extensions/struts2/src/com/google/inject/struts2/BUILD +++ b/extensions/struts2/src/com/google/inject/struts2/BUILD @@ -1,5 +1,6 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") package( default_visibility = ["//:src"], @@ -7,10 +8,15 @@ package( java_library( name = "struts2", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), deps = [ "//core/src/com/google/inject", "//extensions/servlet/src/com/google/inject/servlet", "//third_party/java/struts2", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/testlib/src/com/google/inject/testing/fieldbinder/BUILD b/extensions/testlib/src/com/google/inject/testing/fieldbinder/BUILD index 6a25ab2d61..a49516ee1e 100644 --- a/extensions/testlib/src/com/google/inject/testing/fieldbinder/BUILD +++ b/extensions/testlib/src/com/google/inject/testing/fieldbinder/BUILD @@ -1,5 +1,7 @@ # Copyright 2014 Google Inc. All rights reserved. # Author: eatnumber1@google.com (Russ Harmon) +load("@rules_java//java:defs.bzl", "java_library") + package( default_testonly = 1, default_visibility = ["//:src"], @@ -7,7 +9,7 @@ package( java_library( name = "fieldbinder", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), plugins = [ ], deps = [ @@ -18,3 +20,8 @@ java_library( "//third_party/java/jsr330_inject", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/testlib/src/com/google/inject/testing/throwingproviders/BUILD b/extensions/testlib/src/com/google/inject/testing/throwingproviders/BUILD index fcabcfb027..8e7da1a113 100644 --- a/extensions/testlib/src/com/google/inject/testing/throwingproviders/BUILD +++ b/extensions/testlib/src/com/google/inject/testing/throwingproviders/BUILD @@ -1,3 +1,5 @@ +load("@rules_java//java:defs.bzl", "java_library") + package( default_testonly = 1, default_visibility = ["//:src"], @@ -12,3 +14,8 @@ java_library( "//third_party/java/truth", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +) diff --git a/extensions/throwingproviders/src/com/google/inject/throwingproviders/BUILD b/extensions/throwingproviders/src/com/google/inject/throwingproviders/BUILD index 7a5617494f..38ca841003 100644 --- a/extensions/throwingproviders/src/com/google/inject/throwingproviders/BUILD +++ b/extensions/throwingproviders/src/com/google/inject/throwingproviders/BUILD @@ -1,12 +1,14 @@ # Copyright 2011 Google Inc. All rights reserved. # Author: sameb@google.com (Sam Berlin) +load("@rules_java//java:defs.bzl", "java_library") + package( default_visibility = ["//:src"], ) java_library( name = "throwingproviders", - srcs = glob(["**/*.java"]), + srcs = glob(["*.java"]), plugins = [ ], deps = [ @@ -17,3 +19,8 @@ java_library( "//third_party/java/jsr305_annotations", ], ) + +filegroup( + name = "javadoc-srcs", + srcs = glob(["*.java"]), +)