Skip to content

Commit 0934c59

Browse files
committed
add dart
1 parent 45af0c9 commit 0934c59

File tree

2 files changed

+41
-11
lines changed

2 files changed

+41
-11
lines changed

buf.gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ plugins:
1818
- local: protoc-gen-js
1919
out: gen/ts
2020
opt: import_style=commonjs,binary
21-
- remote: buf.build/protocolbuffers/dart:v21.1.2
21+
- local: protoc-gen-dart
2222
out: gen/dart/lib
2323
opt: grpc

images/dev-go/Dockerfile

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
# THE TAG IN update-dev-tag.sh AND RUN IT #
44
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
55

6+
# dart's protoc plugin does not publish pre-builds,
7+
# so we have to build it ourselves
8+
# This builder will produce the statically linked binary
9+
# /build/protoc_plugin/bin/protoc_plugin
10+
11+
# based on debian 12 (bookworm-slim)
12+
FROM dart:3.6.0-sdk AS dart-builder
13+
14+
WORKDIR /build
15+
16+
# TODO: renovate
17+
ENV DART_PROTOC_PLUGIN_VERSION=21.1.2
18+
RUN curl -fsSL https://github.com/google/protobuf.dart/archive/refs/tags/protoc_plugin-v${DART_PROTOC_PLUGIN_VERSION}.tar.gz | \
19+
tar -xz --strip-components=1 \
20+
&& cd protoc_plugin \
21+
&& dart pub get \
22+
&& dart compile exe bin/protoc_plugin.dart \
23+
&& rm /build/* -rf
24+
25+
626
# based on the debian 12 ("bookworm") go image
727
# for now this only builds x86_64 images (TODO)
828
FROM golang:1.23-bookworm
@@ -53,6 +73,24 @@ RUN wget https://github.com/authzed/zed/releases/download/v${ZED_VERSION}/zed_${
5373
&& apt install -y ./zed.deb \
5474
&& rm zed.deb
5575

76+
77+
# install javascript proto plugin and grpc-web codegen
78+
# https://github.com/protocolbuffers/protobuf-javascript/
79+
# TODO: renovate
80+
ENV PROTOC_JS_VERSION=3.21.4
81+
RUN wget -qO- https://github.com/protocolbuffers/protobuf-javascript/releases/download/v${PROTOC_JS_VERSION}/protobuf-javascript-${PROTOC_JS_VERSION}-linux-x86_64.tar.gz \
82+
| tar -xz --strip-components=1 -C /usr/local/bin bin/protoc-gen-js
83+
84+
# TODO: renovate
85+
ENV PROTOC_WEB_VERSION=1.5.0
86+
RUN wget -q https://github.com/grpc/grpc-web/releases/download/${PROTOC_WEB_VERSION}/protoc-gen-grpc-web-${PROTOC_WEB_VERSION}-linux-x86_64 \
87+
-O /usr/local/bin/protoc-gen-grpc-web \
88+
&& chmod +x /usr/local/bin/protoc-gen-grpc-web
89+
90+
# install dart protoc plugin
91+
COPY --from=dart-builder /build/protoc_plugin/bin/protoc_plugin.exe /usr/local/bin/protoc-gen-dart
92+
93+
5694
# clean up apt artifacts,
5795
# dont use apt after this line
5896
RUN apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
@@ -124,21 +162,13 @@ ENV GO_INJECT_TAG_VERSION=1.4.0
124162
RUN go install github.com/favadi/protoc-go-inject-tag@v${GO_INJECT_TAG_VERSION} \
125163
&& go clean -modcache
126164

127-
165+
# install go proto plugin and grpc codegen
166+
# https://protobuf.dev/getting-started/gotutorial/
128167
# TODO: renovate
129168
RUN go install google.golang.org/protobuf/cmd/[email protected]
130169
RUN go install google.golang.org/grpc/cmd/[email protected]
131170
ENV PATH="$PATH:$(go env GOPATH)/bin"
132171

133-
# TODO: renovate
134-
ENV PROTOC_JS_VERSION=3.21.4
135-
RUN wget -qO- https://github.com/protocolbuffers/protobuf-javascript/releases/download/v${PROTOC_JS_VERSION}/protobuf-javascript-${PROTOC_JS_VERSION}-linux-x86_64.tar.gz \
136-
| tar -xz --strip-components=1 -C /usr/local/bin bin/protoc-gen-js
137-
138-
ENV PROTOC_WEB_VERSION=1.5.0
139-
RUN wget -q https://github.com/grpc/grpc-web/releases/download/${PROTOC_WEB_VERSION}/protoc-gen-grpc-web-${PROTOC_WEB_VERSION}-linux-x86_64 \
140-
-O /usr/local/bin/protoc-gen-grpc-web
141-
142172
# install gofumpt, a stricter gofmt
143173
# https://github.com/mvdan/gofumpt
144174
# renovate: datasource=github-releases depName=mvdan/gofumpt

0 commit comments

Comments
 (0)