From df14cd35a0329d5e52bea3f7d281d6286214c7a3 Mon Sep 17 00:00:00 2001 From: Wendy Liga Date: Sun, 2 Jun 2019 01:00:32 +0700 Subject: [PATCH 1/3] migrate deprecated hashValue into func hash --- BuildTimeAnalyzer/RawMeasure.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildTimeAnalyzer/RawMeasure.swift b/BuildTimeAnalyzer/RawMeasure.swift index cad4f82..ef8fe35 100644 --- a/BuildTimeAnalyzer/RawMeasure.swift +++ b/BuildTimeAnalyzer/RawMeasure.swift @@ -28,7 +28,7 @@ func ==(lhs: RawMeasure, rhs: RawMeasure) -> Bool { // MARK: Hashable extension RawMeasure: Hashable { - var hashValue: Int { - return time.hashValue ^ text.hashValue + func hash(into hasher: inout Hasher) { + hasher.combine(time.hashValue ^ text.hashValue) } } From d3fff9ed1394f1be25f97ad4b0c6450e13d1d558 Mon Sep 17 00:00:00 2001 From: Wendy Liga Date: Sun, 2 Jun 2019 01:01:01 +0700 Subject: [PATCH 2/3] migrate to swift 5 --- BuildTimeAnalyzer.xcodeproj/project.pbxproj | 13 +++++++------ BuildTimeAnalyzer/ProjectSelection.swift | 2 +- BuildTimeAnalyzer/ViewController.swift | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/BuildTimeAnalyzer.xcodeproj/project.pbxproj b/BuildTimeAnalyzer.xcodeproj/project.pbxproj index a9f1d44..91982b8 100644 --- a/BuildTimeAnalyzer.xcodeproj/project.pbxproj +++ b/BuildTimeAnalyzer.xcodeproj/project.pbxproj @@ -257,11 +257,11 @@ TargetAttributes = { 2AF8213F1D21D6B900D65186 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; }; 2AF8214E1D21D6B900D65186 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; TestTargetID = 2AF8213F1D21D6B900D65186; }; }; @@ -271,6 +271,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -462,7 +463,7 @@ PRODUCT_BUNDLE_IDENTIFIER = uk.co.canemedia.BuildTimeAnalyzer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -476,7 +477,7 @@ PRODUCT_BUNDLE_IDENTIFIER = uk.co.canemedia.BuildTimeAnalyzer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -492,7 +493,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BuildTimeAnalyzer.app/Contents/MacOS/BuildTimeAnalyzer"; }; name = Debug; @@ -508,7 +509,7 @@ PRODUCT_BUNDLE_IDENTIFIER = uk.co.canemedia.BuildTimeAnalyzerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "BuildTimeAnalyzerTests-Bridging-Header.h"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/BuildTimeAnalyzer.app/Contents/MacOS/BuildTimeAnalyzer"; }; name = Release; diff --git a/BuildTimeAnalyzer/ProjectSelection.swift b/BuildTimeAnalyzer/ProjectSelection.swift index 17aacdc..a1be15e 100644 --- a/BuildTimeAnalyzer/ProjectSelection.swift +++ b/BuildTimeAnalyzer/ProjectSelection.swift @@ -52,7 +52,7 @@ extension ProjectSelection: NSTableViewDataSource { extension ProjectSelection: NSTableViewDelegate { func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { - guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.index(of: tableColumn) else { return nil } + guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.firstIndex(of: tableColumn) else { return nil } let cellView = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Cell\(columnIndex)"), owner: self) as? NSTableCellView diff --git a/BuildTimeAnalyzer/ViewController.swift b/BuildTimeAnalyzer/ViewController.swift index 2e9a5e5..aec0458 100644 --- a/BuildTimeAnalyzer/ViewController.swift +++ b/BuildTimeAnalyzer/ViewController.swift @@ -162,7 +162,7 @@ class ViewController: NSViewController { projectSelection.listFolders() } - override func controlTextDidChange(_ obj: Notification) { + func controlTextDidChange(_ obj: Notification) { if let field = obj.object as? NSSearchField, field == searchField { dataSource.filter = searchField.stringValue tableView.reloadData() @@ -288,7 +288,7 @@ extension ViewController: NSTableViewDataSource { extension ViewController: NSTableViewDelegate { func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { - guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.index(of: tableColumn) else { return nil } + guard let tableColumn = tableColumn, let columnIndex = tableView.tableColumns.firstIndex(of: tableColumn) else { return nil } guard let item = dataSource.measure(index: row) else { return nil } let result = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Cell\(columnIndex)"), owner: self) as? NSTableCellView From ca8b9fa8a17d88446f047275ade38d8c67d082f2 Mon Sep 17 00:00:00 2001 From: Wendy Liga Date: Sun, 2 Jun 2019 01:01:31 +0700 Subject: [PATCH 3/3] remove deprecated localization --- BuildTimeAnalyzer.xcodeproj/project.pbxproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/BuildTimeAnalyzer.xcodeproj/project.pbxproj b/BuildTimeAnalyzer.xcodeproj/project.pbxproj index 91982b8..21c8586 100644 --- a/BuildTimeAnalyzer.xcodeproj/project.pbxproj +++ b/BuildTimeAnalyzer.xcodeproj/project.pbxproj @@ -268,10 +268,9 @@ }; buildConfigurationList = 2AF8213B1D21D6B900D65186 /* Build configuration list for PBXProject "BuildTimeAnalyzer" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, );