Skip to content

Commit 736eed8

Browse files
app-token-plugins[bot]pkwarrenstefanvanburen
authored
Found new plugin versions (#1726)
New plugin versions found. Please review. --------- Co-authored-by: pkwarren <[email protected]> Co-authored-by: Stefan VanBuren <[email protected]>
1 parent 7ee43c2 commit 736eed8

File tree

12 files changed

+139
-0
lines changed

12 files changed

+139
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!Dockerfile
3+
!extramoduleimports.patch
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# syntax=docker/dockerfile:1.12
2+
FROM swift:6.0.3-bookworm AS build
3+
4+
RUN apt-get update \
5+
&& apt-get install -y libstdc++-12-dev
6+
COPY --link extramoduleimports.patch /app/extramoduleimports.patch
7+
WORKDIR /app
8+
RUN git clone --depth 1 --branch 1.29.0 https://github.com/apple/swift-protobuf --recursive
9+
WORKDIR /app/swift-protobuf
10+
RUN git apply /app/extramoduleimports.patch
11+
RUN swift build -c release --static-swift-stdlib -Xlinker -s
12+
13+
FROM gcr.io/distroless/cc-debian12:latest@sha256:b7550f0b15838de14c564337eef2b804ba593ae55d81ca855421bd52f19bb480 AS base
14+
15+
FROM scratch
16+
COPY --link --from=base / /
17+
COPY --link --from=build /app/swift-protobuf/.build/release/protoc-gen-swift .
18+
USER nobody
19+
ENTRYPOINT [ "/protoc-gen-swift" ]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: v1
2+
name: buf.build/apple/swift
3+
plugin_version: v1.29.0
4+
source_url: https://github.com/apple/swift-protobuf
5+
integration_guide_url: https://github.com/apple/swift-protobuf#getting-started
6+
description: Base types for Swift. Generates message and enum types.
7+
output_languages:
8+
- swift
9+
registry:
10+
swift:
11+
deps:
12+
- source: https://github.com/apple/swift-protobuf.git
13+
package: swift-protobuf
14+
swift_versions: [ ".v5", ".v6" ]
15+
products: [ SwiftProtobuf ]
16+
version: 1.29.0
17+
opts:
18+
- Visibility=Public
19+
- FileNaming=PathToUnderscores
20+
spdx_license_id: Apache-2.0
21+
license_url: https://github.com/apple/swift-protobuf/blob/1.29.0/LICENSE.txt
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
diff --git a/Sources/protoc-gen-swift/FileGenerator.swift b/Sources/protoc-gen-swift/FileGenerator.swift
2+
index f0cddb24..e5864211 100644
3+
--- a/Sources/protoc-gen-swift/FileGenerator.swift
4+
+++ b/Sources/protoc-gen-swift/FileGenerator.swift
5+
@@ -149,6 +149,14 @@ class FileGenerator {
6+
return
7+
}
8+
9+
+ let neededCustomImports = generatorOptions.extraModuleImports
10+
+ if !neededCustomImports.isEmpty {
11+
+ p.print()
12+
+ for i in neededCustomImports {
13+
+ p.print("import \(i)\n")
14+
+ }
15+
+ }
16+
+
17+
p.print()
18+
generateVersionCheck(printer: &p)
19+
20+
diff --git a/Sources/protoc-gen-swift/GeneratorOptions.swift b/Sources/protoc-gen-swift/GeneratorOptions.swift
21+
index 3224e138..8bfc1ce5 100644
22+
--- a/Sources/protoc-gen-swift/GeneratorOptions.swift
23+
+++ b/Sources/protoc-gen-swift/GeneratorOptions.swift
24+
@@ -64,6 +64,7 @@ class GeneratorOptions {
25+
}
26+
}
27+
28+
+ let extraModuleImports: [String]
29+
let outputNaming: OutputNaming
30+
let protoToModuleMappings: ProtoFileToModuleMappings
31+
let visibility: Visibility
32+
@@ -74,6 +75,7 @@ class GeneratorOptions {
33+
let visibilitySourceSnippet: String
34+
35+
init(parameter: any CodeGeneratorParameter) throws {
36+
+ var externalModuleImports: [String] = []
37+
var outputNaming: OutputNaming = .fullPath
38+
var moduleMapPath: String?
39+
var visibility: Visibility = .internal
40+
@@ -146,6 +148,15 @@ class GeneratorOptions {
41+
value: pair.value
42+
)
43+
}
44+
+ case "ExtraModuleImports":
45+
+ if !pair.value.isEmpty {
46+
+ externalModuleImports.append(pair.value)
47+
+ } else {
48+
+ throw GenerationError.invalidParameterValue(
49+
+ name: pair.key,
50+
+ value: pair.value
51+
+ )
52+
+ }
53+
default:
54+
throw GenerationError.unknownParameter(name: pair.key)
55+
}
56+
@@ -179,6 +190,7 @@ class GeneratorOptions {
57+
visibilitySourceSnippet = "package "
58+
}
59+
60+
+ self.extraModuleImports = externalModuleImports
61+
self.experimentalStripNonfunctionalCodegen = experimentalStripNonfunctionalCodegen
62+
63+
switch (implementationOnlyImports, useAccessLevelOnImports) {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# syntax=docker/dockerfile:1.12
2+
FROM --platform=$BUILDPLATFORM golang:1.24.0-bookworm AS build
3+
4+
ARG TARGETOS TARGETARCH
5+
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
6+
7+
RUN --mount=type=cache,target=/go/pkg/mod \
8+
go install -ldflags="-s -w" -trimpath github.com/mercari/grpc-federation/cmd/[email protected] \
9+
&& mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-grpc-federation /go/bin/protoc-gen-grpc-federation || true
10+
11+
FROM scratch
12+
COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd
13+
COPY --from=build --link --chown=root:root /go/bin/protoc-gen-grpc-federation .
14+
ENV GOROOT /
15+
USER nobody
16+
ENTRYPOINT [ "/protoc-gen-grpc-federation" ]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: v1
2+
name: buf.build/community/mercari-grpc-federation
3+
plugin_version: v1.9.5
4+
source_url: https://github.com/mercari/grpc-federation
5+
integration_guide_url: https://github.com/mercari/grpc-federation/blob/main/docs/getting_started.md
6+
description: Generates a gRPC server by writing a custom option in Protocol Buffers
7+
output_languages:
8+
- go
9+
spdx_license_id: MIT
10+
license_url: https://github.com/mercari/grpc-federation/blob/v1.9.5/LICENSE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1:2V79rqozuiAEUtD1M8yNEC0x99wWa/swFpqQzak3InA=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1:uoHRiWUJ7qWsF25fxHZTCCk/O+1mLNB1KbObPI6K/pw=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=

0 commit comments

Comments
 (0)