Skip to content

Commit 0a104f4

Browse files
committed
Add java
1 parent f4d5e0e commit 0a104f4

36 files changed

+2326
-1
lines changed

.bazelci/presubmit.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ tasks:
1010
test_targets:
1111
- "//examples/routeguide:cpp_cpp"
1212
- "//examples/routeguide:cpp_go"
13+
- "//examples/routeguide:cpp_java"
1314
- "//examples/routeguide:cpp_python"
1415
- "//examples/routeguide:go_cpp"
1516
- "//examples/routeguide:go_go"
17+
- "//examples/routeguide:go_java"
1618
- "//examples/routeguide:go_python"
19+
- "//examples/routeguide:java_cpp"
20+
- "//examples/routeguide:java_go"
21+
- "//examples/routeguide:java_java"
22+
- "//examples/routeguide:java_python"
1723
- "//examples/routeguide:python_cpp"
1824
- "//examples/routeguide:python_go"
25+
- "//examples/routeguide:python_java"
1926
- "//examples/routeguide:python_python"
2027

2128
main_windows:
@@ -29,12 +36,19 @@ tasks:
2936
test_targets:
3037
- "//examples/routeguide:cpp_cpp"
3138
- "//examples/routeguide:cpp_go"
39+
- "//examples/routeguide:cpp_java"
3240
- "//examples/routeguide:cpp_python"
3341
- "//examples/routeguide:go_cpp"
3442
- "//examples/routeguide:go_go"
43+
- "//examples/routeguide:go_java"
3544
- "//examples/routeguide:go_python"
45+
- "//examples/routeguide:java_cpp"
46+
- "//examples/routeguide:java_go"
47+
- "//examples/routeguide:java_java"
48+
- "//examples/routeguide:java_python"
3649
- "//examples/routeguide:python_cpp"
3750
- "//examples/routeguide:python_go"
51+
- "//examples/routeguide:python_java"
3852
- "//examples/routeguide:python_python"
3953

4054
main_macos:
@@ -48,12 +62,19 @@ tasks:
4862
test_targets:
4963
- "//examples/routeguide:cpp_cpp"
5064
- "//examples/routeguide:cpp_go"
65+
- "//examples/routeguide:cpp_java"
5166
- "//examples/routeguide:cpp_python"
5267
- "//examples/routeguide:go_cpp"
5368
- "//examples/routeguide:go_go"
69+
- "//examples/routeguide:go_java"
5470
- "//examples/routeguide:go_python"
71+
- "//examples/routeguide:java_cpp"
72+
- "//examples/routeguide:java_go"
73+
- "//examples/routeguide:java_java"
74+
- "//examples/routeguide:java_python"
5575
- "//examples/routeguide:python_cpp"
5676
- "//examples/routeguide:python_go"
77+
- "//examples/routeguide:python_java"
5778
- "//examples/routeguide:python_python"
5879

5980
buf_ubuntu2204_examples:
@@ -312,6 +333,54 @@ tasks:
312333
- make grpc_gateway_gateway_openapiv2_compile_example
313334
- make grpc_gateway_gateway_grpc_library_example
314335

336+
java_ubuntu2204_examples:
337+
name: Java
338+
platform: ubuntu2204
339+
environment:
340+
BAZEL_EXTRA_FLAGS: "--cxxopt=-std=c++17 --host_cxxopt=-std=c++17"
341+
shell_commands:
342+
- set -x
343+
- make java_java_proto_compile_example
344+
- make java_java_grpc_compile_example
345+
- make java_java_proto_library_example
346+
- make java_java_grpc_library_example
347+
348+
java_windows_examples:
349+
name: Java
350+
platform: windows
351+
environment:
352+
BAZEL_EXTRA_FLAGS: "--cxxopt=/std:c++17 --host_cxxopt=/std:c++17"
353+
batch_commands:
354+
- echo java_proto_compile
355+
- cd examples/java/java_proto_compile
356+
- bazel --batch build %BAZEL_EXTRA_FLAGS% --enable_runfiles --verbose_failures --disk_cache=../../bazel-disk-cache //... || exit 1
357+
- cd ../../..
358+
- echo java_grpc_compile
359+
- cd examples/java/java_grpc_compile
360+
- bazel --batch build %BAZEL_EXTRA_FLAGS% --enable_runfiles --verbose_failures --disk_cache=../../bazel-disk-cache //... || exit 1
361+
- cd ../../..
362+
- echo java_proto_library
363+
- cd examples/java/java_proto_library
364+
- bazel --batch build %BAZEL_EXTRA_FLAGS% --enable_runfiles --verbose_failures --disk_cache=../../bazel-disk-cache //... || exit 1
365+
- cd ../../..
366+
- echo java_grpc_library
367+
- cd examples/java/java_grpc_library
368+
- bazel --batch build %BAZEL_EXTRA_FLAGS% --enable_runfiles --verbose_failures --disk_cache=../../bazel-disk-cache //... || exit 1
369+
- cd ../../..
370+
371+
java_macos_examples:
372+
name: Java
373+
platform: macos
374+
environment:
375+
BAZEL_EXTRA_FLAGS: "--cxxopt=-std=c++17 --host_cxxopt=-std=c++17"
376+
shell_commands:
377+
- set -x
378+
- export BAZEL_EXTRA_FLAGS="--copt=-isystem/usr/local/include $BAZEL_EXTRA_FLAGS"
379+
- make java_java_proto_compile_example
380+
- make java_java_grpc_compile_example
381+
- make java_java_proto_library_example
382+
- make java_java_grpc_library_example
383+
315384
objc_macos_examples:
316385
name: Objective-C
317386
platform: macos

.bazelignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ examples/grpc_gateway/gateway_grpc_compile
2727
examples/grpc_gateway/gateway_openapiv2_compile
2828
examples/grpc_gateway/gateway_grpc_library
2929

30+
examples/java/java_proto_compile
31+
examples/java/java_grpc_compile
32+
examples/java/java_proto_library
33+
examples/java/java_grpc_library
34+
3035
examples/objc/objc_proto_compile
3136
examples/objc/objc_grpc_compile
3237
examples/objc/objc_proto_library

MODULE.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ local_path_override(
6969
path = "modules/grpc_gateway",
7070
)
7171

72+
# Java
73+
bazel_dep(name = "rules_proto_grpc_java", version = "0.0.0.rpg.version.placeholder")
74+
local_path_override(
75+
module_name = "rules_proto_grpc_java",
76+
path = "modules/java",
77+
)
78+
7279
# Objective-C
7380
bazel_dep(name = "rules_proto_grpc_objc", version = "0.0.0.rpg.version.placeholder")
7481
local_path_override(

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ Full documentation for the current and previous versions [can be found here](htt
7373
| [gRPC-Gateway](https://rules-proto-grpc.com/en/latest/lang/grpc_gateway.html) | [gateway_grpc_compile](https://rules-proto-grpc.com/en/latest/lang/grpc_gateway.html#gateway-grpc-compile) | Generates gRPC-Gateway ``.go`` files ([example](/examples/grpc_gateway/gateway_grpc_compile)) |
7474
| [gRPC-Gateway](https://rules-proto-grpc.com/en/latest/lang/grpc_gateway.html) | [gateway_openapiv2_compile](https://rules-proto-grpc.com/en/latest/lang/grpc_gateway.html#gateway-openapiv2-compile) | Generates gRPC-Gateway OpenAPI v2 ``.json`` files ([example](/examples/grpc_gateway/gateway_openapiv2_compile)) |
7575
| [gRPC-Gateway](https://rules-proto-grpc.com/en/latest/lang/grpc_gateway.html) | [gateway_grpc_library](https://rules-proto-grpc.com/en/latest/lang/grpc_gateway.html#gateway-grpc-library) | Generates gRPC-Gateway library files ([example](/examples/grpc_gateway/gateway_grpc_library)) |
76+
| [Java](https://rules-proto-grpc.com/en/latest/lang/java.html) | [java_proto_compile](https://rules-proto-grpc.com/en/latest/lang/java.html#java-proto-compile) | Generates a Java protobuf srcjar file ([example](/examples/java/java_proto_compile)) |
77+
| [Java](https://rules-proto-grpc.com/en/latest/lang/java.html) | [java_grpc_compile](https://rules-proto-grpc.com/en/latest/lang/java.html#java-grpc-compile) | Generates a Java protobuf and gRPC srcjar file ([example](/examples/java/java_grpc_compile)) |
78+
| [Java](https://rules-proto-grpc.com/en/latest/lang/java.html) | [java_proto_library](https://rules-proto-grpc.com/en/latest/lang/java.html#java-proto-library) | Generates a Java protobuf library using ``java_library`` ([example](/examples/java/java_proto_library)) |
79+
| [Java](https://rules-proto-grpc.com/en/latest/lang/java.html) | [java_grpc_library](https://rules-proto-grpc.com/en/latest/lang/java.html#java-grpc-library) | Generates a Java protobuf and gRPC library using ``java_library`` ([example](/examples/java/java_grpc_library)) |
7680
| [Objective-C](https://rules-proto-grpc.com/en/latest/lang/objc.html) | [objc_proto_compile](https://rules-proto-grpc.com/en/latest/lang/objc.html#objc-proto-compile) | Generates Objective-C protobuf ``.m`` & ``.h`` files ([example](/examples/objc/objc_proto_compile)) |
7781
| [Objective-C](https://rules-proto-grpc.com/en/latest/lang/objc.html) | [objc_grpc_compile](https://rules-proto-grpc.com/en/latest/lang/objc.html#objc-grpc-compile) | Generates Objective-C protobuf and gRPC ``.m`` & ``.h`` files ([example](/examples/objc/objc_grpc_compile)) |
7882
| [Objective-C](https://rules-proto-grpc.com/en/latest/lang/objc.html) | [objc_proto_library](https://rules-proto-grpc.com/en/latest/lang/objc.html#objc-proto-library) | Generates an Objective-C protobuf library using ``objc_library`` ([example](/examples/objc/objc_proto_library)) |

docs/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ Supported Languages and Tools
123123
* - Go
124124
- ✔
125125
- ✔
126+
* - Java
127+
- ✔
128+
- ✔
126129
* - Objective-C
127130
- ✔
128131
- ✔
@@ -176,5 +179,6 @@ Supported Languages and Tools
176179
lang/doc
177180
lang/go
178181
lang/grpc_gateway
182+
lang/java
179183
lang/objc
180184
lang/python

0 commit comments

Comments
 (0)