Skip to content

Commit

Permalink
Add support for Scala with ScalaPBC (#165)
Browse files Browse the repository at this point in the history
* Add support for ScalaPBC

* collapse scalapbc into a single run
  • Loading branch information
spoonscen authored Feb 26, 2020
1 parent 290e302 commit f97756a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ RUN set -ex && apk --update --no-cache add \
libstdc++ \
ca-certificates \
nss \
linux-headers
linux-headers \
unzip

WORKDIR /tmp
COPY all/install-protobuf.sh /tmp
Expand Down Expand Up @@ -57,8 +58,13 @@ RUN make -C /go/src/github.com/envoyproxy/protoc-gen-validate/ build

RUN go get -u github.com/mwitkow/go-proto-validators/protoc-gen-govalidators

# Add grpc-web support

# Add scala support
RUN curl -LO https://github.com/scalapb/ScalaPB/releases/download/v0.9.6/protoc-gen-scala-0.9.6-linux-x86_64.zip \
&& unzip protoc-gen-scala-0.9.6-linux-x86_64.zip \
&& chmod +x /tmp/protoc-gen-scala

# Add grpc-web support
RUN curl -sSL https://github.com/grpc/grpc-web/releases/download/${grpc_web}/protoc-gen-grpc-web-${grpc_web}-linux-x86_64 \
-o /tmp/grpc_web_plugin && \
chmod +x /tmp/grpc_web_plugin
Expand Down Expand Up @@ -87,6 +93,8 @@ COPY --from=build /usr/local/bin/prototool /usr/local/bin/prototool
COPY --from=build /go/bin/* /usr/local/bin/
COPY --from=build /tmp/grpc_web_plugin /usr/local/bin/grpc_web_plugin

COPY --from=build /tmp/protoc-gen-scala /usr/local/bin/

COPY --from=build /go/src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options/ /opt/include/protoc-gen-swagger/options/

COPY --from=build /go/src/github.com/envoyproxy/protoc-gen-validate/ /opt/include/
Expand Down
5 changes: 4 additions & 1 deletion all/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ DOCS_FORMAT="html,index.html"
GEN_TYPESCRIPT=false
LINT=false
LINT_CHECKS=""
SUPPORTED_LANGUAGES=("go" "ruby" "csharp" "java" "python" "objc" "gogo" "php" "node" "web" "cpp" "descriptor_set")
SUPPORTED_LANGUAGES=("go" "ruby" "csharp" "java" "python" "objc" "gogo" "php" "node" "web" "cpp" "descriptor_set" "scala")
EXTRA_INCLUDES=""
OUT_DIR=""
GO_SOURCE_RELATIVE=""
Expand Down Expand Up @@ -265,6 +265,9 @@ plugins=grpc+embedded\
"java")
GEN_STRING="--grpc_out=$OUT_DIR --${GEN_LANG}_out=$OUT_DIR --plugin=protoc-gen-grpc=`which protoc-gen-grpc-java`"
;;
"scala")
GEN_STRING="--scala_out=$OUT_DIR --plugin=`which protoc-gen-scala`"
;;
"node")
GEN_STRING="--grpc_out=$OUT_DIR --js_out=import_style=commonjs,binary:$OUT_DIR --plugin=protoc-gen-grpc=`which grpc_${PLUGIN_LANG}_plugin`"
;;
Expand Down

0 comments on commit f97756a

Please sign in to comment.