-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathBUILD
More file actions
144 lines (129 loc) · 3.52 KB
/
BUILD
File metadata and controls
144 lines (129 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
load("@rules_java//java:defs.bzl", "java_library")
load(
"//:build_defs.bzl",
"JAVAC_OPTS",
"POM_VERSION",
)
load("//:mvn.bzl", "gen_maven_artifact")
# Copyright 2011 Google Inc. All rights reserved.
# Author: sameb@google.com (Sam Berlin)
package(
default_visibility = ["//:src"],
)
CALLER_FINDER_COMMON_SRCS = [
"internal/util/CallerFinder.java",
"internal/util/NewThrowableFinder.java",
]
ANNOTATION_SRCS = [
"BindingAnnotation.java",
"Exposed.java",
"Inject.java",
"Provides.java",
"ScopeAnnotation.java",
"Singleton.java",
]
PROVIDED_BY_SRCS = [
"ProvidedBy.java",
]
IMPLEMENTED_BY_SRCS = [
"ImplementedBy.java",
]
CALLER_FINDER_STACK_WALKER_SRCS = ["internal/util/DirectStackWalkerFinder.java"]
java_library(
name = "caller_finder_impl",
srcs = CALLER_FINDER_STACK_WALKER_SRCS,
javacopts = JAVAC_OPTS,
deps = [":caller_finder_common"],
)
java_library(
name = "caller_finder_common",
srcs = CALLER_FINDER_COMMON_SRCS,
javacopts = JAVAC_OPTS,
)
java_library(
name = "implemented_by",
srcs = IMPLEMENTED_BY_SRCS,
javacopts = JAVAC_OPTS,
)
java_library(
name = "provided_by",
srcs = PROVIDED_BY_SRCS,
javacopts = JAVAC_OPTS,
deps = [
"//third_party/java/jakarta_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:
# - Utility classes like internal/MoreTypes (choke point dependencies)
# - Cyclical dependencies between Binder and spi/Element
java_library(
name = "inject",
srcs = glob(
["**/*.java"],
exclude = IMPLEMENTED_BY_SRCS +
PROVIDED_BY_SRCS +
ANNOTATION_SRCS +
CALLER_FINDER_COMMON_SRCS +
CALLER_FINDER_STACK_WALKER_SRCS,
),
javacopts = JAVAC_OPTS,
tags = ["maven_coordinates=com.google.inject:guice:" + POM_VERSION],
exports = [
":annotations",
":caller_finder_common",
":caller_finder_impl",
":implemented_by",
":provided_by",
],
deps = [
":annotations",
":caller_finder_common",
":caller_finder_impl",
":implemented_by",
":provided_by",
"//third_party/java/aopalliance",
"//third_party/java/asm",
"//third_party/java/error_prone:annotations",
"//third_party/java/guava/annotations",
"//third_party/java/guava/base",
"//third_party/java/guava/cache",
"//third_party/java/guava/collect",
"//third_party/java/guava/primitives",
"//third_party/java/jakarta_inject",
"//third_party/java/jspecify_annotations",
"//third_party/java/jsr305_annotations",
"//tools/jdk/internal:jdk.unsupported/sun.misc",
],
)
java_library(
name = "annotations",
srcs = ANNOTATION_SRCS,
javacopts = JAVAC_OPTS,
deps = [
"//third_party/java/error_prone:annotations",
"//third_party/java/jakarta_inject",
],
)
filegroup(
name = "javadoc-srcs",
srcs = glob(
["**/*.java"],
exclude = ["internal/**/*.java"],
),
)
gen_maven_artifact(
name = "core",
artifact_id = "guice",
artifact_name = "Google Guice - Core Library",
artifact_target = ":inject",
artifact_target_libs = [
":annotations",
":implemented_by",
":caller_finder_common",
":caller_finder_impl",
":provided_by",
],
javadoc_srcs = [":javadoc-srcs"],
)