Skip to content

Commit 2f74b74

Browse files
authored
chore: Project cleanup (#437)
1 parent 9d11142 commit 2f74b74

File tree

16 files changed

+50
-175
lines changed

16 files changed

+50
-175
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ Package.resolved
1818
**/xcuserdata
1919
**/*.xcuserdata
2020
xcuserdata
21-
.build/
21+
.build/
22+
.vscode

CircleciScripts/pre_start_iOS_simulator.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

Package.swift

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
11
// swift-tools-version:5.4
2+
23
import PackageDescription
3-
let excludes = ["README.md"]
4+
45

56
let package = Package(
67
name: "ClientRuntime",
78
platforms: [
8-
.macOS(.v10_15),
9-
.iOS(.v13)
9+
.macOS(.v10_15),
10+
.iOS(.v13)
1011
],
1112
products: [
1213
.library(name: "ClientRuntime", targets: ["ClientRuntime"]),
1314
.library(name: "SmithyTestUtil", targets: ["SmithyTestUtil"])
1415
],
1516
dependencies: [
16-
.package(name: "AwsCrt", url: "https://github.com/awslabs/aws-crt-swift.git", from: "0.2.2"),
17+
.package(url: "https://github.com/awslabs/aws-crt-swift.git", from: "0.2.2"),
1718
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
1819
.package(url: "https://github.com/MaxDesiatov/XMLCoder.git", from: "0.13.0")
1920
],
2021
targets: [
2122
.target(
2223
name: "ClientRuntime",
2324
dependencies: [
24-
.product(name: "AwsCommonRuntimeKit", package: "AwsCrt"),
25+
.product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"),
2526
.product(name: "Logging", package: "swift-log"),
2627
.product(name: "XMLCoder", package: "XMLCoder")
2728
],
28-
path: "./Packages/ClientRuntime/Sources",
29-
exclude: excludes
29+
path: "./Packages/ClientRuntime/Sources"
3030
),
3131
.testTarget(
3232
name: "ClientRuntimeTests",
33-
dependencies: [
34-
"ClientRuntime",
35-
"SmithyTestUtil"
36-
],
37-
path: "./Packages/ClientRuntime/Tests"
33+
dependencies: ["ClientRuntime", "SmithyTestUtil"],
34+
path: "./Packages/ClientRuntime/Tests"
3835
),
3936
.target(
4037
name: "SmithyTestUtil",

Packages/ClientRuntime/ClientRuntime.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

Packages/ClientRuntime/Info.plist

Lines changed: 0 additions & 22 deletions
This file was deleted.

Packages/ClientRuntime/Sources/Networking/Http/CRT/CRTClientEngine.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ import Darwin
1111
#endif
1212

1313
public class CRTClientEngine: HttpClientEngine {
14+
15+
// Swiftlint is treating this `actor` declaration as a function.
16+
// I am not sure but I think it is because Swiftlint is out-of-date
17+
// on our CI. Until CI can be updated, I am disabling the warning
18+
// generated by this actor declaration.
19+
//
20+
// swiftlint:disable:next function_body_length
1421
actor SerialExecutor {
1522
private var logger: LogAgent
1623

@@ -92,13 +99,9 @@ public class CRTClientEngine: HttpClientEngine {
9299
let connection = try await connectionMgr.acquireConnection()
93100
self.logger.debug("Connection was acquired to: \(String(describing: request.endpoint.url?.absoluteString))")
94101
return try await withCheckedThrowingContinuation({ (continuation: StreamContinuation) in
95-
do {
96-
let requestOptions = makeHttpRequestStreamOptions(request, continuation)
97-
let stream = try connection.makeRequest(requestOptions: requestOptions)
98-
try stream.activate()
99-
} catch {
100-
continuation.resume(throwing: error)
101-
}
102+
let requestOptions = makeHttpRequestStreamOptions(request, continuation)
103+
let stream = connection.makeRequest(requestOptions: requestOptions)
104+
stream.activate()
102105
})
103106
}
104107

Packages/ClientRuntime/Sources/Networking/Http/Middlewares/URLPathMiddleware.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public struct URLPathMiddleware<OperationStackInput: URLPathProvider,
2424
Self.MOutput == H.Output,
2525
Self.Context == H.Context {
2626
guard var urlPath = input.urlPath else {
27-
throw SdkError<OperationStackError>.client(ClientError.pathCreationFailed("Creating the url path failed, a required property in the path was nil"))
27+
let message = "Creating the url path failed, a required property in the path was nil"
28+
let innerError = ClientError.pathCreationFailed(message)
29+
throw SdkError<OperationStackError>.client(innerError)
2830
}
2931
if let urlPrefix = urlPrefix, !urlPrefix.isEmpty {
3032
urlPath = "\(urlPrefix)\(urlPath)"

Packages/ClientRuntime/Sources/Networking/Http/SdkHttpRequest.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@ extension SdkHttpRequest: CustomDebugStringConvertible, CustomStringConvertible
5858
}
5959

6060
public var debugDescription: String {
61-
return "\(method.rawValue.uppercased()) \(endpoint.protocolType ?? ProtocolType.https):\(endpoint.port) \n Path: \(endpoint.path), \n \(headers) \n \(String(describing: queryItems))"
61+
description
6262
}
6363

6464
public var description: String {
65-
return "\(method.rawValue.uppercased()) \(endpoint.protocolType ?? ProtocolType.https):\(endpoint.port) \n Path: \(endpoint.path) \n \(headers) \n \(String(describing: queryItems))"
65+
let method = method.rawValue.uppercased()
66+
let protocolType = endpoint.protocolType ?? ProtocolType.https
67+
let query = String(describing: queryItems)
68+
return "\(method) \(protocolType):\(endpoint.port) \n Path: \(endpoint.path) \n \(headers) \n \(query)"
6669
}
6770
}
6871

Packages/ClientRuntime/Sources/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

Packages/ClientRuntime/Sources/Serialization/FormURL/Encoder/FormURLKeyedEncoding.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ struct FormURLKeyedEncoding<Key: CodingKey>: KeyedEncodingContainerProtocol {
8181
try value.encode(to: stringsEncoding)
8282
}
8383

84-
mutating func nestedContainer<NestedKey: CodingKey>(keyedBy keyType: NestedKey.Type, forKey key: Key) -> KeyedEncodingContainer<NestedKey> {
84+
mutating func nestedContainer<NestedKey: CodingKey>(keyedBy keyType: NestedKey.Type,
85+
forKey key: Key) -> KeyedEncodingContainer<NestedKey> {
8586
var container = FormURLKeyedEncoding<NestedKey>(to: data)
8687
container.codingPath = codingPath + [key]
8788
return KeyedEncodingContainer(container)

0 commit comments

Comments
 (0)