Skip to content

Commit b3b45a6

Browse files
authored
fix: linux issues (#297)
1 parent f853ad1 commit b3b45a6

File tree

6 files changed

+31
-12
lines changed

6 files changed

+31
-12
lines changed

Packages/ClientRuntime/Sources/Serialization/Encoder/XMLEncoder+Extensions.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ import Foundation
77
import XMLCoder
88

99
public typealias XMLEncoder = XMLCoder.XMLEncoder
10-
extension XMLEncoder: RequestEncoder {}
10+
extension XMLEncoder: RequestEncoder {
11+
open func encode<T>(_ value: T) throws -> Data where T: Encodable {
12+
return try encode(value, withRootKey: nil, rootAttributes: nil, header: nil)
13+
}
14+
}

Packages/ClientRuntime/Sources/Serialization/SerializationUtils/CharacterSet+Extension.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// SPDX-License-Identifier: Apache-2.0
66
//
77

8-
import Foundation.NSCharacterSet
8+
import struct Foundation.CharacterSet
99

1010
extension CharacterSet {
1111
public static var singleUrlQueryAllowed: CharacterSet {

Packages/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM swift:5.4-focal
2+
3+
WORKDIR /package
4+
5+
COPY . ./
6+
7+
# to test on al2 swift images uncomment this and comment out other line.
8+
# RUN yum -y install openssl-devel
9+
RUN apt-get update -qq
10+
RUN apt-get -y install libssl-dev
11+
12+
RUN swift package clean
13+
14+
RUN swift build
15+
16+
CMD ["swift", "test", "-Xcc", "-g"]

Packages/Package.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ let excludes = ["README.md"]
77
let package = Package(
88
name: "ClientRuntime",
99
platforms: [
10-
.macOS(.v10_15),
11-
.iOS(.v13)
10+
.macOS(.v10_15),
11+
.iOS(.v13)
1212
],
1313
products: [
1414
.library(name: "ClientRuntime", targets: ["ClientRuntime"]),
@@ -32,16 +32,15 @@ let package = Package(
3232
.testTarget(
3333
name: "ClientRuntimeTests",
3434
dependencies: [
35-
"ClientRuntime",
36-
"SmithyTestUtil"
37-
],
38-
path: "./ClientRuntime/Tests"
35+
"ClientRuntime",
36+
"SmithyTestUtil"
37+
],
38+
path: "./ClientRuntime/Tests"
3939
),
4040
.target(
4141
name: "SmithyTestUtil",
4242
dependencies: ["ClientRuntime"],
43-
path: "./SmithyTestUtil/Sources",
44-
exclude: excludes
43+
path: "./SmithyTestUtil/Sources"
4544
),
4645
.testTarget(
4746
name: "SmithyTestUtilTests",

smithy-swift-codegen/src/test/kotlin/serde/formurl/MapEncodeFormURLGeneratorTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import shouldSyntacticSanityCheck
1111
class MapEncodeFormURLGeneratorTests {
1212
@Test
1313
fun `001 encode different types of maps`() {
14-
val context = setupTests("Isolated/FormUrl/query-maps.smithy", "aws.protocoltests.query#AwsQuery")
14+
val context = setupTests("Isolated/formurl/query-maps.smithy", "aws.protocoltests.query#AwsQuery")
1515
val contents = getFileContents(context.manifest, "/Example/models/QueryMapsInput+Encodable.swift")
1616
contents.shouldSyntacticSanityCheck()
1717
val expectedContents =

smithy-swift-codegen/src/test/kotlin/serde/formurl/QueryIdempotencyTokenAutoFillGeneratorTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import shouldSyntacticSanityCheck
1111
class QueryIdempotencyTokenAutoFillGeneratorTests {
1212
@Test
1313
fun `001 hardcodes action and version into input type`() {
14-
val context = setupTests("Isolated/FormUrl/query-idempotency-token.smithy", "aws.protocoltests.query#AwsQuery")
14+
val context = setupTests("Isolated/formurl/query-idempotency-token.smithy", "aws.protocoltests.query#AwsQuery")
1515
val contents = getFileContents(context.manifest, "/Example/models/QueryIdempotencyTokenAutoFillInput+Encodable.swift")
1616
contents.shouldSyntacticSanityCheck()
1717
val expectedContents =

0 commit comments

Comments
 (0)