Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: protoc-gen-scala support #121

Merged
merged 2 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,28 @@ An all-inclusive `protoc` Docker image.
It started out as https://github.com/znly/docker-protobuf fork, but grew into a stand-alone project.

## What's included:
- [bufbuild/protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate)
- [chrusty/protoc-gen-jsonschema](https://github.com/chrusty/protoc-gen-jsonschema)
- [ckaznocha/protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint)
- [danielvladco/go-proto-gql](https://github.com/danielvladco/go-proto-gql)
- [bufbuild/protoc-gen-validate](https://github.com/bufbuild/protoc-gen-validate)
- [dart-lang/protobuf](https://github.com/dart-lang/protobuf)
- [envoyproxy/protoc-gen-validate](https://github.com/envoyproxy/protoc-gen-validate)
- [gogo/protobuf](https://github.com/gogo/protobuf)
- [golang/protobuf](https://github.com/protocolbuffers/protobuf-go)
- [google/protobuf](https://github.com/google/protobuf)
- [grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway)
- [grpc/grpc](https://github.com/grpc/grpc)
- [grpc/grpc-go](https://github.com/grpc/grpc-go)
- [grpc/grpc-java](https://github.com/grpc/grpc-java)
- [grpc/grpc-swift](https://github.com/grpc/grpc-swift) (not on `arm64`, tracking issue: https://github.com/rvolosatovs/docker-protobuf/issues/89)
- [grpc/grpc-web](https://github.com/grpc/grpc-web)
- [grpc/grpc](https://github.com/grpc/grpc)
- [improbable-eng/ts-protoc-gen](https://github.com/improbable-eng/ts-protoc-gen)
- [infobloxopen/protoc-gen-gorm](https://github.com/infobloxopen/protoc-gen-gorm)
- [moul/protoc-gen-gotemplate](https://github.com/moul/protoc-gen-gotemplate)
- [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