44//
55// This source file is part of the Apodini open source project
66//
7- // SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the Apodini project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
7+ // SPDX-FileCopyrightText: 2019-2022 Paul Schmiedmayer and the Apodini project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
88//
99// SPDX-License-Identifier: MIT
1010//
@@ -21,20 +21,28 @@ let package = Package(
2121 . library( name: " ApodiniMigratorShared " , targets: [ " ApodiniMigratorShared " ] ) ,
2222 . library( name: " ApodiniMigratorCore " , targets: [ " ApodiniMigratorCore " ] ) ,
2323 . library( name: " ApodiniMigratorClientSupport " , targets: [ " ApodiniMigratorClientSupport " ] ) ,
24+ . library( name: " ApodiniMigratorExporterSupport " , targets: [ " ApodiniMigratorExporterSupport " ] ) ,
2425 . library( name: " ApodiniMigratorCompare " , targets: [ " ApodiniMigratorCompare " ] ) ,
2526 . library( name: " ApodiniMigrator " , targets: [ " ApodiniMigrator " ] ) ,
2627 . library( name: " RESTMigrator " , targets: [ " RESTMigrator " ] ) ,
27- . executable( name: " migrator " , targets: [ " ApodiniMigratorCLI " ] )
28+ . library( name: " gRPCMigrator " , targets: [ " gRPCMigrator " ] ) ,
29+ . executable( name: " migrator " , targets: [ " ApodiniMigratorCLI " ] ) ,
30+ . library( name: " ProtocGRPCPluginLibrary " , targets: [ " ProtocGRPCPluginLibrary " ] ) ,
31+ . executable( name: " protoc-gen-grpc-migrator " , targets: [ " protoc-gen-grpc-migrator " ] )
2832 ] ,
2933 dependencies: [
30- . package ( url: " https://github.com/Apodini/ApodiniTypeInformation.git " , . upToNextMinor( from: " 0.3.0 " ) ) ,
34+ . package ( url: " https://github.com/Apodini/MetadataSystem.git " , . upToNextMinor( from: " 0.1.6 " ) ) ,
35+ . package ( url: " https://github.com/Apodini/ApodiniTypeInformation.git " , . upToNextMinor( from: " 0.3.6 " ) ) ,
3136 . package ( url: " https://github.com/kylef/PathKit.git " , from: " 1.0.1 " ) ,
3237 . package ( url: " https://github.com/apple/swift-argument-parser " , . upToNextMinor( from: " 0.4.0 " ) ) ,
3338 . package ( url: " https://github.com/apple/swift-log.git " , from: " 1.0.0 " ) ,
3439 . package ( url: " https://github.com/omochi/FineJSON.git " , from: " 1.14.0 " ) ,
3540 . package ( url: " https://github.com/jpsim/Yams.git " , from: " 4.0.0 " ) ,
3641 . package ( url: " https://github.com/apple/swift-collections.git " , . upToNextMajor( from: " 1.0.0 " ) ) ,
3742
43+ // gRPC
44+ . package ( url: " https://github.com/apple/swift-protobuf.git " , from: " 1.18.0 " ) ,
45+
3846 // testing runtime crashes
3947 . package ( url: " https://github.com/norio-nomura/XCTAssertCrash.git " , from: " 0.2.0 " ) ,
4048
@@ -53,26 +61,35 @@ let package = Package(
5361 ]
5462 ) ,
5563
64+ // This target provides any necessary interfaces for Apodini exporters.
65+ . target(
66+ name: " ApodiniMigratorExporterSupport " ,
67+ dependencies: [
68+ . product( name: " OrderedCollections " , package : " swift-collections " ) ,
69+ . product( name: " ApodiniContext " , package : " MetadataSystem " )
70+ ]
71+ ) ,
72+
5673 // The core ApodiniMigrator package. It provides access to the TypeInformation framework and introduces
5774 // the generalized API document.
5875 . target(
5976 name: " ApodiniMigratorCore " ,
6077 dependencies: [
6178 . target( name: " ApodiniMigratorShared " ) ,
79+ . target( name: " ApodiniMigratorExporterSupport " ) ,
6280 . product( name: " ApodiniTypeInformation " , package : " ApodiniTypeInformation " ) ,
6381 . product( name: " Yams " , package : " Yams " ) ,
6482 . product( name: " OrderedCollections " , package : " swift-collections " )
6583 ]
6684 ) ,
6785
68- // This target provides any necessary interfaces for REST client libraries!
86+ // This target provides any necessary interfaces for the generated client libraries!
6987 . target(
7088 name: " ApodiniMigratorClientSupport " ,
7189 dependencies: [
7290 . target( name: " ApodiniMigratorCore " )
7391 ]
7492 ) ,
75-
7693 // The Compare target builds upon the Core package containing the generalized MigrationGuide
7794 // and all the necessary utilities for the comparison algorithms.
7895 . target(
@@ -108,13 +125,46 @@ let package = Package(
108125 ]
109126 ) ,
110127
128+ // This target packages the gRPC client library generator and migrator.
129+ . target(
130+ name: " gRPCMigrator " ,
131+ dependencies: [
132+ . target( name: " ApodiniMigrator " ) ,
133+ . product( name: " SwiftProtobufPluginLibrary " , package : " swift-protobuf " )
134+ ] ,
135+ resources: [
136+ . process( " Resources " )
137+ ]
138+ ) ,
139+
140+ . target(
141+ name: " ProtocGRPCPluginLibrary " ,
142+ dependencies: [
143+ . target( name: " ApodiniMigrator " ) ,
144+ . product( name: " SwiftProtobufPluginLibrary " , package : " swift-protobuf " ) ,
145+ . product( name: " SwiftProtobuf " , package : " swift-protobuf " ) ,
146+ . product( name: " OrderedCollections " , package : " swift-collections " )
147+ ]
148+ ) ,
149+
150+ . executableTarget(
151+ name: " protoc-gen-grpc-migrator " ,
152+ dependencies: [
153+ . product( name: " PathKit " , package : " PathKit " ) ,
154+ . product( name: " SwiftProtobufPluginLibrary " , package : " swift-protobuf " ) ,
155+ . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
156+ . target( name: " ProtocGRPCPluginLibrary " )
157+ ]
158+ ) ,
159+
111160 // This target implements the command line interface of the ApodiniMigrator utility.
112161 // It offers command to generate and migrate client libraries and a sub command
113162 // to compare API documents.
114163 . executableTarget(
115164 name: " ApodiniMigratorCLI " ,
116165 dependencies: [
117166 . target( name: " RESTMigrator " ) ,
167+ . target( name: " gRPCMigrator " ) ,
118168 . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
119169 . product( name: " Logging " , package : " swift-log " ) ,
120170 . product( name: " ApodiniDocumentExport " , package : " ApodiniDocumentExport " )
@@ -125,12 +175,15 @@ let package = Package(
125175 . testTarget(
126176 name: " ApodiniMigratorTests " ,
127177 dependencies: [
128- " ApodiniMigratorCore " ,
129- " RESTMigrator " ,
130- " ApodiniMigratorCompare " ,
131- " ApodiniMigratorClientSupport " ,
178+ . target( name: " ApodiniMigratorCore " ) ,
179+ . target( name: " RESTMigrator " ) ,
180+ . target( name: " gRPCMigrator " ) ,
181+ . target( name: " ApodiniMigratorCompare " ) ,
182+ . target( name: " ApodiniMigratorClientSupport " ) ,
183+ . target( name: " ProtocGRPCPluginLibrary " ) ,
132184 . product( name: " XCTAssertCrash " , package : " XCTAssertCrash " , condition: . when( platforms: [ . macOS] ) ) ,
133- . product( name: " ApodiniDocumentExport " , package : " ApodiniDocumentExport " )
185+ . product( name: " ApodiniDocumentExport " , package : " ApodiniDocumentExport " ) ,
186+ . product( name: " SwiftProtobufPluginLibrary " , package : " swift-protobuf " )
134187 ] ,
135188 resources: [
136189 . process( " Resources " )
0 commit comments