Files
Franz Busch 3c93acf277 Support well known proto types in Swift PM plugin (#2044)
Fixes #1943 and supersedes #1979.

This PR adds support for well known types in the Swift PM plugin by
either:
- Looking for the types next to the binary when the env variable or a
direct protoc path is specified
- Looking for the source directory of our vendored protobuf repo

Co-authored-by: Thomas Van Lenten <thomasvl@google.com>
2026-05-07 08:42:52 -04:00

82 lines
2.4 KiB
Swift

// swift-tools-version: 6.1
import PackageDescription
let package = Package(
name: "PluginExamples",
dependencies: [
.package(path: "../")
],
targets: [
.target(
name: "Simple",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
plugins: [
.plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf")
]
),
.target(
name: "Nested",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
plugins: [
.plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf")
]
),
.target(
name: "Import",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
plugins: [
.plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf")
]
),
.target(
name: "AccessLevelOnImport",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
swiftSettings: [
.enableExperimentalFeature("AccessLevelOnImport")
],
plugins: [
.plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf")
]
),
.target(
name: "CustomProtoPath",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
plugins: [
.plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf")
]
),
.target(
name: "UsesWKTs",
dependencies: [
.product(name: "SwiftProtobuf", package: "swift-protobuf")
],
plugins: [
.plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf")
]
),
.testTarget(
name: "ExampleTests",
dependencies: [
.target(name: "Simple"),
.target(name: "Nested"),
.target(name: "Import"),
.target(name: "AccessLevelOnImport"),
.target(name: "CustomProtoPath"),
.target(name: "UsesWKTs"),
]
),
],
swiftLanguageModes: [.v6]
)