Skip to content

Commit 4643f39

Browse files
authored
Merge pull request #10 from yoheimuta/update-swift5
Update swift5
2 parents 6ae6ad7 + 7dfd92b commit 4643f39

File tree

10 files changed

+52
-54
lines changed

10 files changed

+52
-54
lines changed

BufferedLogger.xcodeproj/project.pbxproj

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@
177177
isa = PBXProject;
178178
attributes = {
179179
LastSwiftUpdateCheck = 0920;
180-
LastUpgradeCheck = 0920;
180+
LastUpgradeCheck = 1020;
181181
ORGANIZATIONNAME = "YOSHIMUTA YOHEI";
182182
TargetAttributes = {
183183
FF887062210819340008C1B1 = {
184184
CreatedOnToolsVersion = 9.2;
185-
LastSwiftMigration = 0920;
185+
LastSwiftMigration = 1020;
186186
ProvisioningStyle = Automatic;
187187
};
188188
FF88706B210819350008C1B1 = {
@@ -238,7 +238,7 @@
238238
);
239239
runOnlyForDeploymentPostprocessing = 0;
240240
shellPath = /bin/sh;
241-
shellScript = "set -exo pipefail\n\nPODS_ROOT=./Demo/Pods\n\nif [ -z \"$CI\" ]; then\n ${PODS_ROOT}/SwiftLint/swiftlint autocorrect\n ${PODS_ROOT}/SwiftLint/swiftlint\n\n ${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat BufferedLogger\nelse\n ${PODS_ROOT}/SwiftLint/swiftlint --strict\n ${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat BufferedLogger --dryrun | tee /dev/stderr | grep 'swiftformat completed. 0'\nfi";
241+
shellScript = "set -exo pipefail\n\nPODS_ROOT=./Demo/Pods\n\nif [ -z \"$CI\" ]; then\n ${PODS_ROOT}/SwiftLint/swiftlint autocorrect\n ${PODS_ROOT}/SwiftLint/swiftlint\n\n ${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat BufferedLogger\nelse\n ${PODS_ROOT}/SwiftLint/swiftlint --strict\n ${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat BufferedLogger --dryrun | tee /dev/stderr | grep 'swiftformat completed. 0'\nfi\n";
242242
};
243243
/* End PBXShellScriptBuildPhase section */
244244

@@ -294,13 +294,15 @@
294294
CLANG_WARN_BOOL_CONVERSION = YES;
295295
CLANG_WARN_COMMA = YES;
296296
CLANG_WARN_CONSTANT_CONVERSION = YES;
297+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
297298
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
298299
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
299300
CLANG_WARN_EMPTY_BODY = YES;
300301
CLANG_WARN_ENUM_CONVERSION = YES;
301302
CLANG_WARN_INFINITE_RECURSION = YES;
302303
CLANG_WARN_INT_CONVERSION = YES;
303304
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
305+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
304306
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
305307
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
306308
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -335,6 +337,7 @@
335337
SDKROOT = iphoneos;
336338
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
337339
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
340+
VALID_ARCHS = "$(inherited)";
338341
VERSIONING_SYSTEM = "apple-generic";
339342
VERSION_INFO_PREFIX = "";
340343
};
@@ -354,13 +357,15 @@
354357
CLANG_WARN_BOOL_CONVERSION = YES;
355358
CLANG_WARN_COMMA = YES;
356359
CLANG_WARN_CONSTANT_CONVERSION = YES;
360+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
357361
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
358362
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
359363
CLANG_WARN_EMPTY_BODY = YES;
360364
CLANG_WARN_ENUM_CONVERSION = YES;
361365
CLANG_WARN_INFINITE_RECURSION = YES;
362366
CLANG_WARN_INT_CONVERSION = YES;
363367
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
368+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
364369
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
365370
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
366371
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -388,6 +393,7 @@
388393
SDKROOT = iphoneos;
389394
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
390395
VALIDATE_PRODUCT = YES;
396+
VALID_ARCHS = "$(inherited)";
391397
VERSIONING_SYSTEM = "apple-generic";
392398
VERSION_INFO_PREFIX = "";
393399
};
@@ -411,9 +417,9 @@
411417
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
412418
SKIP_INSTALL = YES;
413419
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
414-
SWIFT_VERSION = 4.0;
420+
SWIFT_VERSION = 5.0;
415421
TARGETED_DEVICE_FAMILY = "1,2";
416-
VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386";
422+
VALID_ARCHS = "$(inherited)";
417423
};
418424
name = Debug;
419425
};
@@ -434,9 +440,9 @@
434440
PRODUCT_BUNDLE_IDENTIFIER = com.github.yoheimuta.BufferedLogger;
435441
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
436442
SKIP_INSTALL = YES;
437-
SWIFT_VERSION = 4.0;
443+
SWIFT_VERSION = 5.0;
438444
TARGETED_DEVICE_FAMILY = "1,2";
439-
VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386";
445+
VALID_ARCHS = "$(inherited)";
440446
};
441447
name = Release;
442448
};

BufferedLogger.xcodeproj/xcshareddata/xcschemes/BufferedLogger.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

BufferedLogger/BufferedOutput.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ final class BufferedOutput {
112112
userInfo: nil,
113113
repeats: true)
114114
DispatchQueue.main.async {
115-
RunLoop.main.add(timer, forMode: .commonModes)
115+
RunLoop.main.add(timer, forMode: RunLoop.Mode.common)
116116
}
117117
self.timer = timer
118118
}

