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

Add Dart plugin #99

Merged
merged 5 commits into from
Nov 29, 2022
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
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1.4

ARG ALPINE_VERSION
ARG DART_VERSION
ARG GO_VERSION
ARG NODE_VERSION
ARG RUST_VERSION
Expand Down Expand Up @@ -307,6 +308,18 @@ RUN pkg \
RUN install -D protoc-gen-ts /out/usr/bin/protoc-gen-ts


FROM dart:${DART_VERSION} as protoc_gen_dart
RUN apt-get update
RUN apt-get install -y curl
RUN mkdir -p /dart-protobuf
ARG PROTOC_GEN_DART_VERSION
RUN curl -sSL https://api.github.com/repos/google/protobuf.dart/tarball/protoc_plugin-v${PROTOC_GEN_DART_VERSION} | tar xz --strip 1 -C /dart-protobuf
WORKDIR /dart-protobuf/protoc_plugin
RUN dart pub get
RUN dart compile exe --verbose bin/protoc_plugin.dart -o protoc_plugin
RUN install -D /dart-protobuf/protoc_plugin/protoc_plugin /out/usr/bin/protoc-gen-dart


FROM --platform=$BUILDPLATFORM alpine_host as upx
RUN mkdir -p /upx
ARG BUILDARCH BUILDOS UPX_VERSION
Expand Down Expand Up @@ -344,17 +357,15 @@ FROM alpine:${ALPINE_VERSION}
LABEL maintainer="Roman Volosatovs <[email protected]>"
COPY --from=upx /out/ /
COPY --from=protoc_gen_ts /out/ /
COPY --from=protoc_gen_dart /out/ /
COPY --from=protoc_gen_dart /runtime/ /
RUN apk add --no-cache \
bash\
bash \
grpc \
grpc-java \
protobuf \
protobuf-dev \
protobuf-c-compiler
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk
RUN apk add --force-overwrite glibc-2.35-r0.apk
RUN rm -f glibc-2.35-r0.apk
RUN ln -s /usr/bin/grpc_cpp_plugin /usr/bin/protoc-gen-grpc-cpp
RUN ln -s /usr/bin/grpc_csharp_plugin /usr/bin/protoc-gen-grpc-csharp
RUN ln -s /usr/bin/grpc_node_plugin /usr/bin/protoc-gen-grpc-js
Expand All @@ -368,6 +379,7 @@ COPY protoc-wrapper /usr/bin/protoc-wrapper
RUN mkdir -p /test
RUN protoc-wrapper \
--c_out=/test \
--dart_out=/test \
--go_out=/test \
--gotemplate_out=/test \
--govalidators_out=/test \
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a
- [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)
- [mwitkow/go-proto-validators](https://github.com/mwitkow/go-proto-validators)
- [gogo/protobuf](https://github.com/gogo/protobuf)
- [golang/protobuf](https://github.com/protocolbuffers/protobuf-go)
Expand All @@ -32,6 +34,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a
- C
- C#
- C++
- Dart
- Go
- Java / JavaNano (Android)
- JavaScript
Expand Down
2 changes: 2 additions & 0 deletions deps.list
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ALPINE_VERSION=3.16
DART_VERSION=2.18.5
GO_VERSION=1.19.3
GOOGLE_API_VERSION=9de27c9c549173eac194ec80153963234a05a8b5
GRPC_GATEWAY_VERSION=2.14.0
GRPC_RUST_VERSION=0.8.3
GRPC_SWIFT_VERSION=1.13.0
GRPC_WEB_VERSION=1.4.2
NODE_VERSION=18.5.0
PROTOC_GEN_DART_VERSION=20.0.1
PROTOC_GEN_DOC_VERSION=1.5.1
PROTOC_GEN_GO_GRPC_VERSION=1.51.0
PROTOC_GEN_GO_VERSION=1.28.1
Expand Down