Skip to content

Commit 989310a

Browse files
committed
Update WordPressShared, WordPressKit, and WordPressAuthenticator
1 parent 636023e commit 989310a

File tree

11 files changed

+80
-180
lines changed

11 files changed

+80
-180
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

@@ -226,8 +226,8 @@ abstract_target 'Apps' do
226226

227227
pod 'Gridicons', '~> 1.1.0'
228228

229-
pod 'WordPressAuthenticator', '~> 3.2', '>= 3.2.2'
230-
# pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: 'fix/prologue-nav-bar'
229+
# pod 'WordPressAuthenticator', '~> 3.2', '>= 3.2.2'
230+
pod 'WordPressAuthenticator', git: 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', branch: 'trunk'
231231
# pod 'WordPressAuthenticator', :git => 'https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git', :commit => ''
232232
# 'WordPressAuthenticator', :path => '../WordPressAuthenticator-iOS'
233233

Podfile.lock

Lines changed: 33 additions & 39 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-2):
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.66.2)
4343
- ReactCommon/turbomodule/core (= 0.66.2)
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)
@@ -64,15 +61,15 @@ PODS:
6461
- RNTAztecView
6562
- JTAppleCalendar (8.0.3)
6663
- Kanvas (1.4.4)
67-
- libwebp (1.2.3):
68-
- libwebp/demux (= 1.2.3)
69-
- libwebp/mux (= 1.2.3)
70-
- libwebp/webp (= 1.2.3)
71-
- libwebp/demux (1.2.3):
64+
- libwebp (1.2.4):
65+
- libwebp/demux (= 1.2.4)
66+
- libwebp/mux (= 1.2.4)
67+
- libwebp/webp (= 1.2.4)
68+
- libwebp/demux (1.2.4):
7269
- libwebp/webp
73-
- libwebp/mux (1.2.3):
70+
- libwebp/mux (1.2.4):
7471
- libwebp/demux
75-
- libwebp/webp (1.2.3)
72+
- libwebp/webp (1.2.4)
7673
- MediaEditor (1.2.1):
7774
- CropViewController (~> 2.5.3)
7875
- MRProgress (0.8.3):
@@ -491,26 +488,21 @@ PODS:
491488
- WordPress-Aztec-iOS (1.19.8)
492489
- WordPress-Editor-iOS (1.19.8):
493490
- WordPress-Aztec-iOS (= 1.19.8)
494-
- WordPressAuthenticator (3.2.2):
495-
- Alamofire (~> 4.8)
496-
- CocoaLumberjack (~> 3.5)
491+
- WordPressAuthenticator (4.3.0):
497492
- GoogleSignIn (~> 6.0.1)
498493
- Gridicons (~> 1.0)
499494
- "NSURL+IDN (= 0.4)"
500495
- SVProgressHUD (~> 2.2.5)
501-
- WordPressKit (~> 4.18-beta)
502-
- WordPressShared (~> 1.12-beta)
496+
- WordPressKit (~> 5.0-beta)
497+
- WordPressShared (~> 2.0-beta)
503498
- WordPressUI (~> 1.7-beta)
504-
- WordPressKit (4.58.2):
499+
- WordPressKit (5.0.0):
505500
- Alamofire (~> 4.8.0)
506-
- CocoaLumberjack (~> 3.4)
507501
- NSObject-SafeExpectations (= 0.0.4)
508502
- UIDeviceIdentifier (~> 2.0)
509-
- WordPressShared (~> 1.15-beta)
503+
- WordPressShared (~> 2.0-beta)
510504
- wpxmlrpc (~> 0.9)
511-
- WordPressShared (1.18.0):
512-
- CocoaLumberjack (~> 3.4)
513-
- FormatterKit/TimeIntervalFormatter (~> 1.8)
505+
- WordPressShared (2.0.0-beta.2)
514506
- WordPressUI (1.12.5)
515507
- WPMediaPicker (1.8.7)
516508
- wpxmlrpc (0.9.0)
@@ -539,7 +531,7 @@ DEPENDENCIES:
539531
- Automattic-Tracks-iOS (~> 0.13)
540532
- boost (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.85.1/third-party-podspecs/boost.podspec.json`)
541533
- BVLinearGradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.85.1/third-party-podspecs/BVLinearGradient.podspec.json`)
542-
- CocoaLumberjack (~> 3.0)
534+
- CocoaLumberjack/Swift (~> 3.0)
543535
- CropViewController (= 2.5.3)
544536
- Down (~> 0.6.6)
545537
- FBLazyVector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.85.1/third-party-podspecs/FBLazyVector.podspec.json`)
@@ -601,19 +593,16 @@ DEPENDENCIES:
601593
- Starscream (= 3.0.6)
602594
- SVProgressHUD (= 2.2.5)
603595
- WordPress-Editor-iOS (~> 1.19.8)
604-
- WordPressAuthenticator (>= 3.2.2, ~> 3.2)
605-
- WordPressKit (>= 4.58.2, ~> 4.58)
606-
- WordPressShared (~> 1.18.0)
596+
- WordPressAuthenticator (from `https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git`, branch `trunk`)
597+
- WordPressKit (~> 5.0)
598+
- WordPressShared (~> 2.0.0-beta.1)
607599
- WordPressUI (~> 1.12.5)
608600
- WPMediaPicker (~> 1.8.7)
609601
- Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.85.1/third-party-podspecs/Yoga.podspec.json`)
610602
- ZendeskSupportSDK (= 5.3.0)
611603
- ZIPFoundation (~> 0.9.8)
612604

613605
SPEC REPOS:
614-
https://github.com/wordpress-mobile/cocoapods-specs.git:
615-
- WordPressAuthenticator
616-
- WordPressKit
617606
trunk:
618607
- Alamofire
619608
- AlamofireImage
@@ -626,7 +615,6 @@ SPEC REPOS:
626615
- DoubleConversion
627616
- Down
628617
- fmt
629-
- FormatterKit
630618
- Gifu
631619
- GoogleSignIn
632620
- Gridicons
@@ -651,6 +639,7 @@ SPEC REPOS:
651639
- UIDeviceIdentifier
652640
- WordPress-Aztec-iOS
653641
- WordPress-Editor-iOS
642+
- WordPressKit
654643
- WordPressShared
655644
- WordPressUI
656645
- WPMediaPicker
@@ -764,6 +753,9 @@ EXTERNAL SOURCES:
764753
:git: https://github.com/wordpress-mobile/gutenberg-mobile.git
765754
:submodules: true
766755
:tag: v1.85.1
756+
WordPressAuthenticator:
757+
:branch: trunk
758+
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git
767759
Yoga:
768760
:podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.85.1/third-party-podspecs/Yoga.podspec.json
769761

@@ -779,6 +771,9 @@ CHECKOUT OPTIONS:
779771
:git: https://github.com/wordpress-mobile/gutenberg-mobile.git
780772
:submodules: true
781773
:tag: v1.85.1
774+
WordPressAuthenticator:
775+
:commit: 8def4e0e7ae522504a995d7a12872fc13c596141
776+
:git: https://github.com/wordpress-mobile/WordPressAuthenticator-iOS.git
782777

783778
SPEC CHECKSUMS:
784779
Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844
@@ -789,14 +784,13 @@ SPEC CHECKSUMS:
789784
Automattic-Tracks-iOS: 63e55654f500b3e8fb35087e64575e00d12eb2f5
790785
boost: 32a63928ef0a5bf8b60f6b930c8864113fa28779
791786
BVLinearGradient: 9373b32b8f749c00fe59e3482b45091eeacec08b
792-
CocoaLumberjack: 543c79c114dadc3b1aba95641d8738b06b05b646
787+
CocoaLumberjack: 78abfb691154e2a9df8ded4350d504ee19d90732
793788
CropViewController: a5c143548a0fabcd6cc25f2d26e40460cfb8c78c
794789
DoubleConversion: e22e0762848812a87afd67ffda3998d9ef29170c
795790
Down: 71bf4af3c04fa093e65dffa25c4b64fa61287373
796791
FBLazyVector: 2bf7b5e351f8e33867210ff6eb9c5c178a035522
797792
FBReactNativeSpec: c0c61ce6c9aed4a5bf62284c8309995c21cf6b02
798793
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
799-
FormatterKit: 184db51bf120b633693a73624a4cede89ec51a41
800794
FSInteractiveMap: a396f610f48b76cb540baa87139d056429abda86
801795
Gifu: 7bcb6427457d85e0b4dff5a84ec5947ac19a93ea
802796
glog: 67060cb66a7ea4b1e8947dc9936d7fce11b100b0
@@ -807,7 +801,7 @@ SPEC CHECKSUMS:
807801
Gutenberg: cbeb7133c8a80d21980d92c97287d00c387c3114
808802
JTAppleCalendar: 932cadea40b1051beab10f67843451d48ba16c99
809803
Kanvas: f932eaed3d3f47aae8aafb6c2d27c968bdd49030
810-
libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c
804+
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
811805
MediaEditor: 20cdeb46bdecd040b8bc94467ac85a52b53b193a
812806
MRProgress: 16de7cc9f347e8846797a770db102a323fe7ef09
813807
NSObject-SafeExpectations: ab8fe623d36b25aa1f150affa324e40a2f3c0374
@@ -864,9 +858,9 @@ SPEC CHECKSUMS:
864858
UIDeviceIdentifier: e6a801d25f4f178de5bdf475ffe29050d0148176
865859
WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504
866860
WordPress-Editor-iOS: 9eb9f12f21a5209cb837908d81ffe1e31cb27345
867-
WordPressAuthenticator: 5110c62de1b1b1eb1f2a43fd2599f7f6c7a6659d
868-
WordPressKit: d8bc00bce09273fc241cf171b0e61ef8f4f29479
869-
WordPressShared: e5a479220643f46dc4d7726ef8dd45f18bf0c53b
861+
WordPressAuthenticator: 685dc0ac3812d514e1a0e6b2d9c94eca9c0e07a7
862+
WordPressKit: 202f529323b079a344f7bc1493b7ebebfd9ed4b5
863+
WordPressShared: 04403b43f821c4ed2b84a2112ef9f64f1e7cdceb
870864
WordPressUI: c5be816f6c7b3392224ac21de9e521e89fa108ac
871865
WPMediaPicker: 0d45dfd7b3c5651c5236ffd48c1b0b2f60a2d5d2
872866
wpxmlrpc: bf55a43a7e710bd2a4fb8c02dfe83b1246f14f13
@@ -880,6 +874,6 @@ SPEC CHECKSUMS:
880874
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
881875
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37
882876

883-
PODFILE CHECKSUM: 1244a13ad31cc499410b4901755c8810df5acb33
877+
PODFILE CHECKSUM: 1d4c08837f0820ee6bf0405e2800ce06f0d329b8
884878

885879
COCOAPODS: 1.11.2

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()
@@ -766,8 +768,8 @@ extension WordPressAppDelegate {
766768
}
767769

768770
@objc class func setLogLevel(_ level: DDLogLevel) {
769-
WPSharedSetLoggingLevel(level)
770-
WPAuthenticatorSetLoggingLevel(level)
771+
SetCocoaLumberjackObjCLogLevel(level.rawValue)
772+
CocoaLumberjack.dynamicLogLevel = level
771773
}
772774
}
773775

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
}

0 commit comments

Comments
 (0)