Skip to content

Commit

Permalink
feat: protoc-gen-scala support
Browse files Browse the repository at this point in the history
  • Loading branch information
strophy authored and rvolosatovs committed Jan 3, 2023
1 parent 36933ed commit 8aef971
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
"depNameTemplate": "stepancheg/rust-protobuf",
"datasourceTemplate": "github-tags"
},
{
"fileMatch": ["^deps\\.list$"],
"matchStrings": ["PROTOC_GEN_SCALA_VERSION=(?<currentValue>.*?)\\n"],
"depNameTemplate": "scalapb/ScalaPB",
"datasourceTemplate": "github-releases"
},
{
"fileMatch": ["^deps\\.list$"],
"matchStrings": ["PROTOC_GEN_TS_VERSION=(?<currentValue>.*?)\\n"],
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ jobs:
PROTOC_GEN_JSONSCHEMA_VERSION=${{ env.PROTOC_GEN_JSONSCHEMA_VERSION }}
PROTOC_GEN_LINT_VERSION=${{ env.PROTOC_GEN_LINT_VERSION }}
PROTOC_GEN_RUST_VERSION=${{ env.PROTOC_GEN_RUST_VERSION }}
PROTOC_GEN_SCALA_VERSION=${{ env.PROTOC_GEN_SCALA_VERSION }}
PROTOC_GEN_TS_VERSION=${{ env.PROTOC_GEN_TS_VERSION }}
PROTOC_GEN_VALIDATE_VERSION=${{ env.PROTOC_GEN_VALIDATE_VERSION }}
RUST_IMAGE_VERSION=${{ env.RUST_IMAGE_VERSION }}
SCALA_SBT_IMAGE_VERSION=${{ env.SCALA_SBT_IMAGE_VERSION }}
SWIFT_IMAGE_VERSION=${{ env.SWIFT_IMAGE_VERSION }}
UPX_VERSION=${{ env.UPX_VERSION }}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG DART_IMAGE_VERSION
ARG GO_IMAGE_VERSION
ARG NODE_IMAGE_VERSION
ARG RUST_IMAGE_VERSION
ARG SCALA_SBT_IMAGE_VERSION
ARG SWIFT_IMAGE_VERSION


Expand Down Expand Up @@ -324,6 +325,17 @@ RUN pkg \
/usr/local/lib/node_modules/ts-protoc-gen
RUN install -D protoc-gen-ts /out/usr/bin/protoc-gen-ts

FROM sbtscala/scala-sbt:${SCALA_SBT_IMAGE_VERSION} as protoc_gen_scala
RUN mkdir -p /scala-protobuf
ARG PROTOC_GEN_SCALA_VERSION
RUN curl -sSL https://api.github.com/repos/scalapb/ScalaPB/tarball/${PROTOC_GEN_SCALA_VERSION} | tar xz --strip 1 -C /scala-protobuf
WORKDIR /scala-protobuf
RUN gu install native-image
# Make sbt use the version of native-image installed by gu instead of downloading a separate version
ARG NATIVE_IMAGE_INSTALLED=true
RUN ./make_reflect_config.sh
RUN sbt protocGenScalaNativeImage/nativeImage
RUN install -D /scala-protobuf/target/protoc-gen-scala /out/usr/bin/protoc-gen-scala

FROM dart:${DART_IMAGE_VERSION} as protoc_gen_dart
RUN apt-get update
Expand Down Expand Up @@ -358,6 +370,7 @@ COPY --from=protoc_gen_gql /out/ /out/
COPY --from=protoc_gen_jsonschema /out/ /out/
COPY --from=protoc_gen_lint /out/ /out/
COPY --from=protoc_gen_rust /out/ /out/
COPY --from=protoc_gen_scala /out/ /out/
COPY --from=protoc_gen_validate /out/ /out/
ARG TARGETARCH
RUN <<EOF
Expand Down Expand Up @@ -422,6 +435,7 @@ RUN protoc-wrapper \
--python_out=/test \
--ruby_out=/test \
--rust_out=/test \
--scala_out=/test \
--ts_out=/test \
--validate_out=lang=go:/test \
google/protobuf/any.proto
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a
- [mwitkow/go-proto-validators](https://github.com/mwitkow/go-proto-validators)
- [protobuf-c/protobuf-c](https://github.com/protobuf-c/protobuf-c)
- [pseudomuto/protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc)
- [scalapb/scalapb](https://github.com/scalapb/scalapb)
- [stepancheg/grpc-rust](https://github.com/stepancheg/grpc-rust)
- [stepancheg/rust-protobuf](https://github.com/stepancheg/rust-protobuf)

Expand All @@ -42,6 +43,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a
- Python
- Ruby
- Rust
- Scala
- Swift
- Typescript

Expand Down
2 changes: 2 additions & 0 deletions deps.list
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ PROTOC_GEN_GQL_VERSION=v0.8.0
PROTOC_GEN_JSONSCHEMA_VERSION=1.3.10
PROTOC_GEN_LINT_VERSION=v0.3.0
PROTOC_GEN_RUST_VERSION=v3.2.0
PROTOC_GEN_SCALA_VERSION=v0.11.12
PROTOC_GEN_TS_VERSION=0.15.0
PROTOC_GEN_VALIDATE_VERSION=v0.9.1
RUST_IMAGE_VERSION=1.66.0-alpine3.16
SCALA_SBT_IMAGE_VERSION=graalvm-ce-21.3.0-java17_1.8.0_3.2.1
SWIFT_IMAGE_VERSION=5.7-focal
UPX_VERSION=4.0.1

0 comments on commit 8aef971

Please sign in to comment.