Skip to content

Commit

Permalink
Add protoc v22.1 plugins (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
app-token-plugins[bot] authored Mar 8, 2023
1 parent ac6e8d9 commit 64c66f1
Show file tree
Hide file tree
Showing 61 changed files with 479 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/cpp/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!cpp.cc
!Dockerfile
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/cpp/v22.1/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-cpp",
srcs = ["cpp.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/cpp/v22.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.4
FROM debian:bullseye-20230227 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD cpp.cc plugins/
RUN bazel build '//plugins:protoc-gen-cpp.stripped'

FROM gcr.io/distroless/cc-debian11
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-cpp .
USER nobody
ENTRYPOINT ["/protoc-gen-cpp"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/cpp/v22.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/cpp
plugin_version: v22.1
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for C++. Generates message and enum types.
output_languages:
- cpp
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/cpp/v22.1/cpp.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/cpp/generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::cpp::CppGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/csharp/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!csharp.cc
!Dockerfile
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/csharp/v22.1/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-csharp",
srcs = ["csharp.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/csharp/v22.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.4
FROM debian:bullseye-20230227 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD csharp.cc plugins/
RUN bazel build '//plugins:protoc-gen-csharp.stripped'

FROM gcr.io/distroless/cc-debian11
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-csharp .
USER nobody
ENTRYPOINT ["/protoc-gen-csharp"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/csharp/v22.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/csharp
plugin_version: v22.1
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for C#. Generates message and enum types.
output_languages:
- csharp
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/csharp/v22.1/csharp.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/csharp/csharp_generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::csharp::Generator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/java/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!java.cc
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/java/v22.1/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-java",
srcs = ["java.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/java/v22.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.4
FROM debian:bullseye-20230227 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD java.cc plugins/
RUN bazel build '//plugins:protoc-gen-java.stripped'

FROM gcr.io/distroless/cc-debian11
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-java .
USER nobody
ENTRYPOINT ["/protoc-gen-java"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/java/v22.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/java
plugin_version: v22.1
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for Java. Generates message and enum types.
output_languages:
- java
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/java/v22.1/java.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/java/generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::java::JavaGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/kotlin/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!kotlin.cc
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/kotlin/v22.1/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-kotlin",
srcs = ["kotlin.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/kotlin/v22.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.4
FROM debian:bullseye-20230227 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD kotlin.cc plugins/
RUN bazel build '//plugins:protoc-gen-kotlin.stripped'

FROM gcr.io/distroless/cc-debian11
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-kotlin .
USER nobody
ENTRYPOINT ["/protoc-gen-kotlin"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/kotlin/v22.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/kotlin
plugin_version: v22.1
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for Kotlin. Generates message and enum types.
output_languages:
- kotlin
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/kotlin/v22.1/kotlin.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/java/kotlin_generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::java::KotlinGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/objc/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!objectivec.cc
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/objc/v22.1/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-objectivec",
srcs = ["objectivec.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/objc/v22.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.4
FROM debian:bullseye-20230227 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD objectivec.cc plugins/
RUN bazel build '//plugins:protoc-gen-objectivec.stripped'

FROM gcr.io/distroless/cc-debian11
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-objectivec .
USER nobody
ENTRYPOINT ["/protoc-gen-objectivec"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/objc/v22.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/objc
plugin_version: v22.1
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for Objective-C. Generates message and enum types.
output_languages:
- objective_c
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/objc/v22.1/objectivec.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/objectivec/generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::objectivec::ObjectiveCGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/php/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!php.cc
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/php/v22.1/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-php",
srcs = ["php.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/php/v22.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.4
FROM debian:bullseye-20230227 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD php.cc plugins/
RUN bazel build '//plugins:protoc-gen-php.stripped'

FROM gcr.io/distroless/cc-debian11
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-php .
USER nobody
ENTRYPOINT ["/protoc-gen-php"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/php/v22.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/php
plugin_version: v22.1
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for PHP. Generates message and enum types.
output_languages:
- php
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/php/v22.1/php.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/php/php_generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::php::Generator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
2 changes: 2 additions & 0 deletions plugins/protocolbuffers/pyi/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!Dockerfile
42 changes: 42 additions & 0 deletions plugins/protocolbuffers/pyi/v22.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# syntax=docker/dockerfile:1.4
FROM debian:bullseye-20230227 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/6.1.0/bazel-6.1.0-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v22.1/protobuf-22.1.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
RUN mkdir -p plugins/pyi/
COPY <<'EOF' /build/plugins/pyi/pyi.cc
#include <google/protobuf/compiler/python/pyi_generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::python::PyiGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
EOF
COPY <<'EOF' /build/plugins/pyi/BUILD
cc_binary(
name = "protoc-gen-pyi",
srcs = ["pyi.cc"],
deps = [
"//:protoc_lib",
],
)
EOF
RUN bazel build '//plugins/pyi:protoc-gen-pyi.stripped'

FROM gcr.io/distroless/cc-debian11
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/pyi/protoc-gen-pyi .
USER nobody
ENTRYPOINT ["/protoc-gen-pyi"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/pyi/v22.1/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/pyi
plugin_version: v22.1
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for Python Stubs. Generates stub files for message and enum types.
output_languages:
- python
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v22.1/LICENSE
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/python/v22.1/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!python.cc
Loading

0 comments on commit 64c66f1

Please sign in to comment.