Skip to content

Commit

Permalink
build: add Dart plugin
Browse files Browse the repository at this point in the history
This reverts commit 08a5e34.
  • Loading branch information
rvolosatovs committed Jul 11, 2022
1 parent db073d6 commit f5aa418
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG ALPINE_VERSION
ARG DART_VERSION
ARG GO_VERSION
ARG RUST_VERSION
ARG SWIFT_VERSION
Expand Down Expand Up @@ -284,6 +285,18 @@ ARG TARGETPLATFORM
RUN xx-verify /out/usr/bin/protoc-gen-lint


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 pub install
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 @@ -320,6 +333,7 @@ RUN find /out -name "*.a" -delete -or -name "*.la" -delete
FROM alpine:${ALPINE_VERSION}
LABEL maintainer="Roman Volosatovs <[email protected]>"
COPY --from=upx /out/ /
COPY --from=protoc_gen_dart /out/ /
RUN apk add --no-cache \
bash\
grpc \
Expand All @@ -343,6 +357,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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a
## What's included:
- [ckaznocha/protoc-gen-lint](https://github.com/ckaznocha/protoc-gen-lint)
- [danielvladco/go-proto-gql](https://github.com/danielvladco/go-proto-gql)
- [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)
Expand All @@ -31,6 +32,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.16.2
GO_VERSION=1.18.3
GOOGLE_API_VERSION=727f08ba466745c17f71cd2084540878392de31d
GRPC_GATEWAY_VERSION=2.10.3
GRPC_RUST_VERSION=0.8.3
GRPC_SWIFT_VERSION=1.8.1
GRPC_WEB_VERSION=1.3.1
NODE_VERSION=18.5.0
PROTOC_GEN_DART_VERSION=20.0.0
PROTOC_GEN_DOC_VERSION=1.5.1
PROTOC_GEN_GO_GRPC_VERSION=1.47.0
PROTOC_GEN_GO_VERSION=1.28.0
Expand Down

0 comments on commit f5aa418

Please sign in to comment.