Skip to content

Commit 2e66cbf

Browse files
committed
Update WordPressShared, WordPressKit, and WordPressAuthenticator
1 parent 2e9e096 commit 2e66cbf

File tree

12 files changed

+69
-172
lines changed

12 files changed

+69
-172
lines changed

Podfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ workspace 'WordPress.xcworkspace'
2020
## ===================================
2121
##
2222
def wordpress_shared
23-
pod 'WordPressShared', '~> 1.18.0'
23+
pod 'WordPressShared', '~> 2.0.0-beta.1'
2424
# pod 'WordPressShared', :git => 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', :tag => ''
25-
# pod 'WordPressShared', :git => 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', :branch => ''
25+
# pod 'WordPressShared', :git => 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', :branch => 'delete-cocoalumberjack'
2626
# pod 'WordPressShared', :git => 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', :commit => ''
2727
# pod 'WordPressShared', :path => '../WordPress-iOS-Shared'
2828
end
@@ -47,7 +47,7 @@ def wordpress_ui
4747
end
4848

4949
def wordpress_kit
50-
pod 'WordPressKit', '~> 4.58', '>= 4.58.2'
50+
pod 'WordPressKit', '~> 5.0'
5151
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :tag => ''
5252
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :branch => ''
5353
# pod 'WordPressKit', :git => 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', :commit => ''
@@ -63,7 +63,7 @@ end
6363

6464
def shared_with_all_pods
6565
wordpress_shared
66-
pod 'CocoaLumberjack', '~> 3.0'
66+
pod 'CocoaLumberjack/Swift', '~> 3.0'
6767
pod 'NSObject-SafeExpectations', '~> 0.0.4'
6868
end
6969

@@ -233,8 +233,8 @@ abstract_target 'Apps' do
233233

234234
pod 'Gridicons', '~> 1.1.0'
235235

236-
pod 'WordPressAuthenticator', '~> 3.2', '>= 3.2.2'
237-
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: 'fix/prologue-nav-bar'
236+
pod 'WordPressAuthenticator', '~> 5.0'
237+
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: 'trunk'
238238
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
239239
# 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'
240240

