forked from googleapis/disco-to-proto3-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
120 lines (107 loc) · 3.46 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
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
load(
"//:disco_to_proto3_converter.bzl",
"google_java_format",
"google_java_format_verification",
"java_tests",
)
_JAVA_COPTS = [
"-source",
"1.8",
"-target",
"1.8",
]
_COMPILE_DEPS = [
"@com_google_guava_guava//jar",
"@com_google_code_gson_gson//jar",
"@javax_annotation_javax_annotation_api//jar",
"@com_google_code_findbugs_jsr305//jar",
"@com_fasterxml_jackson_core_jackson_annotations//jar",
"@com_fasterxml_jackson_core_jackson_core//jar",
"@com_fasterxml_jackson_core_jackson_databind//jar",
"@com_google_auto_value_auto_value_annotations//jar",
]
_TEST_COMPILE_DEPS = [
"@junit_junit//jar",
]
java_binary(
name = "disco_to_proto3_converter",
srcs = glob(["src/main/java/**/*.java"]),
create_executable = True,
javacopts = _JAVA_COPTS,
jvm_flags = ["-Xmx512m"],
main_class = "com.google.cloud.discotoproto3converter.DiscoToProto3ConverterApp",
plugins = ["//:auto_value_plugin"],
resources = [],
visibility = ["//visibility:public"],
deps = _COMPILE_DEPS,
)
java_binary(
name = "service_config_generator",
srcs = glob(["src/main/java/**/*.java"]),
create_executable = True,
javacopts = _JAVA_COPTS,
jvm_flags = ["-Xmx512m"],
main_class = "com.google.cloud.discotoproto3converter.ServiceConfigGeneratorApp",
plugins = ["//:auto_value_plugin"],
resources = [],
visibility = ["//visibility:public"],
deps = _COMPILE_DEPS,
)
java_binary(
name = "gapic_yaml_generator",
srcs = glob(["src/main/java/**/*.java"]),
create_executable = True,
javacopts = _JAVA_COPTS,
jvm_flags = ["-Xmx512m"],
main_class = "com.google.cloud.discotoproto3converter.GapicYamlGeneratorApp",
plugins = ["//:auto_value_plugin"],
resources = [],
visibility = ["//visibility:public"],
deps = _COMPILE_DEPS,
)
java_library(
name = "disco_to_proto3_converter_testlib",
srcs = glob(["src/test/java/**/*.java"]),
javacopts = _JAVA_COPTS,
plugins = ["//:auto_value_plugin"],
visibility = ["//visibility:public"],
deps = [":disco_to_proto3_converter"] + _COMPILE_DEPS + _TEST_COMPILE_DEPS,
)
java_tests(
name = "disco_to_proto3_converter_tests",
size = "small",
srcs = glob(
include = ["src/test/java/**/*Test.java"],
exclude = ["src/test/java/**/Abstract*Test.java"],
),
data = glob(["src/test/resources/**/*.*"]),
runtime_deps = [":disco_to_proto3_converter_testlib"],
)
java_plugin(
name = "auto_value_plugin",
processor_class = "com.google.auto.value.processor.AutoValueProcessor",
visibility = ["//visibility:public"],
deps = ["@com_google_auto_value_auto_value//jar"],
)
google_java_format(
name = "google_java_format",
srcs = glob(["src/**/*.java"]),
formatter = "//:google_java_format_binary",
)
# google-java-format
java_binary(
name = "google_java_format_binary",
# Not letting the formatter consume too much memory (essential for CI builds)
jvm_flags = ["-Xmx512m"],
main_class = "com.google.googlejavaformat.java.Main",
visibility = ["//visibility:public"],
runtime_deps = ["@google_java_format_all_deps//jar"],
)
# Fails the build if any of the java files are not properly formatted according
# to the google-java-format tool.
google_java_format_verification(
name = "google_java_format_verification",
srcs = glob(["src/**/*.java"]),
formatter = "//:google_java_format_binary",
)
exports_files(glob(["src/test/resources/**/*.json"]))