Skip to content

Commit 46dddf5

Browse files
gRPC Client Library Migrator (#11)
1 parent 8e9b051 commit 46dddf5

410 files changed

Lines changed: 40978 additions & 1643 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ jobs:
2222
packagename: ApodiniMigrator
2323
supportsmacos11: true
2424
testdocc: false
25+
installprotoc: true

.github/workflows/pull_request.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ jobs:
2020
packagename: ApodiniMigrator
2121
supportsmacos11: true
2222
testdocc: false
23+
installprotoc: true
2324
reuse_action:
2425
name: REUSE Compliance Check
25-
uses: Apodini/.github/.github/workflows/reuse.yml@main
26+
uses: Apodini/.github/.github/workflows/reuse.yml@v1
2627
swiftlint:
2728
name: SwiftLint
28-
uses: Apodini/.github/.github/workflows/swiftlint.yml@main
29+
uses: Apodini/.github/.github/workflows/swiftlint.yml@v1

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ on:
1616
jobs:
1717
spm_update:
1818
name: Swift Package Update
19-
uses: Apodini/.github/.github/workflows/spm-update.yml@main
19+
uses: Apodini/.github/.github/workflows/spm-update.yml@v1
2020
secrets:
2121
token: ${{ secrets.ACCESS_TOKEN }}

.swiftlint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
326326
- .build
327327
- .swiftpm
328328
- Sources/RESTMigrator/Resources
329+
- Sources/gRPCMigrator/Resources
329330
- Tests/ApodiniMigratorTests/Resources
330331

331332
closure_body_length: # Closure bodies should not span too many lines.
@@ -359,8 +360,8 @@ identifier_name:
359360
- at
360361

361362
large_tuple: # Tuples shouldn't have too many members. Create a custom type instead.
362-
- 2 # warning - default: 2
363-
- 2 # error - default: 3
363+
- 4 # warning - default: 2
364+
- 4 # error - default: 3
364365

365366
line_length: # Lines should not span too many characters.
366367
warning: 150 # default: 120

Package.resolved

Lines changed: 22 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.resolved.license

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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

Comments
 (0)