Podfile.lock

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ PODS:
2727
- boost (1.76.0)
2828
- BVLinearGradient (2.5.6-wp-3):
2929
- React-Core
30-
- CocoaLumberjack (3.7.4):
31-
- CocoaLumberjack/Core (= 3.7.4)
32-
- CocoaLumberjack/Core (3.7.4)
30+
- CocoaLumberjack/Core (3.8.0)
31+
- CocoaLumberjack/Swift (3.8.0):
32+
- CocoaLumberjack/Core
3333
- CropViewController (2.5.3)
3434
- DoubleConversion (1.1.5)
3535
- Down (0.6.6)
@@ -42,9 +42,6 @@ PODS:
4242
- React-jsi (= 0.69.4)
4343
- ReactCommon/turbomodule/core (= 0.69.4)
4444
- fmt (6.2.1)
45-
- FormatterKit/Resources (1.9.0)
46-
- FormatterKit/TimeIntervalFormatter (1.9.0):
47-
- FormatterKit/Resources
4845
- FSInteractiveMap (0.1.0)
4946
- Gifu (3.2.0)
5047
- glog (0.3.5)
@@ -505,29 +502,24 @@ PODS:
505502
- WordPress-Aztec-iOS (1.19.8)
506503
- WordPress-Editor-iOS (1.19.8):
507504
- WordPress-Aztec-iOS (= 1.19.8)
508-
- WordPressAuthenticator (3.2.2):
509-
- Alamofire (~> 4.8)
510-
- CocoaLumberjack (~> 3.5)
505+
- WordPressAuthenticator (5.0.0):
511506
- GoogleSignIn (~> 6.0.1)
512507
- Gridicons (~> 1.0)
513508
- "NSURL+IDN (= 0.4)"
514509
- SVProgressHUD (~> 2.2.5)
515-
- WordPressKit (~> 4.18-beta)
516-
- WordPressShared (~> 1.12-beta)
510+
- WordPressKit (~> 5.0-beta)
511+
- WordPressShared (~> 2.0-beta)
517512
- WordPressUI (~> 1.7-beta)
518-
- WordPressKit (4.58.2):
513+
- WordPressKit (5.0.0):
519514
- Alamofire (~> 4.8.0)
520-
- CocoaLumberjack (~> 3.4)
521515
- NSObject-SafeExpectations (= 0.0.4)
522516
- UIDeviceIdentifier (~> 2.0)
523-
- WordPressShared (~> 1.15-beta)
517+
- WordPressShared (~> 2.0-beta)
524518
- wpxmlrpc (~> 0.9)
525-
- WordPressShared (1.18.0):
526-
- CocoaLumberjack (~> 3.4)
527-
- FormatterKit/TimeIntervalFormatter (~> 1.8)
519+
- WordPressShared (2.0.0-beta.2)
528520
- WordPressUI (1.12.5)
529521
- WPMediaPicker (1.8.7)
530-
- wpxmlrpc (0.9.0)
522+
- wpxmlrpc (0.10.0)
531523
- Yoga (1.14.0)
532524
- ZendeskCommonUISDK (6.1.2)
533525
- ZendeskCoreSDK (2.5.1)
@@ -553,7 +545,7 @@ DEPENDENCIES:
553545
- Automattic-Tracks-iOS (~> 0.13)
554546
- boost (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.86.0-alpha1/third-party-podspecs/boost.podspec.json`)
555547
- BVLinearGradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.86.0-alpha1/third-party-podspecs/BVLinearGradient.podspec.json`)
556-
- CocoaLumberjack (~> 3.0)
548+
- CocoaLumberjack/Swift (~> 3.0)
557549
- CropViewController (= 2.5.3)
558550
- Down (~> 0.6.6)
559551
- FBLazyVector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.86.0-alpha1/third-party-podspecs/FBLazyVector.podspec.json`)
@@ -617,9 +609,9 @@ DEPENDENCIES:
617609
- Starscream (= 3.0.6)
618610
- SVProgressHUD (= 2.2.5)
619611
- WordPress-Editor-iOS (~> 1.19.8)
620-
- WordPressAuthenticator (>= 3.2.2, ~> 3.2)
621-
- WordPressKit (>= 4.58.2, ~> 4.58)
622-
- WordPressShared (~> 1.18.0)
612+
- WordPressAuthenticator (~> 5.0)
613+
- WordPressKit (~> 5.0)
614+
- WordPressShared (~> 2.0.0-beta.1)
623615
- WordPressUI (~> 1.12.5)
624616
- WPMediaPicker (~> 1.8.7)
625617
- Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.86.0-alpha1/third-party-podspecs/Yoga.podspec.json`)
@@ -629,7 +621,6 @@ DEPENDENCIES:
629621
SPEC REPOS:
630622
https://github.com/wordpress-mobile/cocoapods-specs.git:
631623
- WordPressAuthenticator
632-
- WordPressKit
633624
trunk:
634625
- Alamofire
635626
- AlamofireImage
@@ -642,7 +633,6 @@ SPEC REPOS:
642633
- DoubleConversion
643634
- Down
644635
- fmt
645-
- FormatterKit
646636
- Gifu
647637
- GoogleSignIn
648638
- Gridicons
@@ -667,6 +657,7 @@ SPEC REPOS:
667657
- UIDeviceIdentifier
668658
- WordPress-Aztec-iOS
669659
- WordPress-Editor-iOS
660+
- WordPressKit
670661
- WordPressShared
671662
- WordPressUI
672663
- WPMediaPicker
@@ -809,14 +800,13 @@ SPEC CHECKSUMS:
809800
Automattic-Tracks-iOS: 63e55654f500b3e8fb35087e64575e00d12eb2f5
810801
boost: 32a63928ef0a5bf8b60f6b930c8864113fa28779
811802
BVLinearGradient: 708898fab8f7113d927b0ef611a321e759f6ad3e
812-
CocoaLumberjack: 543c79c114dadc3b1aba95641d8738b06b05b646
803+
CocoaLumberjack: 78abfb691154e2a9df8ded4350d504ee19d90732
813804
CropViewController: a5c143548a0fabcd6cc25f2d26e40460cfb8c78c
814805
DoubleConversion: e22e0762848812a87afd67ffda3998d9ef29170c
815806
Down: 71bf4af3c04fa093e65dffa25c4b64fa61287373
816807
FBLazyVector: 16fdf30fcbc7177c6a4bdf35ef47225577eb9636
817808
FBReactNativeSpec: e3694d0bbf17c0373609c975874d46a6b2abe5b7
818809
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
819-
FormatterKit: 184db51bf120b633693a73624a4cede89ec51a41
820810
FSInteractiveMap: a396f610f48b76cb540baa87139d056429abda86
821811
Gifu: 7bcb6427457d85e0b4dff5a84ec5947ac19a93ea
822812
glog: 741689bdd65551bc8fb59d633e55c34293030d3e
@@ -886,12 +876,12 @@ SPEC CHECKSUMS:
886876
UIDeviceIdentifier: e6a801d25f4f178de5bdf475ffe29050d0148176
887877
WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504
888878
WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345
889-
WordPressAuthenticator: 5110c62de1b1b1eb1f2a43fd2599f7f6c7a6659d
890-
WordPressKit: d8bc00bce09273fc241cf171b0e61ef8f4f29479
891-
WordPressShared: e5a479220643f46dc4d7726ef8dd45f18bf0c53b
879+
WordPressAuthenticator: 0cdf1bff75bd3f58fe733d6457221f27bbbdc9f4
880+
WordPressKit: 202f529323b079a344f7bc1493b7ebebfd9ed4b5
881+
WordPressShared: 04403b43f821c4ed2b84a2112ef9f64f1e7cdceb
892882
WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac
893883
WPMediaPicker: 0d45dfd7b3c5651c5236ffd48c1b0b2f60a2d5d2
894-
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
884+
wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd
895885
Yoga: 5e12f4deb20582f86f6323e1cdff25f07afc87f6
896886
ZendeskCommonUISDK: 5f0a83f412e07ae23701f18c412fe783b3249ef5
897887
ZendeskCoreSDK: 19a18e5ef2edcb18f4dbc0ea0d12bd31f515712a
@@ -902,6 +892,6 @@ SPEC CHECKSUMS:
902892
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
903893
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37
904894

