Skip to content

Commit

Permalink
Create a separate target for ProvidedBy.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 448523332
  • Loading branch information
java-team-github-bot authored and Guice Team committed May 13, 2022
1 parent 2098d6a commit c7a74a1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions core/src/com/google/inject/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ ANNOTATION_SRCS = [
"BindingAnnotation.java",
"Exposed.java",
"Inject.java",
"ProvidedBy.java",
"Provides.java",
"ScopeAnnotation.java",
"Singleton.java",
]

PROVIDED_BY_SRCS = [
"ProvidedBy.java",
]

IMPLEMENTED_BY_SRCS = [
"ImplementedBy.java",
]
Expand All @@ -44,6 +47,15 @@ java_library(
javacopts = JAVAC_OPTS,
)

java_library(
name = "provided_by",
srcs = PROVIDED_BY_SRCS,
javacopts = JAVAC_OPTS,
deps = [
"//third_party/java/jsr330_inject",
],
)

# TODO(lukes,user): It'd be nice if this wasn't one big rule.
# Unfortunately, splitting it apart would not be easy. We looked into
# it and the main issues appear to be:
Expand All @@ -53,7 +65,7 @@ java_library(
name = "inject",
srcs = glob(
["**/*.java"],
exclude = IMPLEMENTED_BY_SRCS + ANNOTATION_SRCS + CALLER_FINDER_COMMON_SRCS,
exclude = IMPLEMENTED_BY_SRCS + PROVIDED_BY_SRCS + ANNOTATION_SRCS + CALLER_FINDER_COMMON_SRCS,
),
javacopts = JAVAC_OPTS,
plugins = [
Expand All @@ -62,6 +74,7 @@ java_library(
exports = [
":annotations",
":implemented_by",
":provided_by",
# TODO(user): caller_finder_common shouldn't be exported, but validation requires
# it be exported right now.
":caller_finder_common",
Expand All @@ -73,6 +86,7 @@ java_library(
":annotations",
":caller_finder_common",
":implemented_by",
":provided_by",
"//third_party/java/guava/annotations",
"//third_party/java/guava/base",
"//third_party/java/guava/cache",
Expand Down Expand Up @@ -115,6 +129,7 @@ gen_maven_artifact(
":annotations",
":implemented_by",
":caller_finder_common",
":provided_by",
],
javadoc_srcs = [":javadoc-srcs"],
)

0 comments on commit c7a74a1

Please sign in to comment.