Skip to content

Commit 31f444c

Browse files
authored
Merge pull request #216 from fassko/master
Swift 4.2 and Xcode 10 improvements
2 parents 1664e8a + 3453f68 commit 31f444c

File tree

12 files changed

+33
-29
lines changed

12 files changed

+33
-29
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ version: 2
22
jobs:
33
build-and-test:
44
macos:
5-
xcode: "9.3.0"
5+
xcode: "10.0.0"
66
shell: /bin/bash --login -o pipefail
77
steps:
88
- checkout
99
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-macOS" -sdk macosx clean
1010
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-macOS" -sdk macosx -enableCodeCoverage YES test
1111
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-iOS" -sdk iphonesimulator clean
12-
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=11.3,name=iPhone X' -enableCodeCoverage YES test
13-
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV,OS=11.3' clean
14-
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV,OS=11.3' -enableCodeCoverage YES test
12+
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-iOS" -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=12.0,name=iPhone X' -enableCodeCoverage YES test
13+
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV,OS=12.0' clean
14+
- run: xcodebuild -project Cache.xcodeproj -scheme "Cache-tvOS" -destination 'platform=tvOS Simulator,name=Apple TV,OS=12.0' -enableCodeCoverage YES test
1515

1616
workflows:
1717
version: 2
1818
build-and-test:
1919
jobs:
20-
- build-and-test
20+
- build-and-test

.swift-version

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

Cache.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "Cache"
33
s.summary = "Nothing but cache."
4-
s.version = "5.1.0"
4+
s.version = "5.1.1"
55
s.homepage = "https://github.com/hyperoslo/Cache"
66
s.license = 'MIT'
77
s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }
@@ -19,5 +19,5 @@ Pod::Spec.new do |s|
1919

2020
s.frameworks = 'Foundation'
2121

22-
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.1' }
22+
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.2' }
2323
end

Cache.xcodeproj/project.pbxproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,9 @@
497497
D5DC59FA1C205AC9003BD79B /* Tests */,
498498
D5DC59E11C20593E003BD79B /* Products */,
499499
);
500+
indentWidth = 4;
500501
sourceTree = "<group>";
502+
tabWidth = 4;
501503
};
502504
D5DC59E11C20593E003BD79B /* Products */ = {
503505
isa = PBXGroup;
@@ -1109,7 +1111,7 @@
11091111
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-iOS-Tests";
11101112
PRODUCT_NAME = "$(TARGET_NAME)";
11111113
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1112-
SWIFT_VERSION = 3.0;
1114+
SWIFT_VERSION = 4.2;
11131115
};
11141116
name = Debug;
11151117
};
@@ -1122,7 +1124,7 @@
11221124
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
11231125
PRODUCT_BUNDLE_IDENTIFIER = "no.hyper.Cache-iOS-Tests";
11241126
PRODUCT_NAME = "$(TARGET_NAME)";
1125-
SWIFT_VERSION = 3.0;
1127+
SWIFT_VERSION = 4.2;
11261128
};
11271129
name = Release;
11281130
};

Cache.xcodeproj/xcshareddata/xcschemes/Cache-iOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
<TestableReference
32-
skipped = "NO">
32+
skipped = "NO"
33+
parallelizable = "YES"
34+
testExecutionOrdering = "random">
3335
<BuildableReference
3436
BuildableIdentifier = "primary"
3537
BlueprintIdentifier = "D5291D171C2837DB00B702C9"

Cache.xcodeproj/xcshareddata/xcschemes/Cache-macOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
shouldUseLaunchSchemeArgsEnv = "YES">
4444
<Testables>
4545
<TestableReference
46-
skipped = "NO">
46+
skipped = "NO"
47+
parallelizable = "YES"
48+
testExecutionOrdering = "random">
4749
<BuildableReference
4850
BuildableIdentifier = "primary"
4951
BlueprintIdentifier = "D5291D681C283B5400B702C9"

Cache.xcodeproj/xcshareddata/xcschemes/Cache-tvOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
<TestableReference
32-
skipped = "NO">
32+
skipped = "NO"
33+
parallelizable = "YES"
34+
testExecutionOrdering = "random">
3335
<BuildableReference
3436
BuildableIdentifier = "primary"
3537
BlueprintIdentifier = "BDEDD3771DBCEB8A007416A6"

Package.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
// swift-tools-version:4.0
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
1+
// swift-tools-version:4.2
32

43
import PackageDescription
54

65
let package = Package(
76
name: "Cache",
87
products: [
9-
// Products define the executables and libraries produced by a package, and make them visible to other packages.
108
.library(
119
name: "Cache",
1210
targets: ["Cache"]),
1311
],
14-
dependencies: [
15-
// Dependencies declare other packages that this package depends on.
16-
],
12+
dependencies: [],
1713
targets: [
18-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
19-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2014
.target(
2115
name: "Cache",
2216
path: "Source/Shared",

Source/Shared/Storage/DiskStorage.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ final public class DiskStorage<T> {
1616
var onRemove: ((String) -> Void)?
1717

1818
private let transformer: Transformer<T>
19-
20-
// MARK: - Initialization
2119

20+
// MARK: - Initialization
2221
public convenience init(config: DiskConfig, fileManager: FileManager = FileManager.default, transformer: Transformer<T>) throws {
2322
let url: URL
2423
if let directory = config.directory {

Source/Shared/Storage/HybridStorage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ extension HybridStorage: StorageObservationRegistry {
109109
self?.storageObservations.removeValue(forKey: id)
110110
}
111111
}
112-
112+
113113
public func removeAllStorageObservers() {
114114
storageObservations.removeAll()
115115
}
@@ -155,7 +155,7 @@ extension HybridStorage: KeyObservationRegistry {
155155
}
156156

157157
private func notifyObserver(about change: KeyChange<T>, whereKey closure: ((String) -> Bool)) {
158-
let observation = keyObservations.first { key, value in closure(key) }?.value
158+
let observation = keyObservations.first { key, _ in closure(key) }?.value
159159
observation?(self, change)
160160
}
161161

0 commit comments

Comments
 (0)