905-
PODFILE CHECKSUM: a876aebc08ec34fe6fa739f5f791205e49652cb5
895+
PODFILE CHECKSUM: 9af091bb10792bbb9b62ec19e42e83082cfbb414
906896

907897
COCOAPODS: 1.11.2

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
21.4
22
-----
33
* [*] Share extension navigation bar is no longer transparent [#19700]
4+
* [*] [Internal] Update WordPressShared, WordPressKit, and WordPressAuthenticator to their latest versions. [#19643]
45

56
21.3
67
-----

WordPress/Classes/System/WordPress-Bridging-Header.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,5 @@
129129
#import <WordPressShared/WPTableViewCell.h>
130130
#import <WordPressShared/WPAnalytics.h>
131131
#import <WordPressUI/UIImage+Util.h>
132+
133+
FOUNDATION_EXTERN void SetCocoaLumberjackObjCLogLevel(NSUInteger ddLogLevelRawValue);

WordPress/Classes/System/WordPressAppDelegate.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ class WordPressAppDelegate: UIResponder, UIApplicationDelegate {
7171

7272
private let loggingStack = WPLoggingStack()
7373

74-
private lazy var tracksLogger = TracksLogger()
75-
7674
/// Access the crash logging type
7775
class var crashLogging: CrashLogging? {
7876
shared?.loggingStack.crashLogging
@@ -295,7 +293,11 @@ class WordPressAppDelegate: UIResponder, UIApplicationDelegate {
295293
configureAppCenterSDK()
296294
configureAppRatingUtility()
297295

298-
TracksLogging.delegate = tracksLogger
296+
let libraryLogger = WordPressLibraryLogger()
297+
TracksLogging.delegate = libraryLogger
298+
WPSharedSetLoggingDelegate(libraryLogger)
299+
WPKitSetLoggingDelegate(libraryLogger)
300+
WPAuthenticatorSetLoggingDelegate(libraryLogger)
299301

300302
printDebugLaunchInfoWithLaunchOptions(launchOptions)
301303
toggleExtraDebuggingIfNeeded()
@@ -768,8 +770,8 @@ extension WordPressAppDelegate {
768770
}
769771

770772
@objc class func setLogLevel(_ level: DDLogLevel) {
771-
WPSharedSetLoggingLevel(level)
772-
WPAuthenticatorSetLoggingLevel(level)
773+
SetCocoaLumberjackObjCLogLevel(level.rawValue)
774+
CocoaLumberjack.dynamicLogLevel = level
773775
}
774776
}
775777

Lines changed: 15 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,27 @@
11
import Foundation
22
import CocoaLumberjack
33

4-
// June 14 2017 - @astralbodies
5-
// Taken from CocoaLumberjack repository - reproduced to prevent issue with
6-
// CocoaPods and some weird bug with frameworks
7-
8-
// Software License Agreement (BSD License)
9-
//
10-
// Copyright (c) 2014-2016, Deusty, LLC
11-
// All rights reserved.
12-
//
13-
// Redistribution and use of this software in source and binary forms,
14-
// with or without modification, are permitted provided that the following conditions are met:
15-
//
16-
// * Redistributions of source code must retain the above copyright notice,
17-
// this list of conditions and the following disclaimer.
18-
//
19-
// * Neither the name of Deusty nor the names of its contributors may be used
20-
// to endorse or promote products derived from this software without specific
21-
// prior written permission of Deusty, LLC.
22-
23-
extension DDLogFlag {
24-
public static func from(_ logLevel: DDLogLevel) -> DDLogFlag {
25-
return DDLogFlag(rawValue: logLevel.rawValue)
26-
}
27-
28-
public init(_ logLevel: DDLogLevel) {
29-
self = DDLogFlag(rawValue: logLevel.rawValue)
30-
}
31-
32-
///returns the log level, or the lowest equivalant.
33-
public func toLogLevel() -> DDLogLevel {
34-
if let ourValid = DDLogLevel(rawValue: rawValue) {
35-
return ourValid
36-
} else {
37-
if contains(.verbose) {
38-
return .verbose
39-
} else if contains(.debug) {
40-
return .debug
41-
} else if contains(.info) {
42-
return .info
43-
} else if contains(.warning) {
44-
return .warning
45-
} else if contains(.error) {
46-
return .error
47-
} else {
48-
return .off
49-
}
50-
}
51-
}
52-
}
53-
54-
public var defaultDebugLevel = DDLogLevel.verbose
55-
56-
public func resetDefaultDebugLevel() {
57-
defaultDebugLevel = DDLogLevel.verbose
58-
}
59-
60-
public func _DDLogMessage(_ message: @autoclosure () -> String, level: DDLogLevel, flag: DDLogFlag, context: Int, file: StaticString, function: StaticString, line: UInt, tag: Any?, asynchronous: Bool, ddlog: DDLog) {
61-
if level.rawValue & flag.rawValue != 0 {
62-
// Tell the DDLogMessage constructor to copy the C strings that get passed to it.
63-
let logMessage = DDLogMessage(message: message(), level: level, flag: flag, context: context, file: String(describing: file), function: String(describing: function), line: line, tag: tag, options: [.copyFile, .copyFunction], timestamp: nil)
64-
ddlog.log(asynchronous: asynchronous, message: logMessage)
65-
}
66-
}
67-
68-
public func DDLogDebug(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) {
69-
_DDLogMessage(message(), level: level, flag: .debug, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog)
70-
}
71-
72-
public func DDLogInfo(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) {
73-
_DDLogMessage(message(), level: level, flag: .info, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog)
4+
@inlinable
5+
public func DDLogVerbose(_ message: @autoclosure () -> Any, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
6+
CocoaLumberjack.DDLogVerbose(message(), file: file, function: function, line: line)
747
}
758

76-
public func DDLogWarn(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) {
77-
_DDLogMessage(message(), level: level, flag: .warning, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog)
9+
@inlinable
10+
public func DDLogDebug(_ message: @autoclosure () -> Any, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
11+
CocoaLumberjack.DDLogDebug(message(), file: file, function: function, line: line)
7812
}
7913

80-
public func DDLogVerbose(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) {
81-
_DDLogMessage(message(), level: level, flag: .verbose, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog)
14+
@inlinable
15+
public func DDLogInfo(_ message: @autoclosure () -> Any, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
16+
CocoaLumberjack.DDLogInfo(message(), file: file, function: function, line: line)
8217
}
8318

84-
public func DDLogError(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: Any? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) {
85-
_DDLogMessage(message(), level: level, flag: .error, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog)
19+
@inlinable
20+
public func DDLogWarn(_ message: @autoclosure () -> Any, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
21+
CocoaLumberjack.DDLogWarn(message(), file: file, function: function, line: line)
8622
}
8723

88-
/// Returns a String of the current filename, without full path or extension.
89-
///
90-
/// Analogous to the C preprocessor macro `THIS_FILE`.
91-
public func CurrentFileName(_ fileName: StaticString = #file) -> String {
92-
var str = String(describing: fileName)
93-
if let idx = str.range(of: "/", options: .backwards)?.upperBound {
94-
#if swift(>=4.0)
95-
str = String(str[idx...])
96-
#else
97-
str = str.substring(from: idx)
98-
#endif
99-
}
100-
if let idx = str.range(of: ".", options: .backwards)?.lowerBound {
101-
#if swift(>=4.0)
102-
str = String(str.prefix(upTo: idx))
103-
#else
104-
str = str.substring(to: idx)
105-
#endif
106-
}
107-
return str
24+
@inlinable
25+
public func DDLogError(_ message: @autoclosure () -> Any, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
26+
CocoaLumberjack.DDLogError(message(), file: file, function: function, line: line)
10827
}

WordPress/Classes/Utility/Logging/EventLoggingDataProvider.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import AutomatticTracks
3+
import CocoaLumberjack
34

45
struct EventLoggingDataProvider: EventLoggingDataSource {
56

WordPress/Classes/Utility/Logging/WPLogger.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33

44
@import CocoaLumberjack;
55

6+
DDLogLevel ddLogLevel = DDLogLevelInfo;
7+
8+
void SetCocoaLumberjackObjCLogLevel(NSUInteger ddLogLevelRawValue)
9+
{
10+
ddLogLevel = (DDLogLevel)ddLogLevelRawValue;
11+
}
12+
613
@interface WPLogger ()
714
@property (nonatomic, strong, readwrite) DDFileLogger * _Nonnull fileLogger;
815
@end

WordPress/Classes/Utility/Logging/TracksLogger.swift renamed to WordPress/Classes/Utility/Logging/WordPressLibraryLogger.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import CocoaLumberjack
22
import AutomatticTracks
3+
import WordPressShared
34

4-
class TracksLogger: NSObject, TracksLoggingDelegate {
5+
class WordPressLibraryLogger: NSObject, TracksLoggingDelegate, WordPressLoggingDelegate {
56

67
func logError(_ str: String) {
78
DDLogError(str)

WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/View Models/JetpackScanStatusViewModel.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import FormatterKit
2-
31
struct JetpackScanStatusViewModel {
42
let imageName: String
53
let title: String

0 commit comments

Comments
 (0)