generated from Apodini/Template-Repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
193 lines (177 loc) · 8.42 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.
//
// This source file is part of the Apodini open source project
//
// SPDX-FileCopyrightText: 2019-2022 Paul Schmiedmayer and the Apodini project authors (see CONTRIBUTORS.md) <[email protected]>
//
// SPDX-License-Identifier: MIT
//
import PackageDescription
let package = Package(
name: "ApodiniMigrator",
platforms: [
.macOS(.v11),
.iOS(.v13)
],
products: [
.library(name: "ApodiniMigratorShared", targets: ["ApodiniMigratorShared"]),
.library(name: "ApodiniMigratorCore", targets: ["ApodiniMigratorCore"]),
.library(name: "ApodiniMigratorClientSupport", targets: ["ApodiniMigratorClientSupport"]),
.library(name: "ApodiniMigratorExporterSupport", targets: ["ApodiniMigratorExporterSupport"]),
.library(name: "ApodiniMigratorCompare", targets: ["ApodiniMigratorCompare"]),
.library(name: "ApodiniMigrator", targets: ["ApodiniMigrator"]),
.library(name: "RESTMigrator", targets: ["RESTMigrator"]),
.library(name: "gRPCMigrator", targets: ["gRPCMigrator"]),
.executable(name: "migrator", targets: ["ApodiniMigratorCLI"]),
.library(name: "ProtocGRPCPluginLibrary", targets: ["ProtocGRPCPluginLibrary"]),
.executable(name: "protoc-gen-grpc-migrator", targets: ["protoc-gen-grpc-migrator"])
],
dependencies: [
.package(url: "https://github.com/Apodini/MetadataSystem.git", .upToNextMinor(from: "0.1.6")),
.package(url: "https://github.com/Apodini/ApodiniTypeInformation.git", .upToNextMinor(from: "0.3.6")),
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.1"),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "0.4.0")),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/omochi/FineJSON.git", from: "1.14.0"),
.package(url: "https://github.com/jpsim/Yams.git", from: "4.0.0"),
.package(url: "https://github.com/apple/swift-collections.git", .upToNextMajor(from: "1.0.0")),
// gRPC
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.18.0"),
// testing runtime crashes
.package(url: "https://github.com/norio-nomura/XCTAssertCrash.git", from: "0.2.0"),
.package(url: "https://github.com/Apodini/ApodiniDocumentExport.git", .upToNextMinor(from: "0.1.0"))
],
targets: [
// The lowest level ApodiniMigrator package providing common API used across several targets, including
// common file extensions, encoding and decoding strategies and output formatting
.target(
name: "ApodiniMigratorShared",
dependencies: [
.product(name: "PathKit", package: "PathKit"),
.product(name: "FineJSON", package: "FineJSON"),
.product(name: "Yams", package: "Yams"),
.product(name: "ApodiniDocumentExport", package: "ApodiniDocumentExport")
]
),
// This target provides any necessary interfaces for Apodini exporters.
.target(
name: "ApodiniMigratorExporterSupport",
dependencies: [
.product(name: "OrderedCollections", package: "swift-collections"),
.product(name: "ApodiniContext", package: "MetadataSystem")
]
),
// The core ApodiniMigrator package. It provides access to the TypeInformation framework and introduces
// the generalized API document.
.target(
name: "ApodiniMigratorCore",
dependencies: [
.target(name: "ApodiniMigratorShared"),
.target(name: "ApodiniMigratorExporterSupport"),
.product(name: "ApodiniTypeInformation", package: "ApodiniTypeInformation"),
.product(name: "Yams", package: "Yams"),
.product(name: "OrderedCollections", package: "swift-collections")
]
),
// This target provides any necessary interfaces for the generated client libraries!
.target(
name: "ApodiniMigratorClientSupport",
dependencies: [
.target(name: "ApodiniMigratorCore")
]
),
// The Compare target builds upon the Core package containing the generalized MigrationGuide
// and all the necessary utilities for the comparison algorithms.
.target(
name: "ApodiniMigratorCompare",
dependencies: [
.target(name: "ApodiniMigratorClientSupport")
]
),
// The Migrator package provides the Migrator Interface. So everything which is required
// to build your own Migrator. LibraryStructure generation, Source Code generation, ...
.target(
name: "ApodiniMigrator",
dependencies: [
.target(name: "ApodiniMigratorCompare"),
.product(name: "Logging", package: "swift-log")
]
),
// This target packages the REST client library generator and migrator.
// Further it contain the template files for the REST client library.
.target(
name: "RESTMigrator",
dependencies: [
.target(name: "ApodiniMigrator"),
.target(name: "ApodiniMigratorCompare"),
.target(name: "ApodiniMigratorClientSupport"),
.product(name: "Logging", package: "swift-log"),
.product(name: "ApodiniDocumentExport", package: "ApodiniDocumentExport")
],
resources: [
.process("Resources")
]
),
// This target packages the gRPC client library generator and migrator.
.target(
name: "gRPCMigrator",
dependencies: [
.target(name: "ApodiniMigrator"),
.product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf")
],
resources: [
.process("Resources")
]
),
.target(
name: "ProtocGRPCPluginLibrary",
dependencies: [
.target(name: "ApodiniMigrator"),
.product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
.product(name: "OrderedCollections", package: "swift-collections")
]
),
.executableTarget(
name: "protoc-gen-grpc-migrator",
dependencies: [
.product(name: "PathKit", package: "PathKit"),
.product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"),
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.target(name: "ProtocGRPCPluginLibrary")
]
),
// This target implements the command line interface of the ApodiniMigrator utility.
// It offers command to generate and migrate client libraries and a sub command
// to compare API documents.
.executableTarget(
name: "ApodiniMigratorCLI",
dependencies: [
.target(name: "RESTMigrator"),
.target(name: "gRPCMigrator"),
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "Logging", package: "swift-log"),
.product(name: "ApodiniDocumentExport", package: "ApodiniDocumentExport")
]
),
// The unified test target.
.testTarget(
name: "ApodiniMigratorTests",
dependencies: [
.target(name: "ApodiniMigratorCore"),
.target(name: "RESTMigrator"),
.target(name: "gRPCMigrator"),
.target(name: "ApodiniMigratorCompare"),
.target(name: "ApodiniMigratorClientSupport"),
.target(name: "ProtocGRPCPluginLibrary"),
.product(name: "XCTAssertCrash", package: "XCTAssertCrash", condition: .when(platforms: [.macOS])),
.product(name: "ApodiniDocumentExport", package: "ApodiniDocumentExport"),
.product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf")
],
resources: [
.process("Resources")
]
)
]
)