Skip to content

Commit 40078b1

Browse files
author
Robert Gummesson
committed
Updated to the latest Swift syntax
1 parent 1f207be commit 40078b1

8 files changed

Lines changed: 22 additions & 12 deletions

File tree

BuildTimeAnalyzer.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@
252252
isa = PBXProject;
253253
attributes = {
254254
LastSwiftUpdateCheck = 0730;
255-
LastUpgradeCheck = 0900;
255+
LastUpgradeCheck = 0930;
256256
ORGANIZATIONNAME = "Cane Media Ltd";
257257
TargetAttributes = {
258258
2AF8213F1D21D6B900D65186 = {
@@ -362,12 +362,14 @@
362362
CLANG_WARN_BOOL_CONVERSION = YES;
363363
CLANG_WARN_COMMA = YES;
364364
CLANG_WARN_CONSTANT_CONVERSION = YES;
365+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
365366
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
366367
CLANG_WARN_EMPTY_BODY = YES;
367368
CLANG_WARN_ENUM_CONVERSION = YES;
368369
CLANG_WARN_INFINITE_RECURSION = YES;
369370
CLANG_WARN_INT_CONVERSION = YES;
370371
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
372+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
371373
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
372374
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
373375
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -415,12 +417,14 @@
415417
CLANG_WARN_BOOL_CONVERSION = YES;
416418
CLANG_WARN_COMMA = YES;
417419
CLANG_WARN_CONSTANT_CONVERSION = YES;
420+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
418421
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
419422
CLANG_WARN_EMPTY_BODY = YES;
420423
CLANG_WARN_ENUM_CONVERSION = YES;
421424
CLANG_WARN_INFINITE_RECURSION = YES;
422425
CLANG_WARN_INT_CONVERSION = YES;
423426
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
427+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
424428
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
425429
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
426430
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

BuildTimeAnalyzer.xcodeproj/xcshareddata/xcschemes/BuildTimeAnalyzer.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 = "0900"
3+
LastUpgradeVersion = "0930"
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"

BuildTimeAnalyzer/CompileMeasure.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import Foundation
4343
let filename = untrimmedFilename?.split(separator: ":").map(String.init).first else { return nil }
4444

4545
let locationString = String(rawPath[filepath.endIndex...].dropFirst())
46-
let locations = locationString.split(separator: ":").flatMap{ Int(String.init($0)) }
46+
let locations = locationString.split(separator: ":").compactMap{ Int(String.init($0)) }
4747
guard locations.count == 2 else { return nil }
4848

4949
self.time = time

BuildTimeAnalyzer/DerivedDataManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DerivedDataManager {
1313
let folders = DerivedDataManager.listFolders(at: url)
1414
let fileManager = FileManager.default
1515

16-
return folders.flatMap{ (url) -> File? in
16+
return folders.compactMap{ (url) -> File? in
1717
if url.lastPathComponent != "ModuleCache",
1818
let properties = try? fileManager.attributesOfItem(atPath: url.path),
1919
let modificationDate = properties[FileAttributeKey.modificationDate] as? Date {

BuildTimeAnalyzer/ProjectSelection.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ class ProjectSelection: NSObject {
1414
@IBOutlet weak var tableView: NSTableView!
1515
weak var delegate: ProjectSelectionDelegate?
1616

17-
fileprivate var dataSource: [XcodeDatabase] = []
17+
private var dataSource: [XcodeDatabase] = []
1818

19-
static fileprivate let dateFormatter: DateFormatter = {
19+
static private let dateFormatter: DateFormatter = {
2020
let dateFormatter = DateFormatter()
2121
dateFormatter.timeStyle = .short
2222
dateFormatter.dateStyle = .medium
2323
return dateFormatter
2424
}()
2525

2626
func listFolders() {
27-
dataSource = DerivedDataManager.derivedData().flatMap{
27+
dataSource = DerivedDataManager.derivedData().compactMap{
2828
XcodeDatabase(fromPath: $0.url.appendingPathComponent("Logs/Build/Cache.db").path)
2929
}.sorted(by: { $0.modificationDate > $1.modificationDate })
3030

BuildTimeAnalyzer/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class ViewController: NSViewController {
2222
@IBOutlet weak var tableView: NSTableView!
2323
@IBOutlet weak var tableViewContainerView: NSScrollView!
2424

25-
fileprivate let dataSource = ViewControllerDataSource()
25+
private let dataSource = ViewControllerDataSource()
2626

2727
private var currentKey: String?
2828
private var nextDatabase: XcodeDatabase?

BuildTimeAnalyzer/ViewControllerDataSource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class ViewControllerDataSource {
2828
}
2929
}
3030

31-
fileprivate var originalData = [CompileMeasure]()
32-
fileprivate var processedData = [CompileMeasure]()
31+
private var originalData = [CompileMeasure]()
32+
private var processedData = [CompileMeasure]()
3333

3434
func resetSourceData(newSourceData: [CompileMeasure]) {
3535
originalData = newSourceData

0 commit comments

Comments
 (0)