From d23179a95405cbc25e5ad2fdd9992b57880ced9e Mon Sep 17 00:00:00 2001 From: Puppywang Date: Wed, 18 Jan 2023 00:26:30 +0800 Subject: [PATCH 1/2] Add ability to generate javalite binding. --- all/entrypoint.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/all/entrypoint.sh b/all/entrypoint.sh index 02adf877..2c19dece 100755 --- a/all/entrypoint.sh +++ b/all/entrypoint.sh @@ -55,7 +55,7 @@ GEN_PYI=false GEN_TYPESCRIPT=false LINT=false LINT_CHECKS="" -SUPPORTED_LANGUAGES=("go" "ruby" "csharp" "java" "python" "objc" "gogo" "php" "node" "typescript" "web" "cpp" "descriptor_set" "scala") +SUPPORTED_LANGUAGES=("go" "ruby" "csharp" "java" "python" "objc" "gogo" "php" "node" "typescript" "web" "cpp" "descriptor_set" "scala" "javalite") EXTRA_INCLUDES="" OUT_DIR="" GO_SOURCE_RELATIVE="" @@ -364,6 +364,9 @@ ${GO_PACKAGE_MAP}\ plugins=grpc+embedded\ :$OUT_DIR" ;; + "javalite") + GEN_STRING="--grpc_out=lite:$OUT_DIR --java_out=lite:$OUT_DIR --plugin=protoc-gen-grpc=$(which grpc_java_plugin)" + ;; "java") GEN_STRING="--grpc_out=$OUT_DIR --${GEN_LANG}_out=$OUT_DIR --plugin=protoc-gen-grpc=$(which grpc_java_plugin)" ;; From 6f4f8a2d3ccb06bed55716677104c34d19776f92 Mon Sep 17 00:00:00 2001 From: Puppywang Date: Wed, 18 Jan 2023 12:05:52 +0800 Subject: [PATCH 2/2] Add javalite test. --- all/test/all_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/all/test/all_test.go b/all/test/all_test.go index a3fcce3a..097db61c 100644 --- a/all/test/all_test.go +++ b/all/test/all_test.go @@ -128,6 +128,25 @@ func (s *TestSuite) TestAllCases() { }, extraArgs: []string{"-o", "gen/foo/bar"}, }, + "javalite": { + lang: "javalite", + protofileName: "all/test/test.proto", + expectedOutputDir: "gen/pb-javalite", + fileExpectations: []FileExpectation{ + {fileName: "Messages/Test.java"}, + {fileName: "Messages/MessageGrpc.java"}, + }, + }, + "javalite with alternative output dir": { + lang: "javalite", + protofileName: "all/test/test.proto", + expectedOutputDir: "gen/foo/bar", + fileExpectations: []FileExpectation{ + {fileName: "Messages/Test.java"}, + {fileName: "Messages/MessageGrpc.java"}, + }, + extraArgs: []string{"-o", "gen/foo/bar"}, + }, "python": { lang: "python", protofileName: "all/test/test.proto",