Skip to content

Commit 9cdcff3

Browse files
committed
Add package manifest
1 parent 10dcf20 commit 9cdcff3

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

Package.swift

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// swift-tools-version: 6.0
2+
/*
3+
* Copyright 2024, gRPC Authors All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import PackageDescription
19+
20+
let products: [Product] = [
21+
.library(
22+
name: "GRPCProtobuf",
23+
targets: ["GRPCProtobuf"]
24+
),
25+
.executable(
26+
name: "protoc-gen-grpc-swift",
27+
targets: ["protoc-gen-grpc-swift"]
28+
),
29+
]
30+
31+
let dependencies: [Package.Dependency] = [
32+
.package(
33+
path: "/Users/georgebarnett/workspace/scratch/grpc-swift-project/grpc-swift"
34+
),
35+
.package(
36+
url: "https://github.com/apple/swift-protobuf.git",
37+
from: "1.28.1"
38+
),
39+
]
40+
41+
let defaultSwiftSettings: [SwiftSetting] = [
42+
.swiftLanguageMode(.v6),
43+
.enableUpcomingFeature("ExistentialAny"),
44+
.enableUpcomingFeature("InternalImportsByDefault")
45+
]
46+
47+
let targets: [Target] = [
48+
// protoc plugin for grpc-swift
49+
.executableTarget(
50+
name: "protoc-gen-grpc-swift",
51+
dependencies: [
52+
.target(name: "GRPCProtobufCodeGen"),
53+
.product(name: "GRPCCodeGen", package: "grpc-swift"),
54+
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
55+
.product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
56+
]
57+
),
58+
59+
// Runtime serialization components
60+
.target(
61+
name: "GRPCProtobuf",
62+
dependencies: [
63+
.product(name: "GRPCCore", package: "grpc-swift"),
64+
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
65+
],
66+
swiftSettings: defaultSwiftSettings
67+
),
68+
.testTarget(
69+
name: "GRPCProtobufTests",
70+
dependencies: [
71+
.target(name: "GRPCProtobuf"),
72+
.product(name: "GRPCCore", package: "grpc-swift"),
73+
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
74+
]
75+
),
76+
77+
// Code generator library for protoc-gen-grpc-swift
78+
.target(
79+
name: "GRPCProtobufCodeGen",
80+
dependencies: [
81+
.product(name: "GRPCCodeGen", package: "grpc-swift"),
82+
.product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
83+
],
84+
swiftSettings: defaultSwiftSettings
85+
),
86+
.testTarget(
87+
name: "GRPCProtobufCodeGenTests",
88+
dependencies: [
89+
.target(name: "GRPCProtobufCodeGen"),
90+
.product(name: "GRPCCodeGen", package: "grpc-swift"),
91+
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
92+
.product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
93+
]
94+
)
95+
]
96+
97+
let package = Package(
98+
name: "grpc-swift-protobuf",
99+
products: products,
100+
dependencies: dependencies,
101+
targets: targets
102+
)

0 commit comments

Comments
 (0)