From 39af8b360c62c4655e91477c7d700004d29b371c Mon Sep 17 00:00:00 2001 From: "app-token-plugins[bot]" Date: Mon, 20 Apr 2026 14:43:33 +0000 Subject: [PATCH 1/2] detected new plugin versions --- plugins/apple/swift/v1.37.0/.dockerignore | 3 + plugins/apple/swift/v1.37.0/Dockerfile | 19 ++++++ plugins/apple/swift/v1.37.0/buf.plugin.yaml | 21 +++++++ .../swift/v1.37.0/extramoduleimports.patch | 63 +++++++++++++++++++ .../apple/swift/v1.37.0/eliza/plugin.sum | 1 + .../apple/swift/v1.37.0/petapis/plugin.sum | 1 + 6 files changed, 108 insertions(+) create mode 100644 plugins/apple/swift/v1.37.0/.dockerignore create mode 100644 plugins/apple/swift/v1.37.0/Dockerfile create mode 100644 plugins/apple/swift/v1.37.0/buf.plugin.yaml create mode 100644 plugins/apple/swift/v1.37.0/extramoduleimports.patch create mode 100644 tests/testdata/buf.build/apple/swift/v1.37.0/eliza/plugin.sum create mode 100644 tests/testdata/buf.build/apple/swift/v1.37.0/petapis/plugin.sum diff --git a/plugins/apple/swift/v1.37.0/.dockerignore b/plugins/apple/swift/v1.37.0/.dockerignore new file mode 100644 index 000000000..ff0a69ef1 --- /dev/null +++ b/plugins/apple/swift/v1.37.0/.dockerignore @@ -0,0 +1,3 @@ +* +!Dockerfile +!extramoduleimports.patch diff --git a/plugins/apple/swift/v1.37.0/Dockerfile b/plugins/apple/swift/v1.37.0/Dockerfile new file mode 100644 index 000000000..409b82d59 --- /dev/null +++ b/plugins/apple/swift/v1.37.0/Dockerfile @@ -0,0 +1,19 @@ +# syntax=docker/dockerfile:1.23 +FROM swift:6.3.0-bookworm@sha256:6caf4864fc41f2162aee7189d8e4d6cd79e799540b6b197d0bcf396bf34b94df AS build + +RUN apt-get update \ + && apt-get install -y libstdc++-12-dev unzip +COPY --link extramoduleimports.patch /app/extramoduleimports.patch +WORKDIR /app +RUN git clone --depth 1 --branch 1.37.0 https://github.com/apple/swift-protobuf --recursive +WORKDIR /app/swift-protobuf +RUN git apply /app/extramoduleimports.patch +RUN swift build -c release --static-swift-stdlib -Xlinker -s + +FROM gcr.io/distroless/cc-debian13:latest@sha256:56aaf20ab2523a346a67c8e8f8e8dabe447447d0788b82284d14ad79cd5f93cc AS base + +FROM scratch +COPY --link --from=base / / +COPY --link --from=build /app/swift-protobuf/.build/release/protoc-gen-swift . +USER nobody +ENTRYPOINT [ "/protoc-gen-swift" ] diff --git a/plugins/apple/swift/v1.37.0/buf.plugin.yaml b/plugins/apple/swift/v1.37.0/buf.plugin.yaml new file mode 100644 index 000000000..07b120c64 --- /dev/null +++ b/plugins/apple/swift/v1.37.0/buf.plugin.yaml @@ -0,0 +1,21 @@ +version: v1 +name: buf.build/apple/swift +plugin_version: v1.37.0 +source_url: https://github.com/apple/swift-protobuf +integration_guide_url: https://github.com/apple/swift-protobuf#getting-started +description: Base types for Swift. Generates message and enum types. +output_languages: + - swift +registry: + swift: + deps: + - source: https://github.com/apple/swift-protobuf.git + package: swift-protobuf + swift_versions: [ ".v5", ".v6" ] + products: [ SwiftProtobuf ] + version: 1.37.0 + opts: + - Visibility=Public + - FileNaming=PathToUnderscores +spdx_license_id: Apache-2.0 +license_url: https://github.com/apple/swift-protobuf/blob/1.37.0/LICENSE.txt diff --git a/plugins/apple/swift/v1.37.0/extramoduleimports.patch b/plugins/apple/swift/v1.37.0/extramoduleimports.patch new file mode 100644 index 000000000..df5d623a7 --- /dev/null +++ b/plugins/apple/swift/v1.37.0/extramoduleimports.patch @@ -0,0 +1,63 @@ +diff --git a/Sources/protoc-gen-swift/FileGenerator.swift b/Sources/protoc-gen-swift/FileGenerator.swift +index c9a63a6..750e0e4 100644 +--- a/Sources/protoc-gen-swift/FileGenerator.swift ++++ b/Sources/protoc-gen-swift/FileGenerator.swift +@@ -161,6 +161,14 @@ class FileGenerator { + return + } + ++ let neededCustomImports = generatorOptions.extraModuleImports ++ if !neededCustomImports.isEmpty { ++ p.print() ++ for i in neededCustomImports { ++ p.print("import \(i)\n") ++ } ++ } ++ + p.print() + generateVersionCheck(printer: &p) + +diff --git a/Sources/protoc-gen-swift/GeneratorOptions.swift b/Sources/protoc-gen-swift/GeneratorOptions.swift +index 44594e6..6c6f17c 100644 +--- a/Sources/protoc-gen-swift/GeneratorOptions.swift ++++ b/Sources/protoc-gen-swift/GeneratorOptions.swift +@@ -83,6 +83,7 @@ package class GeneratorOptions { + } + } + ++ let extraModuleImports: [String] + let outputNaming: OutputNaming + let enumGeneration: EnumGeneration + let protoToModuleMappings: ProtoFileToModuleMappings +@@ -113,6 +114,7 @@ package class GeneratorOptions { + } + + init(parameter: any CodeGeneratorParameter) throws { ++ var externalModuleImports: [String] = [] + var outputNaming: OutputNaming = .fullPath + var enumGeneration: EnumGeneration = .none + var moduleMapPath: String? +@@ -195,6 +197,15 @@ package class GeneratorOptions { + value: pair.value + ) + } ++ case "ExtraModuleImports": ++ if !pair.value.isEmpty { ++ externalModuleImports.append(pair.value) ++ } else { ++ throw GenerationError.invalidParameterValue( ++ name: pair.key, ++ value: pair.value ++ ) ++ } + default: + throw GenerationError.unknownParameter(name: pair.key) + } +@@ -229,6 +240,7 @@ package class GeneratorOptions { + visibilitySourceSnippet = "package " + } + ++ self.extraModuleImports = externalModuleImports + self.experimentalStripNonfunctionalCodegen = experimentalStripNonfunctionalCodegen + + switch (implementationOnlyImports, useAccessLevelOnImports) { diff --git a/tests/testdata/buf.build/apple/swift/v1.37.0/eliza/plugin.sum b/tests/testdata/buf.build/apple/swift/v1.37.0/eliza/plugin.sum new file mode 100644 index 000000000..f88e223d3 --- /dev/null +++ b/tests/testdata/buf.build/apple/swift/v1.37.0/eliza/plugin.sum @@ -0,0 +1 @@ +h1:ep7eRBaCZYegnNuYt01ISHnPmoQQfYD3cOiayRryTIU= diff --git a/tests/testdata/buf.build/apple/swift/v1.37.0/petapis/plugin.sum b/tests/testdata/buf.build/apple/swift/v1.37.0/petapis/plugin.sum new file mode 100644 index 000000000..fbd5d63f3 --- /dev/null +++ b/tests/testdata/buf.build/apple/swift/v1.37.0/petapis/plugin.sum @@ -0,0 +1 @@ +h1:o+/kvnlzpyklvikaJbtQBh4B02JI/Nk5DJU5q12mlZw= From 6d14ef3ee032d8c68eb9631e4c24b83e6b137180 Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Mon, 20 Apr 2026 09:54:53 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Philip K. Warren --- plugins/apple/swift/v1.37.0/buf.plugin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/apple/swift/v1.37.0/buf.plugin.yaml b/plugins/apple/swift/v1.37.0/buf.plugin.yaml index 07b120c64..858ad42df 100644 --- a/plugins/apple/swift/v1.37.0/buf.plugin.yaml +++ b/plugins/apple/swift/v1.37.0/buf.plugin.yaml @@ -11,7 +11,7 @@ registry: deps: - source: https://github.com/apple/swift-protobuf.git package: swift-protobuf - swift_versions: [ ".v5", ".v6" ] + swift_versions: [ ".v6" ] products: [ SwiftProtobuf ] version: 1.37.0 opts: