Skip to content

Commit 64c66f1

Browse files
Add protoc v22.1 plugins (#408)
1 parent ac6e8d9 commit 64c66f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+479
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!cpp.cc
4+
!Dockerfile
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-cpp",
3+
srcs = ["cpp.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM debian:bullseye-20230227 AS build
3+
4+
ARG TARGETARCH
5+
6+
RUN apt-get update \
7+
&& apt-get install -y curl git cmake build-essential g++ unzip zip
8+
RUN arch=${TARGETARCH}; \
9+
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
10+
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
11+
&& chmod +x /usr/local/bin/bazel
12+
13+
WORKDIR /build
14+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
15+
&& tar --strip-components=1 -zxf protoc.tar.gz \
16+
&& rm protoc.tar.gz
17+
RUN bazel build '//:protoc_lib'
18+
COPY --link BUILD cpp.cc plugins/
19+
RUN bazel build '//plugins:protoc-gen-cpp.stripped'
20+
21+
FROM gcr.io/distroless/cc-debian11
22+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-cpp .
23+
USER nobody
24+
ENTRYPOINT ["/protoc-gen-cpp"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/cpp
3+
plugin_version: v22.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for C++. Generates message and enum types.
6+
output_languages:
7+
- cpp
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <google/protobuf/compiler/cpp/generator.h>
2+
#include <google/protobuf/compiler/plugin.h>
3+
4+
int main(int argc, char *argv[]) {
5+
google::protobuf::compiler::cpp::CppGenerator generator;
6+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!csharp.cc
4+
!Dockerfile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-csharp",
3+
srcs = ["csharp.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM debian:bullseye-20230227 AS build
3+
4+
ARG TARGETARCH
5+
6+
RUN apt-get update \
7+
&& apt-get install -y curl git cmake build-essential g++ unzip zip
8+
RUN arch=${TARGETARCH}; \
9+
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
10+
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
11+
&& chmod +x /usr/local/bin/bazel
12+
13+
WORKDIR /build
14+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
15+
&& tar --strip-components=1 -zxf protoc.tar.gz \
16+
&& rm protoc.tar.gz
17+
RUN bazel build '//:protoc_lib'
18+
COPY --link BUILD csharp.cc plugins/
19+
RUN bazel build '//plugins:protoc-gen-csharp.stripped'
20+
21+
FROM gcr.io/distroless/cc-debian11
22+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-csharp .
23+
USER nobody
24+
ENTRYPOINT ["/protoc-gen-csharp"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/csharp
3+
plugin_version: v22.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for C#. Generates message and enum types.
6+
output_languages:
7+
- csharp
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <google/protobuf/compiler/csharp/csharp_generator.h>
2+
#include <google/protobuf/compiler/plugin.h>
3+
4+
int main(int argc, char *argv[]) {
5+
google::protobuf::compiler::csharp::Generator generator;
6+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!Dockerfile
4+
!java.cc
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-java",
3+
srcs = ["java.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM debian:bullseye-20230227 AS build
3+
4+
ARG TARGETARCH
5+
6+
RUN apt-get update \
7+
&& apt-get install -y curl git cmake build-essential g++ unzip zip
8+
RUN arch=${TARGETARCH}; \
9+
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
10+
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
11+
&& chmod +x /usr/local/bin/bazel
12+
13+
WORKDIR /build
14+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
15+
&& tar --strip-components=1 -zxf protoc.tar.gz \
16+
&& rm protoc.tar.gz
17+
RUN bazel build '//:protoc_lib'
18+
COPY --link BUILD java.cc plugins/
19+
RUN bazel build '//plugins:protoc-gen-java.stripped'
20+
21+
FROM gcr.io/distroless/cc-debian11
22+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-java .
23+
USER nobody
24+
ENTRYPOINT ["/protoc-gen-java"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/java
3+
plugin_version: v22.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for Java. Generates message and enum types.
6+
output_languages:
7+
- java
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <google/protobuf/compiler/java/generator.h>
2+
#include <google/protobuf/compiler/plugin.h>
3+
4+
int main(int argc, char *argv[]) {
5+
google::protobuf::compiler::java::JavaGenerator generator;
6+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!Dockerfile
4+
!kotlin.cc
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-kotlin",
3+
srcs = ["kotlin.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM debian:bullseye-20230227 AS build
3+
4+
ARG TARGETARCH
5+
6+
RUN apt-get update \
7+
&& apt-get install -y curl git cmake build-essential g++ unzip zip
8+
RUN arch=${TARGETARCH}; \
9+
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
10+
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
11+
&& chmod +x /usr/local/bin/bazel
12+
13+
WORKDIR /build
14+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
15+
&& tar --strip-components=1 -zxf protoc.tar.gz \
16+
&& rm protoc.tar.gz
17+
RUN bazel build '//:protoc_lib'
18+
COPY --link BUILD kotlin.cc plugins/
19+
RUN bazel build '//plugins:protoc-gen-kotlin.stripped'
20+
21+
FROM gcr.io/distroless/cc-debian11
22+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-kotlin .
23+
USER nobody
24+
ENTRYPOINT ["/protoc-gen-kotlin"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/kotlin
3+
plugin_version: v22.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for Kotlin. Generates message and enum types.
6+
output_languages:
7+
- kotlin
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <google/protobuf/compiler/java/kotlin_generator.h>
2+
#include <google/protobuf/compiler/plugin.h>
3+
4+
int main(int argc, char *argv[]) {
5+
google::protobuf::compiler::java::KotlinGenerator generator;
6+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!Dockerfile
4+
!objectivec.cc
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-objectivec",
3+
srcs = ["objectivec.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM debian:bullseye-20230227 AS build
3+
4+
ARG TARGETARCH
5+
6+
RUN apt-get update \
7+
&& apt-get install -y curl git cmake build-essential g++ unzip zip
8+
RUN arch=${TARGETARCH}; \
9+
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
10+
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
11+
&& chmod +x /usr/local/bin/bazel
12+
13+
WORKDIR /build
14+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
15+
&& tar --strip-components=1 -zxf protoc.tar.gz \
16+
&& rm protoc.tar.gz
17+
RUN bazel build '//:protoc_lib'
18+
COPY --link BUILD objectivec.cc plugins/
19+
RUN bazel build '//plugins:protoc-gen-objectivec.stripped'
20+
21+
FROM gcr.io/distroless/cc-debian11
22+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-objectivec .
23+
USER nobody
24+
ENTRYPOINT ["/protoc-gen-objectivec"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/objc
3+
plugin_version: v22.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for Objective-C. Generates message and enum types.
6+
output_languages:
7+
- objective_c
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <google/protobuf/compiler/objectivec/generator.h>
2+
#include <google/protobuf/compiler/plugin.h>
3+
4+
int main(int argc, char *argv[]) {
5+
google::protobuf::compiler::objectivec::ObjectiveCGenerator generator;
6+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!Dockerfile
4+
!php.cc
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-php",
3+
srcs = ["php.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM debian:bullseye-20230227 AS build
3+
4+
ARG TARGETARCH
5+
6+
RUN apt-get update \
7+
&& apt-get install -y curl git cmake build-essential g++ unzip zip
8+
RUN arch=${TARGETARCH}; \
9+
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
10+
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
11+
&& chmod +x /usr/local/bin/bazel
12+
13+
WORKDIR /build
14+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
15+
&& tar --strip-components=1 -zxf protoc.tar.gz \
16+
&& rm protoc.tar.gz
17+
RUN bazel build '//:protoc_lib'
18+
COPY --link BUILD php.cc plugins/
19+
RUN bazel build '//plugins:protoc-gen-php.stripped'
20+
21+
FROM gcr.io/distroless/cc-debian11
22+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-php .
23+
USER nobody
24+
ENTRYPOINT ["/protoc-gen-php"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/php
3+
plugin_version: v22.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for PHP. Generates message and enum types.
6+
output_languages:
7+
- php
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <google/protobuf/compiler/php/php_generator.h>
2+
#include <google/protobuf/compiler/plugin.h>
3+
4+
int main(int argc, char *argv[]) {
5+
google::protobuf::compiler::php::Generator generator;
6+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# syntax=docker/dockerfile:1.4
2+
FROM debian:bullseye-20230227 AS build
3+
4+
ARG TARGETARCH
5+
6+
RUN apt-get update \
7+
&& apt-get install -y curl git cmake build-essential g++ unzip zip
8+
RUN arch=${TARGETARCH}; \
9+
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
10+
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
11+
&& chmod +x /usr/local/bin/bazel
12+
13+
WORKDIR /build
14+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
15+
&& tar --strip-components=1 -zxf protoc.tar.gz \
16+
&& rm protoc.tar.gz
17+
RUN bazel build '//:protoc_lib'
18+
RUN mkdir -p plugins/pyi/
19+
COPY <<'EOF' /build/plugins/pyi/pyi.cc
20+
#include <google/protobuf/compiler/python/pyi_generator.h>
21+
#include <google/protobuf/compiler/plugin.h>
22+
23+
int main(int argc, char *argv[]) {
24+
google::protobuf::compiler::python::PyiGenerator generator;
25+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
26+
}
27+
EOF
28+
COPY <<'EOF' /build/plugins/pyi/BUILD
29+
cc_binary(
30+
name = "protoc-gen-pyi",
31+
srcs = ["pyi.cc"],
32+
deps = [
33+
"//:protoc_lib",
34+
],
35+
)
36+
EOF
37+
RUN bazel build '//plugins/pyi:protoc-gen-pyi.stripped'
38+
39+
FROM gcr.io/distroless/cc-debian11
40+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/pyi/protoc-gen-pyi .
41+
USER nobody
42+
ENTRYPOINT ["/protoc-gen-pyi"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/pyi
3+
plugin_version: v22.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for Python Stubs. Generates stub files for message and enum types.
6+
output_languages:
7+
- python
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!Dockerfile
4+
!python.cc

0 commit comments

Comments
 (0)