BufferedLogger/Entry.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public struct Entry: Codable, Hashable {
1919
/// identifier is an unique entry ID.
2020
public let identifier: UUID
2121

22-
public var hashValue: Int {
23-
return identifier.hashValue
22+
public func hash(into hasher: inout Hasher) {
23+
hasher.combine(identifier)
2424
}
2525

2626
public static func == (lhs: Entry, rhs: Entry) -> Bool {

Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@
127127
isa = PBXProject;
128128
attributes = {
129129
LastSwiftUpdateCheck = 0920;
130-
LastUpgradeCheck = 0920;
130+
LastUpgradeCheck = 1020;
131131
ORGANIZATIONNAME = "YOSHIMUTA YOHEI";
132132
TargetAttributes = {
133133
FF887085210819670008C1B1 = {
134134
CreatedOnToolsVersion = 9.2;
135+
LastSwiftMigration = 1020;
135136
ProvisioningStyle = Automatic;
136137
};
137138
};
@@ -249,13 +250,15 @@
249250
CLANG_WARN_BOOL_CONVERSION = YES;
250251
CLANG_WARN_COMMA = YES;
251252
CLANG_WARN_CONSTANT_CONVERSION = YES;
253+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
252254
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
253255
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
254256
CLANG_WARN_EMPTY_BODY = YES;
255257
CLANG_WARN_ENUM_CONVERSION = YES;
256258
CLANG_WARN_INFINITE_RECURSION = YES;
257259
CLANG_WARN_INT_CONVERSION = YES;
258260
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
261+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
259262
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
260263
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
261264
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -289,6 +292,7 @@
289292
SDKROOT = iphoneos;
290293
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
291294
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
295+
VALID_ARCHS = "$(inherited)";
292296
};
293297
name = Debug;
294298
};
@@ -306,13 +310,15 @@
306310
CLANG_WARN_BOOL_CONVERSION = YES;
307311
CLANG_WARN_COMMA = YES;
308312
CLANG_WARN_CONSTANT_CONVERSION = YES;
313+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
309314
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
310315
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
311316
CLANG_WARN_EMPTY_BODY = YES;
312317
CLANG_WARN_ENUM_CONVERSION = YES;
313318
CLANG_WARN_INFINITE_RECURSION = YES;
314319
CLANG_WARN_INT_CONVERSION = YES;
315320
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
321+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
316322
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
317323
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
318324
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -339,6 +345,7 @@
339345
SDKROOT = iphoneos;
340346
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
341347
VALIDATE_PRODUCT = YES;
348+
VALID_ARCHS = "$(inherited)";
342349
};
343350
name = Release;
344351
};
@@ -353,7 +360,7 @@
353360
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
354361
PRODUCT_BUNDLE_IDENTIFIER = com.github.yoheimuta.Demo;
355362
PRODUCT_NAME = "$(TARGET_NAME)";
356-
SWIFT_VERSION = 4.0;
363+
SWIFT_VERSION = 5.0;
357364
TARGETED_DEVICE_FAMILY = "1,2";
358365
};
359366
name = Debug;
@@ -369,7 +376,7 @@
369376
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
370377
PRODUCT_BUNDLE_IDENTIFIER = com.github.yoheimuta.Demo;
371378
PRODUCT_NAME = "$(TARGET_NAME)";
372-
SWIFT_VERSION = 4.0;
379+
SWIFT_VERSION = 5.0;
373380
TARGETED_DEVICE_FAMILY = "1,2";
374381
};
375382
name = Release;

Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0920"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -46,7 +45,6 @@
4645
buildConfiguration = "Debug"
4746
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4847
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49-
language = ""
5048
launchStyle = "0"
5149
useCustomWorkingDirectory = "NO"
5250
ignoresPersistentStateOnLaunch = "NO"

Demo/Demo/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1616
var logger: BFLogger!
1717

1818
func application(_: UIApplication,
19-
didFinishLaunchingWithOptions _: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
19+
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2020
let writer = MyWriter()
2121
let config = Config(flushEntryCount: 5,
2222
flushInterval: 10,

Demo/Pods/Pods.xcodeproj/project.pbxproj

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

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://app.bitrise.io/app/75f1a12b7326ea09/status.svg?token=-Wus-j9Iq8IVKcFB3wLhSg&branch=master)](https://app.bitrise.io/app/75f1a12b7326ea09)
44
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
5-
<a href="https://swift.org" target="_blank"><img src="https://img.shields.io/badge/Language-Swift4-orange.svg" alt="Language Swift 4"></a>
5+
<a href="https://swift.org" target="_blank"><img src="https://img.shields.io/badge/Language-Swift5-orange.svg" alt="Language Swift 5"></a>
66

77
BufferedLogger is a tiny but thread-safe logger with a buffering and retrying mechanism for iOS.
88

@@ -18,7 +18,7 @@ You can use this framework...
1818
## Runtime Requirements
1919

2020
- iOS 9.0 or later
21-
- Xcode 9.x - Swift4
21+
- Swift5
2222

2323
## Installation
2424

@@ -121,6 +121,18 @@ You can also define your own custom log entry storage backed by any storage syst
121121

122122
See the EntryStroage protocol for more details.
123123

124+
## Contributing
125+
126+
- Fork it
127+
- Create your feature branch: git checkout -b your-new-feature
128+
- Commit changes: git commit -m 'Add your feature'
129+
- Push to the branch: git push origin your-new-feature
130+
- Submit a pull request
131+
132+
## License
133+
134+
The MIT License (MIT)
135+
124136
# Acknowledgement
125137

126138
Thank you to the Puree-Swift: https://github.com/cookpad/Puree-Swift

0 commit comments

Comments
 (0)