From 8f3adaf34bf8ba6f3be5a55acd6454e3dac0ff66 Mon Sep 17 00:00:00 2001 From: James Treanor Date: Fri, 29 Mar 2019 15:51:29 +0000 Subject: [PATCH 1/3] Update CocoaPods to 1.6.1 --- Gemfile | 3 +- Gemfile.lock | 40 ++++++++++++-------------- Podfile | 28 +++++++++++------- Podfile.lock | 4 +-- WordPressKit.xcodeproj/project.pbxproj | 22 +++++++------- 5 files changed, 49 insertions(+), 48 deletions(-) diff --git a/Gemfile b/Gemfile index 8efc19fd..8a791e2b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,4 @@ source 'https://rubygems.org' do - gem 'cocoapods', '1.5.3' + gem 'cocoapods', '1.6.1' gem 'cocoapods-repo-update' - gem 'xcpretty' end diff --git a/Gemfile.lock b/Gemfile.lock index fd54d2a4..bfe02b07 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,52 +2,52 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.0) - activesupport (4.2.10) + activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) atomos (0.1.3) claide (1.0.2) - cocoapods (1.5.3) + cocoapods (1.6.1) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.5.3) + cocoapods-core (= 1.6.1) cocoapods-deintegrate (>= 1.0.2, < 2.0) - cocoapods-downloader (>= 1.2.0, < 2.0) + cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.3.0, < 2.0) + cocoapods-trunk (>= 1.3.1, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) - fourflusher (~> 2.0.1) + fourflusher (>= 2.2.0, < 3.0) gh_inspector (~> 1.0) - molinillo (~> 0.6.5) + molinillo (~> 0.6.6) nap (~> 1.0) - ruby-macho (~> 1.1) - xcodeproj (>= 1.5.7, < 2.0) - cocoapods-core (1.5.3) + ruby-macho (~> 1.4) + xcodeproj (>= 1.8.1, < 2.0) + cocoapods-core (1.6.1) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.2) + cocoapods-deintegrate (1.0.4) cocoapods-downloader (1.2.2) cocoapods-plugins (1.0.0) nap cocoapods-repo-update (0.0.4) cocoapods (~> 1.0, >= 1.3.0) cocoapods-search (1.0.0) - cocoapods-stats (1.0.0) + cocoapods-stats (1.1.0) cocoapods-trunk (1.3.1) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.1.0) colored2 (3.1.2) - concurrent-ruby (1.1.3) + concurrent-ruby (1.1.5) escape (0.0.4) - fourflusher (2.0.1) + fourflusher (2.2.0) fuzzy_match (2.0.4) gh_inspector (1.1.3) i18n (0.9.5) @@ -57,27 +57,23 @@ GEM nanaimo (0.2.6) nap (1.1.0) netrc (0.11.0) - rouge (2.0.7) - ruby-macho (1.3.1) + ruby-macho (1.4.0) thread_safe (0.3.6) tzinfo (1.2.5) thread_safe (~> 0.1) - xcodeproj (1.7.0) + xcodeproj (1.8.2) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.2.6) - xcpretty (0.3.0) - rouge (~> 2.0.7) PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.5.3)! + cocoapods (= 1.6.1)! cocoapods-repo-update! - xcpretty! BUNDLED WITH - 1.17.1 + 1.17.2 diff --git a/Podfile b/Podfile index 70948832..88ce385c 100644 --- a/Podfile +++ b/Podfile @@ -6,23 +6,29 @@ use_frameworks! platform :ios, '10.0' plugin 'cocoapods-repo-update' -## WordPress Kit -## ============= -## -target 'WordPressKit' do +def wordpresskit_pods pod 'Alamofire', '~> 4.7.3' pod 'CocoaLumberjack', '3.4.2' pod 'WordPressShared', '~> 1.4' pod 'NSObject-SafeExpectations', '~> 0.0.3' pod 'wpxmlrpc', '0.8.4' pod 'UIDeviceIdentifier', '~> 1.1.4' +end + +## WordPress Kit +## ============= +## +target 'WordPressKit' do + project 'WordPressKit.xcodeproj' + wordpresskit_pods +end - target 'WordPressKitTests' do - inherit! :search_paths +target 'WordPressKitTests' do + project 'WordPressKit.xcodeproj' + wordpresskit_pods - pod 'OHHTTPStubs', '6.1.0' - pod 'OHHTTPStubs/Swift', '6.1.0' - pod 'OCMock', '~> 3.4.2' - pod 'WordPressShared', '~> 1.4' - end + pod 'OHHTTPStubs', '6.1.0' + pod 'OHHTTPStubs/Swift', '6.1.0' + pod 'OCMock', '~> 3.4.2' + pod 'WordPressShared', '~> 1.4' end diff --git a/Podfile.lock b/Podfile.lock index f6fb1255..f0daacd3 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -66,6 +66,6 @@ SPEC CHECKSUMS: WordPressShared: 63d57a4a07ad9f9a1ee5e8a7162e48fbb5192014 wpxmlrpc: 6ba55c773cfa27083ae4a2173e69b19f46da98e2 -PODFILE CHECKSUM: 34d4f957f37c097c360d2863370ce2e5e06511cc +PODFILE CHECKSUM: 2d40a9a3484ab5030d6ddd135b604a0be90271c8 -COCOAPODS: 1.5.3 +COCOAPODS: 1.6.1 diff --git a/WordPressKit.xcodeproj/project.pbxproj b/WordPressKit.xcodeproj/project.pbxproj index f5febe68..b0cb4808 100644 --- a/WordPressKit.xcodeproj/project.pbxproj +++ b/WordPressKit.xcodeproj/project.pbxproj @@ -1998,7 +1998,7 @@ 9368C7721EC5EF1B0092CE8E /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Automattic Inc."; TargetAttributes = { 9368C77A1EC5EF1B0092CE8E = { @@ -2308,32 +2308,32 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-WordPressKitTests/Pods-WordPressKitTests-frameworks.sh", + "${PODS_ROOT}/Target Support Files/Pods-WordPressKitTests/Pods-WordPressKitTests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", "${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework", "${BUILT_PRODUCTS_DIR}/FormatterKit/FormatterKit.framework", - "${BUILT_PRODUCTS_DIR}/WordPressShared/WordPressShared.framework", - "${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework", - "${BUILT_PRODUCTS_DIR}/OHHTTPStubs/OHHTTPStubs.framework", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", "${BUILT_PRODUCTS_DIR}/NSObject-SafeExpectations/NSObject_SafeExpectations.framework", "${BUILT_PRODUCTS_DIR}/UIDeviceIdentifier/UIDeviceIdentifier.framework", + "${BUILT_PRODUCTS_DIR}/WordPressShared/WordPressShared.framework", "${BUILT_PRODUCTS_DIR}/wpxmlrpc/wpxmlrpc.framework", + "${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework", + "${BUILT_PRODUCTS_DIR}/OHHTTPStubs/OHHTTPStubs.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FormatterKit.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WordPressShared.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OCMock.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OHHTTPStubs.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NSObject_SafeExpectations.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UIDeviceIdentifier.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/WordPressShared.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wpxmlrpc.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OCMock.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OHHTTPStubs.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WordPressKitTests/Pods-WordPressKitTests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WordPressKitTests/Pods-WordPressKitTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ From 945e6d0e9736374f1caa380ba8f763e29f9a6178 Mon Sep 17 00:00:00 2001 From: James Treanor Date: Fri, 29 Mar 2019 15:51:47 +0000 Subject: [PATCH 2/3] Fix Xcode 10.2 warnings --- WordPressKit.xcodeproj/project.pbxproj | 5 +++++ .../xcshareddata/xcschemes/WordPressKit.xcscheme | 2 +- .../xcshareddata/xcschemes/WordPressKitTests.xcscheme | 2 +- WordPressKit/BlogJetpackSettingsServiceRemote.swift | 4 ++-- WordPressKit/BlogServiceRemoteREST+Jetpack.swift | 2 +- WordPressKit/ObjectValidation.swift | 4 ++-- WordPressKit/PluginDirectoryServiceRemote.swift | 6 +++--- WordPressKit/PostServiceRemoteREST+Revisions.swift | 2 +- WordPressKitTests/StatsRemoteV2Tests.swift | 3 ++- 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/WordPressKit.xcodeproj/project.pbxproj b/WordPressKit.xcodeproj/project.pbxproj index b0cb4808..51319f11 100644 --- a/WordPressKit.xcodeproj/project.pbxproj +++ b/WordPressKit.xcodeproj/project.pbxproj @@ -2018,6 +2018,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 9368C7711EC5EF1B0092CE8E; @@ -2583,6 +2584,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -2644,6 +2646,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -2790,6 +2793,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -2890,6 +2894,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; diff --git a/WordPressKit.xcodeproj/xcshareddata/xcschemes/WordPressKit.xcscheme b/WordPressKit.xcodeproj/xcshareddata/xcschemes/WordPressKit.xcscheme index 730f3d60..62e711de 100644 --- a/WordPressKit.xcodeproj/xcshareddata/xcschemes/WordPressKit.xcscheme +++ b/WordPressKit.xcodeproj/xcshareddata/xcschemes/WordPressKit.xcscheme @@ -1,6 +1,6 @@ Void) { diff --git a/WordPressKit/ObjectValidation.swift b/WordPressKit/ObjectValidation.swift index fae362d7..8c324434 100644 --- a/WordPressKit/ObjectValidation.swift +++ b/WordPressKit/ObjectValidation.swift @@ -6,7 +6,7 @@ import Foundation /// Validate if a class is a valid NSObject and if it's not nil /// /// - Returns: Bool value - @objc public func wp_isValidObject() -> Bool { + @objc func wp_isValidObject() -> Bool { return !(self is NSNull) } } @@ -17,7 +17,7 @@ import Foundation /// Validate if a class is a valid NSString and if it's not nil /// /// - Returns: Bool value - @objc public func wp_isValidString() -> Bool { + @objc func wp_isValidString() -> Bool { return wp_isValidObject() && self != "" } } diff --git a/WordPressKit/PluginDirectoryServiceRemote.swift b/WordPressKit/PluginDirectoryServiceRemote.swift index 172b8ac5..b5b44684 100644 --- a/WordPressKit/PluginDirectoryServiceRemote.swift +++ b/WordPressKit/PluginDirectoryServiceRemote.swift @@ -37,9 +37,9 @@ public enum PluginDirectoryFeedType: Hashable { return "search:\(term)" } } - - public var hashValue: Int { - return slug.hashValue + + public func hash(into hasher: inout Hasher) { + hasher.combine(slug) } public static func ==(lhs: PluginDirectoryFeedType, rhs: PluginDirectoryFeedType) -> Bool { diff --git a/WordPressKit/PostServiceRemoteREST+Revisions.swift b/WordPressKit/PostServiceRemoteREST+Revisions.swift index 3979a1ad..8bc802ae 100644 --- a/WordPressKit/PostServiceRemoteREST+Revisions.swift +++ b/WordPressKit/PostServiceRemoteREST+Revisions.swift @@ -2,7 +2,7 @@ import Foundation public extension PostServiceRemoteREST { - public func getPostRevisions(for siteId: Int, + func getPostRevisions(for siteId: Int, postId: Int, success: @escaping ([RemoteRevision]?) -> Void, failure: @escaping (Error?) -> Void) { diff --git a/WordPressKitTests/StatsRemoteV2Tests.swift b/WordPressKitTests/StatsRemoteV2Tests.swift index 95cdab83..c5d480b0 100644 --- a/WordPressKitTests/StatsRemoteV2Tests.swift +++ b/WordPressKitTests/StatsRemoteV2Tests.swift @@ -414,8 +414,9 @@ class StatsRemoteV2Tests: RemoteTestCase, RESTTestable { XCTAssertEqual(postDetails?.fetchedDate, date) XCTAssertEqual(postDetails?.totalViewsCount, 163343) + let dailyAverages = 10 + 12 + 12 + 12 + 2 XCTAssertEqual(postDetails?.dailyAveragesPerMonth.count, postDetails?.monthlyBreakdown.count) - XCTAssertEqual(postDetails?.dailyAveragesPerMonth.count, 10 + 12 + 12 + 12 + 2) + XCTAssertEqual(postDetails?.dailyAveragesPerMonth.count, dailyAverages) let feb19Averages = postDetails?.dailyAveragesPerMonth.first { $0.date == DateComponents(year: 2019, month: 2) } XCTAssertNotNil(feb19Averages) From 8ff00858c08626418559beffabf97b5c30ff8616 Mon Sep 17 00:00:00 2001 From: James Treanor Date: Fri, 29 Mar 2019 15:52:13 +0000 Subject: [PATCH 3/3] CircleCI: Use Xcode 10.2 --- .circleci/config.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fd5014d2..1ae04fcf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,18 +2,20 @@ version: 2.1 orbs: # This uses the iOS Orb located at https://github.com/wordpress-mobile/circleci-orbs - ios: wordpress-mobile/ios@0.0.15 + ios: wordpress-mobile/ios@0.0.24 workflows: test_and_validate: jobs: - ios/test: name: Test + xcode-version: "10.2.0" workspace: WordPressKit.xcworkspace scheme: WordPressKitTests - device: iPhone X - ios-version: "12.1" + device: iPhone Xs + ios-version: "12.2" - ios/validate-podspec: name: Validate Podspec + xcode-version: "10.2.0" podspec-path: WordPressKit.podspec update-specs-repo: true