Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
java_grpc_library: Add support for protobuf lite
gRPC's protobuf-lite auto-selects between full and lite protobuf based on the value of crosstool_top. If the user is specifying their own --android_crosstool_top, then it will not auto-detect correctly. One day, platforms will fix problems like this, but for the moment it seems we get to live with it.
- Loading branch information
Showing
4 changed files
with
35 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
java_library( | ||
name = "protobuf_lite", | ||
name = "protobuf-lite", | ||
srcs = glob([ | ||
"src/main/java/**/*.java", | ||
]), | ||
# TOOD(zdapeng): fix visibility and deps (https://github.com/google/protobuf/issues/2762) | ||
visibility = ["//protobuf:__pkg__"], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//core", | ||
"@com_google_code_findbugs_jsr305//jar", | ||
"@com_google_guava_guava//jar", | ||
"@com_google_protobuf//:protobuf_java", | ||
], | ||
] + select({ | ||
":android": ["@com_google_protobuf_javalite//:protobuf_java_lite"], | ||
"//conditions:default": ["@com_google_protobuf//:protobuf_java"], | ||
}), | ||
) | ||
|
||
# This config is not fully-reliable. If it breaks, it is probably because you | ||
# are changing --android_crosstool_top. Instead of doing that, you can bind | ||
# your own toolchain on top of the default android/closstool, as mentioned at | ||
# https://github.com/bazelbuild/bazel/issues/3924#issuecomment-338704582 | ||
config_setting( | ||
name = "android", | ||
values = { | ||
"crosstool_top": "//external:android/crosstool", | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters