Skip to content

Commit ba46a03

Browse files
committed
Update the Swift build setting and test for Swift 4.2
1 parent e43e4ea commit ba46a03

File tree

7 files changed

+13
-18
lines changed

7 files changed

+13
-18
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
4.2

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:4.2
22

33
import PackageDescription
44

Tests/URLQueryItemEncoderTests/URLQueryItemEncoderTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ extension AnyJSONType: Encodable {
8181
case let value as [Encodable]:
8282
var container = encoder.unkeyedContainer()
8383
try container.encode(contentsOf: value.map(AnyJSONType.init))
84-
case let value as Dictionary<String, Encodable>:
84+
case let value as Dictionary<String, Any?>:
8585
var container = encoder.container(keyedBy: AnyJSONAttributeEncodingKey.self)
8686
let sortedValuesByKey = value.sorted(by: { (first, second) -> Bool in
8787
return first.key < second.key
8888
})
8989
for (key, value) in sortedValuesByKey {
90-
let value = AnyJSONType(value)
90+
let value = value.map(AnyJSONType.init)
9191
try container.encode(value, forKey: AnyJSONAttributeEncodingKey(stringValue: key))
9292
}
9393
default: fatalError()

URLQueryItemEncoder.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Pod::Spec.new do |s|
33

44
s.name = "URLQueryItemEncoder"
5-
s.version = "0.2.1"
5+
s.version = "0.2.2"
66
s.summary = "A Swift Encoder for encoding any Encodable value into an array of URLQueryItem."
77

88
s.description = "A Swift Encoder for encoding any Encodable value into an array of URLQueryItem. As part of the SE-0166, Swift has a foundation for any type to define how its value should be archived. This encoder allows you to encode those value into an array of URLQueryItem which represent that value in one command."
@@ -23,6 +23,6 @@ Pod::Spec.new do |s|
2323

2424
s.source_files = "URLQueryItemEncoder"
2525

26-
s.xcconfig = { 'SWIFT_VERSION' => '4.0' }
26+
s.xcconfig = { 'SWIFT_VERSION' => '4.2' }
2727

2828
end

URLQueryItemEncoder.xcodeproj/project.pbxproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@
279279
MTL_ENABLE_DEBUG_INFO = YES;
280280
ONLY_ACTIVE_ARCH = YES;
281281
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx";
282+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
283+
SWIFT_VERSION = 4.2;
282284
};
283285
name = Debug;
284286
};
@@ -330,6 +332,8 @@
330332
MACOSX_DEPLOYMENT_TARGET = 10.10;
331333
MTL_ENABLE_DEBUG_INFO = NO;
332334
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx";
335+
SWIFT_COMPILATION_MODE = wholemodule;
336+
SWIFT_VERSION = 4.2;
333337
VALIDATE_PRODUCT = YES;
334338
};
335339
name = Release;
@@ -350,8 +354,6 @@
350354
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
351355
SKIP_INSTALL = YES;
352356
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
353-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
354-
SWIFT_VERSION = 4.0;
355357
TARGETED_DEVICE_FAMILY = "1,2";
356358
VERSIONING_SYSTEM = "apple-generic";
357359
VERSION_INFO_PREFIX = "";
@@ -373,8 +375,6 @@
373375
PRODUCT_BUNDLE_IDENTIFIER = me.pitiphong.URLQueryItemEncoder;
374376
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
375377
SKIP_INSTALL = YES;
376-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
377-
SWIFT_VERSION = 4.0;
378378
TARGETED_DEVICE_FAMILY = "1,2";
379379
VERSIONING_SYSTEM = "apple-generic";
380380
VERSION_INFO_PREFIX = "";
@@ -391,8 +391,6 @@
391391
PRODUCT_BUNDLE_IDENTIFIER = me.pitiphong.URLQueryItemEncoderTests;
392392
PRODUCT_NAME = "$(TARGET_NAME)";
393393
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
394-
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
395-
SWIFT_VERSION = 4.0;
396394
TARGETED_DEVICE_FAMILY = "1,2";
397395
};
398396
name = Debug;
@@ -406,8 +404,6 @@
406404
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks";
407405
PRODUCT_BUNDLE_IDENTIFIER = me.pitiphong.URLQueryItemEncoderTests;
408406
PRODUCT_NAME = "$(TARGET_NAME)";
409-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
410-
SWIFT_VERSION = 4.0;
411407
TARGETED_DEVICE_FAMILY = "1,2";
412408
};
413409
name = Release;

URLQueryItemEncoder/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.2.1</string>
18+
<string>0.2.2</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

URLQueryItemEncoder/URLQueryItemEncoder.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ protocol URLQueryItemEncoderDateFormatter {
1414
}
1515

1616
extension DateFormatter: URLQueryItemEncoderDateFormatter {}
17-
@available(iOSApplicationExtension 10.0, macOS 10.12, *)
18-
extension ISO8601DateFormatter: URLQueryItemEncoderDateFormatter {
19-
}
17+
@available(iOS 10.0, iOSApplicationExtension 10.0, macOS 10.12, *)
18+
extension ISO8601DateFormatter: URLQueryItemEncoderDateFormatter {}
2019

2120
let iso8601Formatter: URLQueryItemEncoderDateFormatter = {
2221
#if os(Linux)

0 commit comments

Comments
 (0)