mirror of
https://github.com/apple/swift-protobuf.git
synced 2026-05-17 10:20:36 +00:00
3c93acf277
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>
82 lines
2.4 KiB
Swift
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]
|
|
)
|