-
Notifications
You must be signed in to change notification settings - Fork 53
/
BUILD.bazel
72 lines (62 loc) · 2.21 KB
/
BUILD.bazel
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
load("@rules_java//java:defs.bzl", "java_binary", "java_proto_library")
load(
"//:gapic_generator_java.bzl",
"google_java_format",
"google_java_format_verification",
)
package(default_visibility = ["//visibility:public"])
JAVA_SRCS = [
"//src/main/java/com/google/api/generator:generator_files",
"//src/main/java/com/google/api/generator/engine:engine_files",
"//src/main/java/com/google/api/generator/gapic:gapic_files",
]
TEST_SRCS = [
"//src/test/java/com/google/api/generator/engine:engine_files",
"//src/test/java/com/google/api/generator/gapic:gapic_files",
"//src/test/java/com/google/api/generator/test/framework:framework_files",
]
# ============= Proto wrappers =================
java_proto_library(
name = "service_config_java_proto",
visibility = ["//:__subpackages__"],
deps = [
"@io_grpc_proto//:service_config_proto",
],
)
# ============= Binary targets ================
java_binary(
name = "protoc-gen-java_gapic",
srcs = [
"//src/main/java/com/google/api/generator:generator_files",
],
main_class = "com.google.api.generator.Main",
deps = [
"//src/main/java/com/google/api/generator",
"//src/main/java/com/google/api/generator/gapic",
"@com_google_googleapis//google/api:api_java_proto",
"@com_google_googleapis//google/longrunning:longrunning_java_proto",
"@com_google_guava_guava",
"@com_google_protobuf//:protobuf_java",
],
)
# google-java-format
java_binary(
name = "google_java_format_binary",
jvm_flags = ["-Xmx512m"],
main_class = "com.google.googlejavaformat.java.Main",
visibility = ["//visibility:public"],
runtime_deps = ["@google_java_format_all_deps//jar"],
)
# Run `bazel build //:google_java_format_verification` to verify that gapic-generator-java sources
# are formatted correctly.
google_java_format_verification(
name = "google_java_format_verification",
srcs = JAVA_SRCS + TEST_SRCS,
formatter = "//:google_java_format_binary",
)
# Run `bazel run //:google_java_format` to format gapic-generator-java sources.
google_java_format(
name = "google_java_format",
srcs = JAVA_SRCS + TEST_SRCS,
formatter = "//:google_java_format_binary",
)