diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 84e3bbe5c49a..7c99670be7f0 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -52,6 +52,23 @@ steps: ################# # Run Unit Tests ################# + - label: "WordPressData tests" + command: | + echo "--- :rubygems: Setting up Gems" + install_gems + echo "--- :swift: Setting up Swift Packages" + install_swiftpm_dependencies + echo "--- :microscope: Test" + FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT=120 bundle exec fastlane run scan \ + scheme:WordPressData \ + device:'iPhone 16' + plugins: [$CI_TOOLKIT_PLUGIN] + artifact_paths: + - "build/results/*" + notify: + - github_commit_status: + context: "WordPressData Unit Tests" + - label: "🔬 :wordpress: Unit Tests" command: ".buildkite/commands/run-unit-tests.sh" depends_on: "build_wordpress" diff --git a/Modules/Package.swift b/Modules/Package.swift index 574b0daa1a5c..80d2aa90b446 100644 --- a/Modules/Package.swift +++ b/Modules/Package.swift @@ -15,7 +15,6 @@ let package = Package( .library(name: "NotificationServiceExtensionCore", targets: ["NotificationServiceExtensionCore"]), .library(name: "ShareExtensionCore", targets: ["ShareExtensionCore"]), .library(name: "SFHFKeychainUtils", targets: ["SFHFKeychainUtils"]), - .library(name: "WordPressData", targets: ["WordPressData"]), .library(name: "WordPressFlux", targets: ["WordPressFlux"]), .library(name: "WordPressShared", targets: ["WordPressShared"]), .library(name: "WordPressUI", targets: ["WordPressUI"]), @@ -121,14 +120,6 @@ let package = Package( .product(name: "ScreenObject", package: "ScreenObject"), .product(name: "XCUITestHelpers", package: "ScreenObject"), ], swiftSettings: [.swiftLanguageMode(.v5)]), - .target(name: "WordPressDataObjC"), - .target( - name: "WordPressData", - dependencies: [ - .target(name: "WordPressDataObjC"), - .target(name: "WordPressSharedObjC") - ] - ), .target(name: "WordPressFlux", swiftSettings: [.swiftLanguageMode(.v5)]), .target(name: "WordPressCore", dependencies: [.target(name: "WordPressShared"), .product(name: "WordPressAPI", package: "wordpress-rs")]), .target(name: "WordPressSharedObjC", resources: [.process("Resources")], swiftSettings: [.swiftLanguageMode(.v5)]), @@ -195,6 +186,7 @@ enum XcodeSupport { .library(name: "XcodeTarget_WordPressTests", targets: ["XcodeTarget_WordPressTests"]), .library(name: "XcodeTarget_WordPressAuthentificator", targets: ["XcodeTarget_WordPressAuthentificator"]), .library(name: "XcodeTarget_WordPressAuthentificatorTests", targets: ["XcodeTarget_WordPressAuthentificatorTests"]), + .library(name: "XcodeTarget_WordPressData", targets: ["XcodeTarget_WordPressData"]), .library(name: "XcodeTarget_ShareExtension", targets: ["XcodeTarget_ShareExtension"]), .library(name: "XcodeTarget_DraftActionExtension", targets: ["XcodeTarget_DraftActionExtension"]), .library(name: "XcodeTarget_NotificationServiceExtension", targets: ["XcodeTarget_NotificationServiceExtension"]), @@ -252,7 +244,6 @@ enum XcodeSupport { "NotificationServiceExtensionCore", "SFHFKeychainUtils", "ShareExtensionCore", - "WordPressData", "WordPressFlux", "WordPressShared", "WordPressReader", @@ -289,6 +280,7 @@ enum XcodeSupport { .product(name: "WordPressEditor", package: "AztecEditor-iOS"), ]), .xcodeTarget("XcodeTarget_WordPressTests", dependencies: testDependencies + [ + "FormattableContentKit", "SFHFKeychainUtils", "WordPressShared", "WordPressUI", @@ -298,6 +290,22 @@ enum XcodeSupport { ]), .xcodeTarget("XcodeTarget_WordPressAuthentificator", dependencies: wordPresAuthentificatorDependencies), .xcodeTarget("XcodeTarget_WordPressAuthentificatorTests", dependencies: wordPresAuthentificatorDependencies + testDependencies), + .xcodeTarget( + "XcodeTarget_WordPressData", + dependencies: [ + "BuildSettingsKit", + "FormattableContentKit", + "SFHFKeychainUtils", + "WordPressShared", + // FIXME: Having issues with CocoaLumberjack as a transitive dependency when added to Objective-C files + // .product(name: "CocoaLumberjack", package: "CocoaLumberjack"), + .product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"), + .product(name: "Gravatar", package: "Gravatar-SDK-iOS"), + .product(name: "NSObject-SafeExpectations", package: "NSObject-SafeExpectations"), + .product(name: "NSURL+IDN", package: "NSURL-IDN"), + .product(name: "WordPressKit", package: "WordPressKit-iOS"), + ] + ), .xcodeTarget("XcodeTarget_ShareExtension", dependencies: shareAndDraftExtensionsDependencies), .xcodeTarget("XcodeTarget_DraftActionExtension", dependencies: shareAndDraftExtensionsDependencies), .xcodeTarget("XcodeTarget_NotificationServiceExtension", dependencies: [ diff --git a/Modules/Sources/WordPressData/WordPressData.swift b/Modules/Sources/WordPressData/WordPressData.swift deleted file mode 100644 index 2e8f63502b5a..000000000000 --- a/Modules/Sources/WordPressData/WordPressData.swift +++ /dev/null @@ -1 +0,0 @@ -@_exported import WordPressDataObjC diff --git a/Modules/Sources/WordPressDataObjC/WordPressData.h b/Modules/Sources/WordPressDataObjC/WordPressData.h deleted file mode 100644 index 43d4d6be2a0c..000000000000 --- a/Modules/Sources/WordPressDataObjC/WordPressData.h +++ /dev/null @@ -1,6 +0,0 @@ -FOUNDATION_EXPORT double WordPressDataVersionNumber; - -FOUNDATION_EXPORT const unsigned char WordPressDataVersionString[]; - -#import -#import diff --git a/Modules/Sources/XcodeSupport/XcodeTarget_WordPressData/Empty.swift b/Modules/Sources/XcodeSupport/XcodeTarget_WordPressData/Empty.swift new file mode 100644 index 000000000000..41fadb0ed76f --- /dev/null +++ b/Modules/Sources/XcodeSupport/XcodeTarget_WordPressData/Empty.swift @@ -0,0 +1,3 @@ +import Foundation + +public struct __Empty {} diff --git a/WordPress/Classes/Categories/Media+Extensions.m b/WordPress/Classes/Categories/Media+Extensions.m index 11669e37bf20..ae015a5cb8a2 100644 --- a/WordPress/Classes/Categories/Media+Extensions.m +++ b/WordPress/Classes/Categories/Media+Extensions.m @@ -1,7 +1,6 @@ #import "Media+Extensions.h" #import "MediaService.h" -#import "Blog.h" -@import WordPressDataObjC; +@import WordPressData; @import WordPressShared; #import "WordPress-Swift.h" diff --git a/WordPress/Classes/Extensions/Notifications/Notification+Interface.swift b/WordPress/Classes/Extensions/Notifications/Notification+Interface.swift index 6eb24595fd2b..c259b4fefd85 100644 --- a/WordPress/Classes/Extensions/Notifications/Notification+Interface.swift +++ b/WordPress/Classes/Extensions/Notifications/Notification+Interface.swift @@ -1,8 +1,9 @@ import Foundation +import WordPressData /// Encapsulates Notification Interface Helpers /// -extension Notification { +extension WordPressData.Notification { /// Returns a Section Identifier that can be sorted. Note that this string is not human readable, and /// you should use the *descriptionForSectionIdentifier* method as well!. /// diff --git a/WordPress/Classes/Extensions/Post+BloggingPrompts.swift b/WordPress/Classes/Extensions/Post+BloggingPrompts.swift index 7aac23b727aa..b2e8ef7963c7 100644 --- a/WordPress/Classes/Extensions/Post+BloggingPrompts.swift +++ b/WordPress/Classes/Extensions/Post+BloggingPrompts.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData extension Post { diff --git a/WordPress/Classes/Extensions/SVProgressHUD+Extensions.swift b/WordPress/Classes/Extensions/SVProgressHUD+Extensions.swift index 04ff185a6ade..a26487636898 100644 --- a/WordPress/Classes/Extensions/SVProgressHUD+Extensions.swift +++ b/WordPress/Classes/Extensions/SVProgressHUD+Extensions.swift @@ -1,3 +1,4 @@ +import Foundation import SVProgressHUD extension SVProgressHUD { @@ -37,11 +38,11 @@ extension SVProgressHUD { NotificationCenter.default.removeObserver(self, name: NSNotification.Name.SVProgressHUDWillDisappear, object: nil) } - @objc static func handleHUDTappedNotification(_ notification: Notification) { + @objc static func handleHUDTappedNotification(_ notification: Foundation.Notification) { SVProgressHUD.dismiss() } - @objc static func handleHUDDisappearedNotification(_ notification: Notification) { + @objc static func handleHUDDisappearedNotification(_ notification: Foundation.Notification) { // Prevent unregistering if another HUD is still visible if !SVProgressHUD.isVisible() { unregisterFromHUDNotifications() diff --git a/WordPress/Classes/Jetpack/Utility/DataMigrator.swift b/WordPress/Classes/Jetpack/Utility/DataMigrator.swift index fa1f67d99b7d..42a99edfa587 100644 --- a/WordPress/Classes/Jetpack/Utility/DataMigrator.swift +++ b/WordPress/Classes/Jetpack/Utility/DataMigrator.swift @@ -1,6 +1,7 @@ import Foundation import AutomatticTracks import BuildSettingsKit +import WordPressData import WordPressShared protocol ContentDataMigrating { @@ -12,7 +13,7 @@ protocol ContentDataMigrating { /// Imports user's WordPress content data from the shared location. /// /// - Parameter completion: Closure called after the export process completes. - func importData(completion: ((Result) -> Void)?) + func importData(isJetpack: Bool, completion: ((Result) -> Void)?) /// Deletes any exported user content at the shared location if it exists. func deleteExportedData() @@ -65,7 +66,10 @@ extension DataMigrator: ContentDataMigrating { completion?(.success(())) } - func importData(completion: ((Result) -> Void)? = nil) { + func importData( + isJetpack: Bool = AppConfiguration.isJetpack, + completion: ((Result) -> Void)? = nil + ) { guard isDataReadyToMigrate else { completion?(.failure(.dataNotReadyToImport)) return @@ -92,7 +96,7 @@ extension DataMigrator: ContentDataMigrating { sharedDefaults: sharedDefaults, appGroupName: appGroupName ) - sharedDataIssueSolver.migrateAuthKey() + sharedDataIssueSolver.migrateAuthKey(isJetpack: isJetpack) sharedDataIssueSolver.migrateExtensionsData() BloggingRemindersScheduler.handleRemindersMigration(appGroupName: appGroupName) completion?(.success(())) diff --git a/WordPress/Classes/Models/Blog/Blog+Creation.swift b/WordPress/Classes/Models/Blog/Blog+Creation.swift index b5346d6e64e6..b9d227803d24 100644 --- a/WordPress/Classes/Models/Blog/Blog+Creation.swift +++ b/WordPress/Classes/Models/Blog/Blog+Creation.swift @@ -1,3 +1,5 @@ +import WordPressData + extension Blog { /// Creates a blank `Blog` object for this account diff --git a/WordPress/Classes/Models/Blog/Blog+Editor.swift b/WordPress/Classes/Models/Blog/Blog+Editor.swift index 8dc1481e8d0a..d0f377ed56aa 100644 --- a/WordPress/Classes/Models/Blog/Blog+Editor.swift +++ b/WordPress/Classes/Models/Blog/Blog+Editor.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData enum MobileEditor: String { case aztec diff --git a/WordPress/Classes/Models/Blog/Blog+JetpackSocial.swift b/WordPress/Classes/Models/Blog/Blog+JetpackSocial.swift index 5a5737e2c712..8a69ee8f7684 100644 --- a/WordPress/Classes/Models/Blog/Blog+JetpackSocial.swift +++ b/WordPress/Classes/Models/Blog/Blog+JetpackSocial.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData /// Blog extension for methods related to Jetpack Social. extension Blog { diff --git a/WordPress/Classes/Models/Blog/Blog+Lookup.swift b/WordPress/Classes/Models/Blog/Blog+Lookup.swift index dbc57cc3ad6f..8395938ebeef 100644 --- a/WordPress/Classes/Models/Blog/Blog+Lookup.swift +++ b/WordPress/Classes/Models/Blog/Blog+Lookup.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData /// An extension dedicated to looking up and returning blog objects public extension Blog { diff --git a/WordPress/Classes/Models/Blog/Blog+Organization.swift b/WordPress/Classes/Models/Blog/Blog+Organization.swift index 3bf4eeedee47..d53d06537d4e 100644 --- a/WordPress/Classes/Models/Blog/Blog+Organization.swift +++ b/WordPress/Classes/Models/Blog/Blog+Organization.swift @@ -1,4 +1,4 @@ -import Foundation +import WordPressData extension Blog { var isAutomatticP2: Bool { diff --git a/WordPress/Classes/Models/Blog/BlogSettings+DateAndTimeFormat.swift b/WordPress/Classes/Models/Blog/BlogSettings+DateAndTimeFormat.swift index 32235f389a2a..3aa06d85aad8 100644 --- a/WordPress/Classes/Models/Blog/BlogSettings+DateAndTimeFormat.swift +++ b/WordPress/Classes/Models/Blog/BlogSettings+DateAndTimeFormat.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData /// In this extension, we implement several nested Enums (and helper setters / getters) aimed at simplifying /// the BlogSettings interface for handling writing date and time format properties. diff --git a/WordPress/Classes/Models/Blog/BlogSettings+Discussion.swift b/WordPress/Classes/Models/Blog/BlogSettings+Discussion.swift index 24bcd1283593..d082a0fa4c0c 100644 --- a/WordPress/Classes/Models/Blog/BlogSettings+Discussion.swift +++ b/WordPress/Classes/Models/Blog/BlogSettings+Discussion.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData /// In this extension, we implement several nested Enums (and helper setters / getters) aimed at simplifying /// the BlogSettings interface. This may be considered as an Adapter class, *Swift* style! diff --git a/WordPress/Classes/Models/Gutenberg/BlockEditorSettings+GutenbergEditorSettings.swift b/WordPress/Classes/Models/Gutenberg/BlockEditorSettings+GutenbergEditorSettings.swift index 7fe887249453..2beb5db5e5f0 100644 --- a/WordPress/Classes/Models/Gutenberg/BlockEditorSettings+GutenbergEditorSettings.swift +++ b/WordPress/Classes/Models/Gutenberg/BlockEditorSettings+GutenbergEditorSettings.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressKit import Gutenberg @@ -21,7 +22,7 @@ extension BlockEditorSettings: GutenbergEditorSettings { } } -extension BlockEditorSettings { +public extension BlockEditorSettings { convenience init?(editorTheme: RemoteEditorTheme, context: NSManagedObjectContext) { self.init(context: context) self.isFSETheme = editorTheme.themeSupport?.blockTemplates ?? false diff --git a/WordPress/Classes/Models/Notifications/Actions/ApproveComment.swift b/WordPress/Classes/Models/Notifications/Actions/ApproveComment.swift index f15686170509..eaadea1c2092 100644 --- a/WordPress/Classes/Models/Notifications/Actions/ApproveComment.swift +++ b/WordPress/Classes/Models/Notifications/Actions/ApproveComment.swift @@ -36,22 +36,18 @@ class ApproveComment: DefaultNotificationActionCommand { } private func unApprove(block: FormattableCommentContent) { - ReachabilityUtils.onAvailableInternetConnectionDo { - actionsService?.unapproveCommentWithBlock(block, completion: { [weak self] success in - if success { - self?.on.toggle() - } - }) - } + actionsService?.unapproveCommentWithBlock(block, completion: { [weak self] success in + if success { + self?.on.toggle() + } + }) } private func approve(block: FormattableCommentContent) { - ReachabilityUtils.onAvailableInternetConnectionDo { - actionsService?.approveCommentWithBlock(block, completion: { [weak self] success in - if success { - self?.on.toggle() - } - }) - } + actionsService?.approveCommentWithBlock(block, completion: { [weak self] success in + if success { + self?.on.toggle() + } + }) } } diff --git a/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift b/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift index 18958d6e1b0f..7ff16d5cee4f 100644 --- a/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift +++ b/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift @@ -1,6 +1,7 @@ +import WordPressData import FormattableContentKit -extension Notification { +extension WordPressData.Notification { func renderSubject() -> NSAttributedString? { guard let subjectContent = subjectContentGroup?.blocks.first else { @@ -82,7 +83,7 @@ extension Notification { // MARK: - Notification Computed Properties // -extension Notification { +extension WordPressData.Notification { /// Verifies if the current notification is a Pingback. /// @@ -277,7 +278,7 @@ extension Notification { // MARK: - Notification Subtypes -extension Notification { +extension WordPressData.Notification { /// Parses the meta data of the notification to extract key information like postID /// Parsing logic and wrapper used depends on the notification kind @@ -301,13 +302,13 @@ extension Notification { enum ParsedNotification { case newPost(NewPostNotification) case comment(CommentNotification) - case other(Notification) + case other(WordPressData.Notification) } } // MARK: - Update Helpers // -extension Notification { +extension WordPressData.Notification { /// Updates the local fields with the new values stored in a given Remote Notification /// func update(with remote: RemoteNotification) { @@ -329,7 +330,7 @@ extension Notification { // MARK: - Notification Types // -extension Notification { +extension WordPressData.Notification { /// Meta Parsing Keys /// fileprivate enum MetaKeys { @@ -362,7 +363,7 @@ extension Notification { // MARK: - Notifiable -extension Notification: Notifiable { +extension WordPressData.Notification: Notifiable { public var notificationIdentifier: String { return notificationId } diff --git a/WordPress/Classes/Models/Notifications/Types/CommentNotification.swift b/WordPress/Classes/Models/Notifications/Types/CommentNotification.swift index dd31ff2f8e54..4d0afd99fb02 100644 --- a/WordPress/Classes/Models/Notifications/Types/CommentNotification.swift +++ b/WordPress/Classes/Models/Notifications/Types/CommentNotification.swift @@ -1,16 +1,16 @@ -import Foundation +import WordPressData struct CommentNotification: LikeableNotification { // MARK: - Properties - private let note: Notification + private let note: WordPressData.Notification private let commentID: UInt private let siteID: UInt // MARK: - Init - init?(note: Notification) { + init?(note: WordPressData.Notification) { guard let siteID = note.metaSiteID?.uintValue, let commentID = note.metaCommentID?.uintValue else { @@ -44,8 +44,8 @@ struct CommentNotification: LikeableNotification { private func getCommentLikedStatus() -> Bool { guard let body = note.body(ofType: .comment), - let actions = body[Notification.BodyKeys.actions] as? [String: Bool], - let liked = actions[Notification.ActionsKeys.likeComment] + let actions = body[WordPressData.Notification.BodyKeys.actions] as? [String: Bool], + let liked = actions[WordPressData.Notification.ActionsKeys.likeComment] else { return false } @@ -54,12 +54,12 @@ struct CommentNotification: LikeableNotification { private func updateCommentLikedStatus(_ newValue: Bool) { guard var body = note.body(ofType: .comment), - var actions = body[Notification.BodyKeys.actions] as? [String: Bool] + var actions = body[WordPressData.Notification.BodyKeys.actions] as? [String: Bool] else { return } - actions[Notification.ActionsKeys.likeComment] = newValue - body[Notification.BodyKeys.actions] = actions + actions[WordPressData.Notification.ActionsKeys.likeComment] = newValue + body[WordPressData.Notification.BodyKeys.actions] = actions self.note.updateBody(ofType: .comment, newValue: body) } } diff --git a/WordPress/Classes/Models/Notifications/Types/NewPostNotification.swift b/WordPress/Classes/Models/Notifications/Types/NewPostNotification.swift index 1afc4b3561e4..63d3400a1a84 100644 --- a/WordPress/Classes/Models/Notifications/Types/NewPostNotification.swift +++ b/WordPress/Classes/Models/Notifications/Types/NewPostNotification.swift @@ -1,16 +1,16 @@ -import Foundation +import WordPressData struct NewPostNotification: LikeableNotification { // MARK: - Properties - private let note: Notification + private let note: WordPressData.Notification private let postID: UInt private let siteID: UInt // MARK: - Init - init?(note: Notification) { + init?(note: WordPressData.Notification) { guard let postID = note.metaPostID?.uintValue, let siteID = note.metaSiteID?.uintValue else { return nil } @@ -42,8 +42,8 @@ struct NewPostNotification: LikeableNotification { private func getPostLikedStatus() -> Bool { guard let body = note.body(ofType: .post), - let actions = body[Notification.BodyKeys.actions] as? [String: Bool], - let liked = actions[Notification.ActionsKeys.likePost] + let actions = body[WordPressData.Notification.BodyKeys.actions] as? [String: Bool], + let liked = actions[WordPressData.Notification.ActionsKeys.likePost] else { return false } @@ -51,13 +51,13 @@ struct NewPostNotification: LikeableNotification { } private func updatePostLikedStatus(_ newValue: Bool) { - guard var body = note.body(ofType: Notification.BodyType.post), - var actions = body[Notification.BodyKeys.actions] as? [String: Bool] + guard var body = note.body(ofType: WordPressData.Notification.BodyType.post), + var actions = body[WordPressData.Notification.BodyKeys.actions] as? [String: Bool] else { return } - actions[Notification.ActionsKeys.likePost] = newValue - body[Notification.BodyKeys.actions] = actions + actions[WordPressData.Notification.ActionsKeys.likePost] = newValue + body[WordPressData.Notification.BodyKeys.actions] = actions self.note.updateBody(ofType: .post, newValue: body) } } diff --git a/WordPress/Classes/Models/ReaderListTopic+Creation.swift b/WordPress/Classes/Models/ReaderListTopic+Creation.swift index 327e1bbcd8aa..111d70c135c7 100644 --- a/WordPress/Classes/Models/ReaderListTopic+Creation.swift +++ b/WordPress/Classes/Models/ReaderListTopic+Creation.swift @@ -1,4 +1,4 @@ -import Foundation +import WordPressData import WordPressShared extension ReaderListTopic { diff --git a/WordPress/Classes/Models/ReaderPost+Searchable.swift b/WordPress/Classes/Models/ReaderPost+Searchable.swift index 5e6e0e529e46..9c81cff44973 100644 --- a/WordPress/Classes/Models/ReaderPost+Searchable.swift +++ b/WordPress/Classes/Models/ReaderPost+Searchable.swift @@ -1,29 +1,30 @@ import Foundation +import WordPressData extension ReaderPost: SearchableItemConvertable { - var searchItemType: SearchItemType { + public var searchItemType: SearchItemType { return .readerPost } - var isSearchable: Bool { + public var isSearchable: Bool { return true } - var searchIdentifier: String? { + public var searchIdentifier: String? { guard let postID, postID.intValue > 0 else { return nil } return postID.stringValue } - var searchDomain: String? { + public var searchDomain: String? { guard let siteID, siteID.intValue > 0 else { return nil } return siteID.stringValue } - var searchTitle: String? { + public var searchTitle: String? { var title = titleForDisplay() ?? "" if title.isEmpty { // If titleForDisplay() happens to be empty, try using the content preview instead... @@ -32,18 +33,18 @@ extension ReaderPost: SearchableItemConvertable { return title } - var searchDescription: String? { + public var searchDescription: String? { guard let readerPostPreview = contentPreviewForDisplay(), !readerPostPreview.isEmpty else { return blogURL ?? contentForDisplay() } return readerPostPreview } - var searchKeywords: [String]? { + public var searchKeywords: [String]? { return generateKeywordsFromContent() } - var searchExpirationDate: Date? { + public var searchExpirationDate: Date? { let oneWeekFromNow = Calendar.current.date(byAdding: .weekOfYear, value: 1, to: Date()) return oneWeekFromNow } diff --git a/WordPress/Classes/Models/Revisions/DiffAbstractValue+Attributes.swift b/WordPress/Classes/Models/Revisions/DiffAbstractValue+Attributes.swift index 77baf563a51b..33727bd97144 100644 --- a/WordPress/Classes/Models/Revisions/DiffAbstractValue+Attributes.swift +++ b/WordPress/Classes/Models/Revisions/DiffAbstractValue+Attributes.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressUI extension DiffAbstractValue { @@ -46,7 +47,6 @@ extension Array where Element == DiffAbstractValue { } extension RevisionDiff { - var contentToAttributedString: NSAttributedString? { return (contentDiffs?.operations ?? []).toAttributedString() } diff --git a/WordPress/Classes/Models/Revisions/Revision.swift b/WordPress/Classes/Models/Revisions/Revision.swift deleted file mode 100644 index d53c8161ca66..000000000000 --- a/WordPress/Classes/Models/Revisions/Revision.swift +++ /dev/null @@ -1,35 +0,0 @@ -import Foundation -import CoreData - -class Revision: NSManagedObject { - @NSManaged var siteId: NSNumber - @NSManaged var revisionId: NSNumber - @NSManaged var postId: NSNumber - - @NSManaged var postAuthorId: NSNumber? - - @NSManaged var postTitle: String? - @NSManaged var postContent: String? - @NSManaged var postExcerpt: String? - - @NSManaged var postDateGmt: String? - @NSManaged var postModifiedGmt: String? - - @NSManaged var diff: RevisionDiff? - - private lazy var revisionFormatter: DateFormatter = { - let formatter = DateFormatter() - formatter.locale = Locale(identifier: "en_US_POSIX") - formatter.dateFormat = "yyyy-MM-dd HH:mm:ssZ" - formatter.timeZone = TimeZone(secondsFromGMT: 0) - return formatter - }() - - var revisionDate: Date { - return revisionFormatter.date(from: postDateGmt ?? "") ?? Date() - } - - @objc var revisionDateForSection: String { - return revisionDate.longUTCStringWithoutTime() - } -} diff --git a/WordPress/Classes/Models/Revisions/RevisionDiff.swift b/WordPress/Classes/Models/Revisions/RevisionDiff.swift deleted file mode 100644 index 665a8b3e1f73..000000000000 --- a/WordPress/Classes/Models/Revisions/RevisionDiff.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Foundation -import CoreData - -class RevisionDiff: NSManagedObject { - @NSManaged var fromRevisionId: NSNumber - @NSManaged var toRevisionId: NSNumber - - @NSManaged var totalAdditions: NSNumber - @NSManaged var totalDeletions: NSNumber - - @NSManaged var contentDiffs: NSSet? - @NSManaged var titleDiffs: NSSet? - - @NSManaged var revision: Revision? -} diff --git a/WordPress/Classes/Models/Site Creation/SiteInformation.swift b/WordPress/Classes/Models/Site Creation/SiteInformation.swift deleted file mode 100644 index 047ef31ee541..000000000000 --- a/WordPress/Classes/Models/Site Creation/SiteInformation.swift +++ /dev/null @@ -1,20 +0,0 @@ -struct SiteInformation { - let title: String - let tagLine: String? - - /// if title is nil, then the corresponding SiteInformation value is nil - init?(title: String?, tagLine: String?) { - guard let title else { - return nil - } - self.title = title - self.tagLine = tagLine - } -} - -extension SiteInformation: Equatable { - static func ==(lhs: SiteInformation, rhs: SiteInformation) -> Bool { - return lhs.title == rhs.title && - lhs.tagLine == rhs.tagLine - } -} diff --git a/WordPress/Classes/Models/Theme.m b/WordPress/Classes/Models/Theme.m index 2a7a8fe1a7e2..4595c43a2ad2 100644 --- a/WordPress/Classes/Models/Theme.m +++ b/WordPress/Classes/Models/Theme.m @@ -1,7 +1,5 @@ #import "Theme.h" -#import "Blog.h" -@import WordPressDataObjC; -#import "WPAccount.h" +@import WordPressData; #import "AccountService.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/Models/WPAccount+RestApi.swift b/WordPress/Classes/Models/WPAccount+RestApi.swift index 52a367b27758..3553f6d8d2df 100644 --- a/WordPress/Classes/Models/WPAccount+RestApi.swift +++ b/WordPress/Classes/Models/WPAccount+RestApi.swift @@ -72,4 +72,10 @@ extension WPAccount { return account?.wordPressComRestApi } + // This is here in an extension that belongs to the apps target so we can decouple WPAccount from AppConfiguration. + // Decoupling allows moving the type to WordPressData, see https://github.com/wordpress-mobile/WordPress-iOS/issues/24165. + @objc + static func tokenForUsername(_ username: String) -> String? { + token(forUsername: username, isJetpack: AppConfiguration.isJetpack) + } } diff --git a/WordPress/Classes/Services/AccountService.h b/WordPress/Classes/Services/AccountService.h index a739504de786..2cc0844297e0 100644 --- a/WordPress/Classes/Services/AccountService.h +++ b/WordPress/Classes/Services/AccountService.h @@ -1,5 +1,5 @@ #import -@import WordPressDataObjC; +#import "CoreDataService.h" NS_ASSUME_NONNULL_BEGIN @@ -35,19 +35,11 @@ extern NSNotificationName const WPAccountEmailAndDefaultBlogUpdatedNotification; /** Query to check if an email address is paired to a wpcom account. Used in the magic links signup flow. - - @param email - @param success - @param failure */ - (void)isEmailAvailable:(NSString *)email success:(void (^)(BOOL available))success failure:(void (^)(NSError *error))failure; /** Query to check if a username is available. Used in the signup flow. - - @param email - @param success - @param failure */ - (void)isUsernameAvailable:(NSString *)username success:(void (^)(BOOL available))success @@ -55,9 +47,6 @@ extern NSNotificationName const WPAccountEmailAndDefaultBlogUpdatedNotification; /** Requests a verification email to be sent to the email address associated with the current account. - - @param success - @param failure */ - (void)requestVerificationEmail:(void (^)(void))success failure:(void (^)(NSError *error))failure; diff --git a/WordPress/Classes/Services/AccountService.m b/WordPress/Classes/Services/AccountService.m index 8b1abc7b673d..f55e6070bb8b 100644 --- a/WordPress/Classes/Services/AccountService.m +++ b/WordPress/Classes/Services/AccountService.m @@ -1,7 +1,5 @@ #import "AccountService.h" -#import "WPAccount.h" -@import WordPressDataObjC; -#import "Blog.h" +@import WordPressData; #import "BlogService.h" @import WordPressKit; diff --git a/WordPress/Classes/Services/BlogService+BlogAuthors.swift b/WordPress/Classes/Services/BlogService+BlogAuthors.swift index 5748ed31091a..2ed243882819 100644 --- a/WordPress/Classes/Services/BlogService+BlogAuthors.swift +++ b/WordPress/Classes/Services/BlogService+BlogAuthors.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData extension BlogService { /// Synchronizes authors for a `Blog` from an array of `RemoteUser`s. diff --git a/WordPress/Classes/Services/BlogService.h b/WordPress/Classes/Services/BlogService.h index c98741e5874b..7a6ca54254e4 100644 --- a/WordPress/Classes/Services/BlogService.h +++ b/WordPress/Classes/Services/BlogService.h @@ -1,6 +1,5 @@ #import -#import "Blog.h" -@import WordPressDataObjC; +@import WordPressData; NS_ASSUME_NONNULL_BEGIN diff --git a/WordPress/Classes/Services/BlogService.m b/WordPress/Classes/Services/BlogService.m index 9325654bbd7a..92c4de3102ce 100644 --- a/WordPress/Classes/Services/BlogService.m +++ b/WordPress/Classes/Services/BlogService.m @@ -1,13 +1,9 @@ #import "BlogService.h" -#import "Blog.h" -#import "WPAccount.h" #import "AccountService.h" -@import WordPressDataObjC; +@import WordPressData; #import "WPError.h" -#import "Media.h" #import "PostCategoryService.h" #import "CommentService.h" -#import "PostService.h" #import "WordPress-Swift.h" #import "PostType.h" @import WordPressKit; diff --git a/WordPress/Classes/Services/CommentService+Swift.swift b/WordPress/Classes/Services/CommentService+Swift.swift index 6bb4f98b6e71..90de6e1125ee 100644 --- a/WordPress/Classes/Services/CommentService+Swift.swift +++ b/WordPress/Classes/Services/CommentService+Swift.swift @@ -1,3 +1,5 @@ +import WordPressData + /// Encapsulates actions related to fetching reply comments. /// extension CommentService { diff --git a/WordPress/Classes/Services/CommentService.h b/WordPress/Classes/Services/CommentService.h index 8c6f136eaae9..6975fd73c2ab 100644 --- a/WordPress/Classes/Services/CommentService.h +++ b/WordPress/Classes/Services/CommentService.h @@ -1,6 +1,6 @@ #import #import "CoreDataService.h" -@import WordPressDataObjC; +@import WordPressData; NS_ASSUME_NONNULL_BEGIN @@ -18,9 +18,6 @@ extern NSUInteger const WPTopLevelHierarchicalCommentsPerPage; @interface CommentService : CoreDataService /// Initializes the instance with a custom service remote provider. -/// -/// @param coreDataStack The `CoreDataStack` this instance will use for interacting with CoreData. -/// @param commentServiceRemoteFactory The factory this instance will use to get service remote instances from. - (instancetype)initWithCoreDataStack:(id)coreDataStack commentServiceRemoteFactory:(CommentServiceRemoteFactory *)remoteFactory NS_DESIGNATED_INITIALIZER; diff --git a/WordPress/Classes/Services/CommentService.m b/WordPress/Classes/Services/CommentService.m index a2262b2520b1..3f50d22a2181 100644 --- a/WordPress/Classes/Services/CommentService.m +++ b/WordPress/Classes/Services/CommentService.m @@ -1,11 +1,8 @@ #import "CommentService.h" #import "AccountService.h" -#import "Blog.h" -@import WordPressDataObjC; +@import WordPressData; #import "ReaderPost.h" -#import "WPAccount.h" #import "PostService.h" -#import "AbstractPost.h" #import "WordPress-Swift.h" @import WordPressShared; diff --git a/WordPress/Classes/Services/Domains/DomainsService.swift b/WordPress/Classes/Services/Domains/DomainsService.swift index e380e5e35928..14c8836a152a 100644 --- a/WordPress/Classes/Services/Domains/DomainsService.swift +++ b/WordPress/Classes/Services/Domains/DomainsService.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import CoreData import WordPressKit import WordPressShared diff --git a/WordPress/Classes/Services/Facades/BlogSyncFacade.m b/WordPress/Classes/Services/Facades/BlogSyncFacade.m index a880cf099ac2..2ca92c78e80c 100644 --- a/WordPress/Classes/Services/Facades/BlogSyncFacade.m +++ b/WordPress/Classes/Services/Facades/BlogSyncFacade.m @@ -1,8 +1,7 @@ #import "BlogSyncFacade.h" -@import WordPressDataObjC; +@import WordPressData; #import "BlogService.h" #import "AccountService.h" -#import "Blog.h" #import "WPAppAnalytics.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/Services/GravatarService.swift b/WordPress/Classes/Services/GravatarService.swift index c5aac87eea24..c454aab82175 100644 --- a/WordPress/Classes/Services/GravatarService.swift +++ b/WordPress/Classes/Services/GravatarService.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressKit import Gravatar diff --git a/WordPress/Classes/Services/HomepageSettingsService.swift b/WordPress/Classes/Services/HomepageSettingsService.swift index c79966b3b353..c16b4abe1861 100644 --- a/WordPress/Classes/Services/HomepageSettingsService.swift +++ b/WordPress/Classes/Services/HomepageSettingsService.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressKit /// Service allowing updating of homepage settings diff --git a/WordPress/Classes/Services/MediaService.h b/WordPress/Classes/Services/MediaService.h index 568d97b2b0b0..e47e3107e62d 100644 --- a/WordPress/Classes/Services/MediaService.h +++ b/WordPress/Classes/Services/MediaService.h @@ -68,9 +68,6 @@ typedef NS_ERROR_ENUM(MediaServiceErrorDomain, MediaServiceError) { The success handler is only called when all updates succeed. Failure is called if the entire process fails in some catostrophic way. - - @param mediaObjects An array of media objects to update - @param success */ - (void)updateMedia:(nonnull NSArray *)mediaObjects overallSuccess:(nullable void (^)(void))overallSuccess @@ -81,10 +78,6 @@ typedef NS_ERROR_ENUM(MediaServiceErrorDomain, MediaServiceError) { The success handler is only called when all updates succeed. Failure is called if the entire process fails in some catostrophic way. - - @param mediaObjects An array of media objects to update - @param fieldsToUpdate Fields to be updated of media objects. - @param success */ - (void)updateMedia:(nonnull NSArray *)mediaObjects fieldsToUpdate:(nonnull NSArray *)fieldsToUpdate @@ -93,10 +86,6 @@ typedef NS_ERROR_ENUM(MediaServiceErrorDomain, MediaServiceError) { /** * Sync all Media objects from the server to local database - - * @param blog - * @param success a block that will be invoked when the sync succeeds - * @param failure a block that will be invoked when the sync fails */ - (void)syncMediaLibraryForBlog:(nonnull Blog *)blog success:(nullable void (^)(void))success diff --git a/WordPress/Classes/Services/MediaService.m b/WordPress/Classes/Services/MediaService.m index 73ac4c846491..45fdb716f76f 100644 --- a/WordPress/Classes/Services/MediaService.m +++ b/WordPress/Classes/Services/MediaService.m @@ -1,10 +1,7 @@ #import "MediaService.h" #import "AccountService.h" -#import "Media.h" -#import "WPAccount.h" -@import WordPressDataObjC; +@import WordPressData; @import WordPressShared; -#import "Blog.h" #import #import "WordPress-Swift.h" diff --git a/WordPress/Classes/Services/MenusService.m b/WordPress/Classes/Services/MenusService.m index be0e33eafb30..93ca4fbde448 100644 --- a/WordPress/Classes/Services/MenusService.m +++ b/WordPress/Classes/Services/MenusService.m @@ -1,11 +1,8 @@ #import "MenusService.h" -#import "BasePost.h" -#import "Blog.h" #import "Menu.h" #import "MenuItem.h" #import "MenuLocation.h" -@import WordPressDataObjC; -#import "PostService.h" +@import WordPressData; #import "WordPress-Swift.h" @import WordPressKit; diff --git a/WordPress/Classes/Services/NotificationActionsService.swift b/WordPress/Classes/Services/NotificationActionsService.swift index 5ef415facf9b..af3f7b79aec4 100644 --- a/WordPress/Classes/Services/NotificationActionsService.swift +++ b/WordPress/Classes/Services/NotificationActionsService.swift @@ -1,3 +1,4 @@ +import CocoaLumberjackSwift import Foundation import FormattableContentKit diff --git a/WordPress/Classes/Services/NotificationSyncMediator.swift b/WordPress/Classes/Services/NotificationSyncMediator.swift index c21cb640b7c6..dcdb2e1c1d30 100644 --- a/WordPress/Classes/Services/NotificationSyncMediator.swift +++ b/WordPress/Classes/Services/NotificationSyncMediator.swift @@ -144,7 +144,7 @@ final class NotificationSyncMediator: NotificationSyncMediatorProtocol { /// - noteId: Notification ID of the note to be downloaded. /// - completion: Closure to be executed on completion. /// - func syncNote(with noteId: String, completion: ((Error?, Notification?) -> Void)? = nil) { + func syncNote(with noteId: String, completion: ((Error?, WordPressData.Notification?) -> Void)? = nil) { assert(Thread.isMainThread) remote.loadNotes(noteIds: [noteId]) { error, remoteNotes in @@ -155,7 +155,7 @@ final class NotificationSyncMediator: NotificationSyncMediatorProtocol { self.updateLocalNotes(with: remoteNotes) { let predicate = NSPredicate(format: "(notificationId == %@)", noteId) - let note = self.mainContext.firstObject(ofType: Notification.self, matching: predicate) + let note = self.mainContext.firstObject(ofType: WordPressData.Notification.self, matching: predicate) completion?(nil, note) } @@ -170,7 +170,7 @@ final class NotificationSyncMediator: NotificationSyncMediatorProtocol { /// - notification: The notification that was just read. /// - completion: Callback to be executed on completion. /// - func markAsRead(_ notification: Notification, completion: ((Error?)-> Void)? = nil) { + func markAsRead(_ notification: WordPressData.Notification, completion: ((Error?)-> Void)? = nil) { Task { @MainActor in mark([notification], asRead: true, completion: completion) } @@ -184,7 +184,7 @@ final class NotificationSyncMediator: NotificationSyncMediatorProtocol { /// - notifications: Notifications that were marked as read. /// - completion: Callback to be executed on completion. /// - func markAsRead(_ notifications: [Notification], completion: ((Error?)-> Void)? = nil) { + func markAsRead(_ notifications: [WordPressData.Notification], completion: ((Error?)-> Void)? = nil) { Task { @MainActor in mark(notifications, asRead: true, completion: completion) } @@ -198,7 +198,7 @@ final class NotificationSyncMediator: NotificationSyncMediatorProtocol { /// - notification: The notification that should be marked unread. /// - completion: Callback to be executed on completion. /// - func markAsUnread(_ notification: Notification, completion: ((Error?)-> Void)? = nil) { + func markAsUnread(_ notification: WordPressData.Notification, completion: ((Error?)-> Void)? = nil) { markAsUnread([notification], completion: completion) } @@ -210,13 +210,13 @@ final class NotificationSyncMediator: NotificationSyncMediatorProtocol { /// - notifications: The notifications that should be marked unread. /// - completion: Callback to be executed on completion. /// - func markAsUnread(_ notifications: [Notification], completion: ((Error?)-> Void)? = nil) { + func markAsUnread(_ notifications: [WordPressData.Notification], completion: ((Error?)-> Void)? = nil) { Task { @MainActor in mark(notifications, asRead: false, completion: completion) } } - @MainActor private func mark(_ notifications: [Notification], asRead read: Bool = true, completion: ((Error?)-> Void)? = nil) { + @MainActor private func mark(_ notifications: [WordPressData.Notification], asRead read: Bool = true, completion: ((Error?)-> Void)? = nil) { let noteIDs = notifications.map { $0.notificationId } diff --git a/WordPress/Classes/Services/PostCategoryService.h b/WordPress/Classes/Services/PostCategoryService.h index 8e787b3227f1..80584a86ac7b 100644 --- a/WordPress/Classes/Services/PostCategoryService.h +++ b/WordPress/Classes/Services/PostCategoryService.h @@ -1,5 +1,5 @@ #import -@import WordPressDataObjC; +#import "CoreDataStack.h" NS_ASSUME_NONNULL_BEGIN diff --git a/WordPress/Classes/Services/PostCategoryService.m b/WordPress/Classes/Services/PostCategoryService.m index 1bddb99a7ba7..bea171f382a3 100644 --- a/WordPress/Classes/Services/PostCategoryService.m +++ b/WordPress/Classes/Services/PostCategoryService.m @@ -1,7 +1,5 @@ #import "PostCategoryService.h" -#import "PostCategory.h" -#import "Blog.h" -@import WordPressDataObjC; +@import WordPressData; #import "WordPress-Swift.h" @import WordPressKit; diff --git a/WordPress/Classes/Services/PostHelper.m b/WordPress/Classes/Services/PostHelper.m deleted file mode 100644 index e6b659aa0be4..000000000000 --- a/WordPress/Classes/Services/PostHelper.m +++ /dev/null @@ -1,246 +0,0 @@ -#import "PostHelper.h" -#import "AbstractPost.h" -#import "WordPress-Swift.h" - -@import WordPressKit; -@import NSObject_SafeExpectations; - -@implementation PostHelper - -+ (void)updatePost:(AbstractPost *)post withRemotePost:(RemotePost *)remotePost inContext:(NSManagedObjectContext *)managedObjectContext { - [self updatePost:post withRemotePost:remotePost inContext:managedObjectContext overwrite:NO]; -} - -+ (void)updatePost:(AbstractPost *)post withRemotePost:(RemotePost *)remotePost inContext:(NSManagedObjectContext *)managedObjectContext overwrite:(BOOL)overwrite { - if ((post.revision != nil && !overwrite)) { - return; - } - - NSNumber *previousPostID = post.postID; - post.postID = remotePost.postID; - // Used to populate author information for self-hosted sites. - BlogAuthor *author = [post.blog getAuthorWithId:remotePost.authorID]; - - post.author = remotePost.authorDisplayName ?: author.displayName; - post.authorID = remotePost.authorID; - post.date_created_gmt = remotePost.date; - post.dateModified = remotePost.dateModified; - post.postTitle = remotePost.title; - post.permaLink = [remotePost.URL absoluteString]; - post.content = remotePost.content; - post.status = remotePost.status; - post.password = remotePost.password; - - if (remotePost.postThumbnailID != nil) { - post.featuredImage = [Media existingOrStubMediaWithMediaID: remotePost.postThumbnailID inBlog:post.blog]; - } else { - post.featuredImage = nil; - } - - post.pathForDisplayImage = remotePost.pathForDisplayImage; - if (post.pathForDisplayImage.length == 0) { - [post updatePathForDisplayImageBasedOnContent]; - } - post.authorAvatarURL = remotePost.authorAvatarURL ?: author.avatarURL; - post.mt_excerpt = remotePost.excerpt; - post.wp_slug = remotePost.slug; - post.suggested_slug = remotePost.suggestedSlug; - - if ([remotePost.revisions wp_isValidObject]) { - post.revisions = [remotePost.revisions copy]; - } - - if (remotePost.postID != previousPostID) { - [self updateCommentsForPost:post]; - } - - post.autosaveTitle = remotePost.autosave.title; - post.autosaveExcerpt = remotePost.autosave.excerpt; - post.autosaveContent = remotePost.autosave.content; - post.autosaveModifiedDate = remotePost.autosave.modifiedDate; - post.autosaveIdentifier = remotePost.autosave.identifier; - - if ([post isKindOfClass:[Page class]]) { - Page *pagePost = (Page *)post; - pagePost.parentID = remotePost.parentID; - pagePost.foreignID = remotePost.foreignID; - } else if ([post isKindOfClass:[Post class]]) { - Post *postPost = (Post *)post; - postPost.commentCount = remotePost.commentCount; - postPost.likeCount = remotePost.likeCount; - postPost.postFormat = remotePost.format; - postPost.tags = [remotePost.tags componentsJoinedByString:@","]; - postPost.postType = remotePost.type; - postPost.isStickyPost = (remotePost.isStickyPost != nil) ? remotePost.isStickyPost.boolValue : NO; - [self updatePost:postPost withRemoteCategories:remotePost.categories inContext:managedObjectContext]; - - NSString *publicID = nil; - NSString *publicizeMessage = nil; - NSString *publicizeMessageID = nil; - if (remotePost.metadata) { - NSDictionary *latitudeDictionary = [self dictionaryWithKey:@"geo_latitude" inMetadata:remotePost.metadata]; - NSDictionary *longitudeDictionary = [self dictionaryWithKey:@"geo_longitude" inMetadata:remotePost.metadata]; - NSDictionary *geoPublicDictionary = [self dictionaryWithKey:@"geo_public" inMetadata:remotePost.metadata]; - if (latitudeDictionary && longitudeDictionary) { - NSNumber *latitude = [latitudeDictionary numberForKey:@"value"]; - NSNumber *longitude = [longitudeDictionary numberForKey:@"value"]; - CLLocationCoordinate2D coord; - coord.latitude = [latitude doubleValue]; - coord.longitude = [longitude doubleValue]; - publicID = [geoPublicDictionary stringForKey:@"id"]; - } - NSDictionary *publicizeMessageDictionary = [self dictionaryWithKey:@"_wpas_mess" inMetadata:remotePost.metadata]; - publicizeMessage = [publicizeMessageDictionary stringForKey:@"value"]; - publicizeMessageID = [publicizeMessageDictionary stringForKey:@"id"]; - } - postPost.foreignID = remotePost.foreignID; - postPost.publicID = publicID; - postPost.publicizeMessage = publicizeMessage; - postPost.publicizeMessageID = publicizeMessageID; - postPost.disabledPublicizeConnections = [self disabledPublicizeConnectionsForPost:post andMetadata:remotePost.metadata]; - } -} - -+ (void)updatePost:(Post *)post withRemoteCategories:(NSArray *)remoteCategories inContext:(NSManagedObjectContext *)managedObjectContext { - NSMutableSet *categories = [post mutableSetValueForKey:@"categories"]; - [categories removeAllObjects]; - for (RemotePostCategory *remoteCategory in remoteCategories) { - PostCategory *category = [PostHelper createOrUpdateCategoryForRemoteCategory:remoteCategory blog:post.blog context:managedObjectContext]; - if (category) { - [categories addObject:category]; - } - } -} - -+ (void)updateCommentsForPost:(AbstractPost *)post -{ - NSMutableSet *currentComments = [post mutableSetValueForKey:@"comments"]; - NSSet *allComments = [post.blog.comments filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"postID = %@", post.postID]]; - [currentComments unionSet:allComments]; -} - -+ (NSDictionary *)dictionaryWithKey:(NSString *)key inMetadata:(NSArray *)metadata { - NSArray *matchingEntries = [metadata filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"key = %@", key]]; - // In theory, there shouldn't be duplicated fields, but I've seen some bugs where there's more than one geo_* value - // In any case, they should be sorted by id, so `lastObject` should have the newer value - return [matchingEntries lastObject]; -} - -+ (NSArray *)remoteMetadataForPost:(Post *)post -{ - NSMutableArray *metadata = [NSMutableArray arrayWithCapacity:5]; - - /// Send UUID as a foreign ID in metadata so we have a way to deduplicate new posts - if (post.foreignID) { - NSMutableDictionary *uuidDictionary = [NSMutableDictionary dictionaryWithCapacity:3]; - uuidDictionary[@"key"] = [self foreignIDKey]; - uuidDictionary[@"value"] = [post.foreignID UUIDString]; - [metadata addObject:uuidDictionary]; - } - - if (post.publicID) { - NSMutableDictionary *publicDictionary = [NSMutableDictionary dictionaryWithCapacity:1]; - publicDictionary[@"id"] = [post.publicID numericValue]; - [metadata addObject:publicDictionary]; - } - - if (post.publicizeMessageID || post.publicizeMessage.length) { - NSMutableDictionary *publicizeMessageDictionary = [NSMutableDictionary dictionaryWithCapacity:3]; - if (post.publicizeMessageID) { - publicizeMessageDictionary[@"id"] = post.publicizeMessageID; - } - publicizeMessageDictionary[@"key"] = @"_wpas_mess"; - publicizeMessageDictionary[@"value"] = post.publicizeMessage.length ? post.publicizeMessage : @""; - [metadata addObject:publicizeMessageDictionary]; - } - - [metadata addObjectsFromArray:[PostHelper publicizeMetadataEntriesForPost:post]]; - - if (post.bloggingPromptID) { - NSMutableDictionary *promptDictionary = [NSMutableDictionary dictionaryWithCapacity:3]; - promptDictionary[@"key"] = @"_jetpack_blogging_prompt_key"; - promptDictionary[@"value"] = post.bloggingPromptID; - [metadata addObject:promptDictionary]; - } - - return metadata; -} - -+ (NSArray *)mergePosts:(NSArray *)remotePosts - ofType:(NSString *)syncPostType - withStatuses:(NSArray *)statuses - byAuthor:(NSNumber *)authorID - forBlog:(Blog *)blog - purgeExisting:(BOOL)purge - inContext:(NSManagedObjectContext *)context -{ - NSMutableArray *posts = [NSMutableArray arrayWithCapacity:remotePosts.count]; - for (RemotePost *remotePost in remotePosts) { - AbstractPost *post = [blog lookupPostWithID:remotePost.postID inContext:context]; - if (post == nil) { - NSUUID *foreignID = remotePost.foreignID; - if (foreignID != nil) { - post = [blog lookupPostWithForeignID:foreignID inContext:context]; - } - } - if (!post) { - if ([remotePost.type isEqualToString:PostServiceTypePage]) { - // Create a Page entity for posts with a remote type of "page" - post = [blog createPage]; - } else { - // Create a Post entity for any other posts that have a remote post type of "post" or a custom post type. - post = [blog createPost]; - } - } - [PostHelper updatePost:post withRemotePost:remotePost inContext:context]; - [posts addObject:post]; - } - - if (purge) { - // Set up predicate for fetching any posts that could be purged for the sync. - NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(postID != NULL) AND (original = NULL) AND (revision = NULL) AND (blog = %@)", blog]; - if ([statuses count] > 0) { - NSPredicate *statusPredicate = [NSPredicate predicateWithFormat:@"status IN %@", statuses]; - predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate, statusPredicate]]; - } - if (authorID) { - NSPredicate *authorPredicate = [NSPredicate predicateWithFormat:@"authorID = %@", authorID]; - predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate, authorPredicate]]; - } - - NSFetchRequest *request; - if ([syncPostType isEqualToString:PostServiceTypeAny]) { - // If syncing "any" posts, set up the fetch for any AbstractPost entities (including child entities). - request = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([AbstractPost class])]; - } else if ([syncPostType isEqualToString:PostServiceTypePage]) { - // If syncing "page" posts, set up the fetch for any Page entities. - request = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([Page class])]; - } else { - // If not syncing "page" or "any" post, use the Post entity. - request = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([Post class])]; - // Include the postType attribute in the predicate. - NSPredicate *postTypePredicate = [NSPredicate predicateWithFormat:@"postType = %@", syncPostType]; - predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate, postTypePredicate]]; - } - request.predicate = predicate; - - NSError *error; - NSArray *existingPosts = [context executeFetchRequest:request error:&error]; - if (error) { - DDLogError(@"Error fetching existing posts for purging: %@", error); - } else { - NSSet *postsToKeep = [NSSet setWithArray:posts]; - NSMutableSet *postsToDelete = [NSMutableSet setWithArray:existingPosts]; - // Delete the posts not being updated. - [postsToDelete minusSet:postsToKeep]; - for (AbstractPost *post in postsToDelete) { - DDLogInfo(@"Deleting Post: %@", post); - [context deleteObject:post]; - } - } - } - - return posts; -} - -@end diff --git a/WordPress/Classes/Services/PostService.m b/WordPress/Classes/Services/PostService.m deleted file mode 100644 index 95665ce99818..000000000000 --- a/WordPress/Classes/Services/PostService.m +++ /dev/null @@ -1,139 +0,0 @@ -#import "PostService.h" -#import "PostCategory.h" -#import "PostCategoryService.h" -@import WordPressDataObjC; -#import "CommentService.h" -#import "MediaService.h" -#import "Media.h" -#import "WordPress-Swift.h" -#import "PostHelper.h" -@import WordPressKit; -@import WordPressShared; - -PostServiceType const PostServiceTypePost = @"post"; -PostServiceType const PostServiceTypePage = @"page"; -PostServiceType const PostServiceTypeAny = @"any"; -NSString * const PostServiceErrorDomain = @"PostServiceErrorDomain"; - -const NSUInteger PostServiceDefaultNumberToSync = 40; - -@interface PostService () - -@end - -@implementation PostService - -- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)context { - return [self initWithManagedObjectContext:context - postServiceRemoteFactory:[PostServiceRemoteFactory.alloc init]]; -} - -- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)context - postServiceRemoteFactory:(PostServiceRemoteFactory *)postServiceRemoteFactory { - if (self = [super initWithManagedObjectContext:context]) { - self.postServiceRemoteFactory = postServiceRemoteFactory; - } - return self; -} - -- (void)syncPostsOfType:(PostServiceType)postType - forBlog:(Blog *)blog - success:(PostServiceSyncSuccess)success - failure:(PostServiceSyncFailure)failure -{ - [self syncPostsOfType:postType - withOptions:nil - forBlog:blog - success:success - failure:failure]; -} - -- (void)syncPostsOfType:(PostServiceType)postType - withOptions:(PostServiceSyncOptions *)options - forBlog:(Blog *)blog - success:(PostServiceSyncSuccess)success - failure:(PostServiceSyncFailure)failure -{ - [self syncPostsOfType:postType - withOptions:options - forBlog:blog - loadedPosts:[NSMutableArray new] - syncAll:(postType == PostServiceTypePage) - success:success - failure:failure]; -} - -- (void)syncPostsOfType:(PostServiceType)postType - withOptions:(PostServiceSyncOptions *)options - forBlog:(Blog *)blog - loadedPosts:(NSMutableArray *)loadedPosts - syncAll:(BOOL)syncAll - success:(PostServiceSyncSuccess)success - failure:(PostServiceSyncFailure)failure -{ - NSManagedObjectID *blogObjectID = blog.objectID; - id remote = [self.postServiceRemoteFactory forBlog:blog]; - - if (loadedPosts.count > 0) { - options.offset = @(loadedPosts.count); - } - - NSDictionary *remoteOptions = options ? [self remoteSyncParametersDictionaryForRemote:remote withOptions:options] : nil; - [remote getPostsOfType:postType - options:remoteOptions - success:^(NSArray *remotePosts) { - [loadedPosts addObjectsFromArray:remotePosts]; - - if (syncAll && remotePosts.count >= options.number.integerValue) { - [self syncPostsOfType:postType - withOptions:options - forBlog:blog - loadedPosts:loadedPosts - syncAll:syncAll - success:success - failure:failure]; - } else { - [self.managedObjectContext performBlock:^{ - NSError *error; - Blog *blogInContext = (Blog *)[self.managedObjectContext existingObjectWithID:blogObjectID error:&error]; - if (!blogInContext || error) { - DDLogError(@"Could not retrieve blog in context %@", (error ? [NSString stringWithFormat:@"with error: %@", error] : @"")); - return; - } - NSArray *posts = [PostHelper mergePosts:[loadedPosts copy] - ofType:postType - withStatuses:options.statuses - byAuthor:options.authorID - forBlog:blogInContext - purgeExisting:options.purgesLocalSync - inContext:self.managedObjectContext]; - - [[ContextManager sharedInstance] saveContext:self.managedObjectContext withCompletionBlock:^{ - // Call the completion block after context is saved. The callback is called on the context queue because `posts` - // contains models that are bound to the `self.managedObjectContext` object. - if (success) { - [self.managedObjectContext performBlock:^{ - success(posts); - }]; - } - } onQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)]; - }]; - } - } failure:^(NSError *error) { - if (failure) { - [self.managedObjectContext performBlock:^{ - failure(error); - }]; - } - }]; -} - -#pragma mark - Helpers - -- (NSDictionary *)remoteSyncParametersDictionaryForRemote:(nonnull id )remote - withOptions:(nonnull PostServiceSyncOptions *)options -{ - return [remote dictionaryWithRemoteOptions:options]; -} - -@end diff --git a/WordPress/Classes/Services/PostTagService.m b/WordPress/Classes/Services/PostTagService.m index 8add12140e96..b2a9f593378c 100644 --- a/WordPress/Classes/Services/PostTagService.m +++ b/WordPress/Classes/Services/PostTagService.m @@ -1,7 +1,6 @@ #import "PostTagService.h" -#import "Blog.h" #import "PostTag.h" -@import WordPressDataObjC; +@import WordPressData; #import "WordPress-Swift.h" @import WordPressKit; diff --git a/WordPress/Classes/Services/Reader Post/ReaderPostService.h b/WordPress/Classes/Services/Reader Post/ReaderPostService.h index aa7a54958153..f9c3c69dc503 100644 --- a/WordPress/Classes/Services/Reader Post/ReaderPostService.h +++ b/WordPress/Classes/Services/Reader Post/ReaderPostService.h @@ -1,5 +1,5 @@ #import -@import WordPressDataObjC; +@import WordPressData; #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullability-completeness" diff --git a/WordPress/Classes/Services/Reader Post/ReaderPostService.m b/WordPress/Classes/Services/Reader Post/ReaderPostService.m index f49f14186ea2..bb87af8f13d7 100644 --- a/WordPress/Classes/Services/Reader Post/ReaderPostService.m +++ b/WordPress/Classes/Services/Reader Post/ReaderPostService.m @@ -1,12 +1,11 @@ #import "ReaderPostService.h" #import "AccountService.h" -@import WordPressDataObjC; +@import WordPressData; #import "ReaderGapMarker.h" #import "ReaderPost.h" #import "ReaderSiteService.h" #import "SourcePostAttribution.h" -#import "WPAccount.h" #import "WPAppAnalytics.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/Services/ReaderCardService.swift b/WordPress/Classes/Services/ReaderCardService.swift index 5641e3519958..1f3b65779a32 100644 --- a/WordPress/Classes/Services/ReaderCardService.swift +++ b/WordPress/Classes/Services/ReaderCardService.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressKit import WordPressShared diff --git a/WordPress/Classes/Services/ReaderSiteService.h b/WordPress/Classes/Services/ReaderSiteService.h index f06c4328008c..02881f822497 100644 --- a/WordPress/Classes/Services/ReaderSiteService.h +++ b/WordPress/Classes/Services/ReaderSiteService.h @@ -1,6 +1,6 @@ #import #import "ReaderTopicService.h" -@import WordPressDataObjC; +@import WordPressData; typedef NS_ENUM(NSUInteger, ReaderSiteServiceError) { ReaderSiteServiceErrorNotLoggedIn, diff --git a/WordPress/Classes/Services/ReaderSiteService.m b/WordPress/Classes/Services/ReaderSiteService.m index d968820c0f7a..552072bddc8f 100644 --- a/WordPress/Classes/Services/ReaderSiteService.m +++ b/WordPress/Classes/Services/ReaderSiteService.m @@ -1,10 +1,9 @@ #import "ReaderSiteService.h" #import "AccountService.h" -@import WordPressDataObjC; +@import WordPressData; #import "ReaderPostService.h" #import "ReaderPost.h" -#import "WPAccount.h" #import "WordPress-Swift.h" #import "WPAppAnalytics.h" @import WordPressKit; diff --git a/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift b/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift index 2e516d8fcce5..e7395c9495cf 100644 --- a/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift +++ b/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressShared // MARK: - ReaderFollowedInterestsService diff --git a/WordPress/Classes/Services/ReaderTopicService+Subscriptions.swift b/WordPress/Classes/Services/ReaderTopicService+Subscriptions.swift index fa74fe85f5c7..95a956cac384 100644 --- a/WordPress/Classes/Services/ReaderTopicService+Subscriptions.swift +++ b/WordPress/Classes/Services/ReaderTopicService+Subscriptions.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressKit import WordPressShared diff --git a/WordPress/Classes/Services/ReaderTopicService.h b/WordPress/Classes/Services/ReaderTopicService.h index e95a8728894c..0f86cd88e026 100644 --- a/WordPress/Classes/Services/ReaderTopicService.h +++ b/WordPress/Classes/Services/ReaderTopicService.h @@ -1,6 +1,6 @@ #import #import "CoreDataService.h" -@import WordPressDataObjC; +@import WordPressData; extern NSString * const ReaderTopicFreshlyPressedPathCommponent; diff --git a/WordPress/Classes/Services/ReaderTopicService.m b/WordPress/Classes/Services/ReaderTopicService.m index 0a7ca3f2d163..99786002e504 100644 --- a/WordPress/Classes/Services/ReaderTopicService.m +++ b/WordPress/Classes/Services/ReaderTopicService.m @@ -1,10 +1,9 @@ #import "ReaderTopicService.h" #import "AccountService.h" -@import WordPressDataObjC; +@import WordPressData; #import "ReaderPost.h" #import "ReaderPostService.h" -#import "WPAccount.h" #import "WordPress-Swift.h" @import WordPressKit; diff --git a/WordPress/Classes/Services/SiteSuggestionService.swift b/WordPress/Classes/Services/SiteSuggestionService.swift index 1462c3c59970..afb539b8a84d 100644 --- a/WordPress/Classes/Services/SiteSuggestionService.swift +++ b/WordPress/Classes/Services/SiteSuggestionService.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressShared /// A service to fetch and persist a list of sites that can be xpost to from a post. diff --git a/WordPress/Classes/Services/ThemeService.h b/WordPress/Classes/Services/ThemeService.h index bb004f0867b9..54dc6b4583a5 100644 --- a/WordPress/Classes/Services/ThemeService.h +++ b/WordPress/Classes/Services/ThemeService.h @@ -1,4 +1,4 @@ -@import WordPressDataObjC; +@import WordPressData; @class Blog; @class Theme; diff --git a/WordPress/Classes/Services/ThemeService.m b/WordPress/Classes/Services/ThemeService.m index 8f4908299743..657eeb5dff3d 100644 --- a/WordPress/Classes/Services/ThemeService.m +++ b/WordPress/Classes/Services/ThemeService.m @@ -1,9 +1,7 @@ #import "ThemeService.h" -#import "Blog.h" #import "Theme.h" -#import "WPAccount.h" -@import WordPressDataObjC; +@import WordPressData; #import "WordPress-Swift.h" @import WordPressKit; diff --git a/WordPress/Classes/System/JetpackWindowManager.swift b/WordPress/Classes/System/JetpackWindowManager.swift index 61406a707fcb..eef50de3449b 100644 --- a/WordPress/Classes/System/JetpackWindowManager.swift +++ b/WordPress/Classes/System/JetpackWindowManager.swift @@ -1,5 +1,6 @@ import Combine import Foundation +import WordPressData import WordPressShared class JetpackWindowManager: WindowManager { diff --git a/WordPress/Classes/System/WordPress-Bridging-Header.h b/WordPress/Classes/System/WordPress-Bridging-Header.h index c507c394dada..aff340d34778 100644 --- a/WordPress/Classes/System/WordPress-Bridging-Header.h +++ b/WordPress/Classes/System/WordPress-Bridging-Header.h @@ -3,7 +3,6 @@ #import "ActivityLogViewController.h" #import "AccountService.h" -#import "Blog.h" #import "BlogService.h" #import "BlogSyncFacade.h" #import "BlogDetailsViewController.h" @@ -25,10 +24,8 @@ #import "NSObject+Helpers.h" #import "PageSettingsViewController.h" -#import "PostContentProvider.h" #import "PostCategory.h" #import "PostCategoryService.h" -#import "PostContentProvider.h" #import "PostHelper.h" #import "PostMetaButton.h" #import "PostService.h" @@ -62,7 +59,6 @@ #import "UIApplication+Helpers.h" #import "UIView+Subviews.h" -#import "WPAccount.h" #import "WPActivityDefaults.h" #import "WPAppAnalytics.h" #import "WPAuthTokenIssueSolver.h" diff --git a/WordPress/Classes/Utility/Analytics/WPAnalyticsTrackerAutomatticTracks.m b/WordPress/Classes/Utility/Analytics/WPAnalyticsTrackerAutomatticTracks.m index 3cfe942200bf..f441a8b2e77e 100644 --- a/WordPress/Classes/Utility/Analytics/WPAnalyticsTrackerAutomatticTracks.m +++ b/WordPress/Classes/Utility/Analytics/WPAnalyticsTrackerAutomatticTracks.m @@ -1,9 +1,7 @@ #import "WPAnalyticsTrackerAutomatticTracks.h" -@import WordPressDataObjC; +@import WordPressData; #import "AccountService.h" #import "BlogService.h" -#import "WPAccount.h" -#import "Blog.h" #import "WordPress-Swift.h" @import AutomatticTracks; @import AutomatticTracksEvents; diff --git a/WordPress/Classes/Utility/Analytics/WPAppAnalytics.m b/WordPress/Classes/Utility/Analytics/WPAppAnalytics.m index 90328e0e5f39..94925fe76cbf 100644 --- a/WordPress/Classes/Utility/Analytics/WPAppAnalytics.m +++ b/WordPress/Classes/Utility/Analytics/WPAppAnalytics.m @@ -1,4 +1,13 @@ -@import WordPressDataObjC; +#import "WPAppAnalytics.h" + +@import WordPressData; +#import "WPAnalyticsTrackerWPCom.h" +#import "WPAnalyticsTrackerAutomatticTracks.h" +#import "WPTabBarController.h" +#import "AccountService.h" +#import "BlogService.h" +#import "WordPress-Swift.h" + @import NSObject_SafeExpectations; #import "WPAppAnalytics.h" diff --git a/WordPress/Classes/Utility/Media/MediaExporter.swift b/WordPress/Classes/Utility/Media/MediaExporter.swift index d9f809d40389..305ffa755230 100644 --- a/WordPress/Classes/Utility/Media/MediaExporter.swift +++ b/WordPress/Classes/Utility/Media/MediaExporter.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData enum MediaExportProgressUnits { static let done: Int64 = 100 diff --git a/WordPress/Classes/Utility/Media/MediaImageExporter.swift b/WordPress/Classes/Utility/Media/MediaImageExporter.swift index c6b6cdfe4b27..9c2cdbc973d5 100644 --- a/WordPress/Classes/Utility/Media/MediaImageExporter.swift +++ b/WordPress/Classes/Utility/Media/MediaImageExporter.swift @@ -3,6 +3,7 @@ import CoreGraphics import UIKit import MobileCoreServices import UniformTypeIdentifiers +import WordPressData /// Media export handling of UIImages. /// diff --git a/WordPress/Classes/Utility/Spotlight/SearchManager.swift b/WordPress/Classes/Utility/SearchManager.swift similarity index 100% rename from WordPress/Classes/Utility/Spotlight/SearchManager.swift rename to WordPress/Classes/Utility/SearchManager.swift diff --git a/WordPress/Classes/Utility/Sharing/ShareNoticeNavigationCoordinator.swift b/WordPress/Classes/Utility/Sharing/ShareNoticeNavigationCoordinator.swift index d5996e999450..099c9e6f56e8 100644 --- a/WordPress/Classes/Utility/Sharing/ShareNoticeNavigationCoordinator.swift +++ b/WordPress/Classes/Utility/Sharing/ShareNoticeNavigationCoordinator.swift @@ -1,5 +1,6 @@ import UIKit import ShareExtensionCore +import WordPressData /// This class simply exists to coordinate the display of various sections of /// the app in response to actions taken by the user from share/app extension notifications. diff --git a/WordPress/Classes/Utility/WPAuthTokenIssueSolver.m b/WordPress/Classes/Utility/WPAuthTokenIssueSolver.m index d1fa966b68d8..265fee274e12 100644 --- a/WordPress/Classes/Utility/WPAuthTokenIssueSolver.m +++ b/WordPress/Classes/Utility/WPAuthTokenIssueSolver.m @@ -1,8 +1,7 @@ #import "WPAuthTokenIssueSolver.h" #import "AccountService.h" #import "BlogService.h" -@import WordPressDataObjC; -#import "WPAccount.h" +@import WordPressData; #import "WordPress-Swift.h" @implementation WPAuthTokenIssueSolver diff --git a/WordPress/Classes/Utility/WPError.m b/WordPress/Classes/Utility/WPError.m index 3d2d3e11fccd..f6ea7ac3889b 100644 --- a/WordPress/Classes/Utility/WPError.m +++ b/WordPress/Classes/Utility/WPError.m @@ -1,5 +1,4 @@ #import "WPError.h" -#import "WPAccount.h" #import "WordPress-Swift.h" @import WordPressShared; diff --git a/WordPress/Classes/Utility/ZendeskUtils.swift b/WordPress/Classes/Utility/ZendeskUtils.swift index 74b44482ffb6..fd0ddc591875 100644 --- a/WordPress/Classes/Utility/ZendeskUtils.swift +++ b/WordPress/Classes/Utility/ZendeskUtils.swift @@ -1,6 +1,7 @@ import Foundation import BuildSettingsKit import WordPressAuthenticator +import WordPressData import WordPressKit import WordPressShared import DesignSystem diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift index e9ed8c89506e..8d1f91ea416b 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/BlogDashboardViewController.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressShared typealias DashboardCollectionViewCell = UICollectionViewCell & Reusable & BlogDashboardCardConfigurable @@ -158,7 +159,7 @@ final class BlogDashboardViewController: UIViewController { NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil) } - @objc private func updateCollectionViewHeight(notification: Notification) { + @objc private func updateCollectionViewHeight(notification: WordPressData.Notification) { collectionView.collectionViewLayout.invalidateLayout() } diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Helpers/DashboardPostsSyncManager.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Helpers/DashboardPostsSyncManager.swift index 24948b96cc5a..16b97b0acf32 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Helpers/DashboardPostsSyncManager.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Helpers/DashboardPostsSyncManager.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData protocol DashboardPostsSyncManagerListener: AnyObject { func postsSynced(success: Bool, diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Service/BlogDashboardPersonalizationService.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Service/BlogDashboardPersonalizationService.swift index 704ac97d8832..f9750c61380b 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Service/BlogDashboardPersonalizationService.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Service/BlogDashboardPersonalizationService.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import WordPressKit import WordPressShared diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController+Activity.swift b/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController+Activity.swift index 4441ca705e5c..30b1e45ad808 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController+Activity.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController+Activity.swift @@ -1,11 +1,12 @@ import Foundation +import WordPressData extension BlogDetailsViewController: SearchableActivityConvertable { - var activityType: String { + public var activityType: String { return WPActivityType.siteDetails.rawValue } - var activityTitle: String { + public var activityTitle: String { if let siteName { return siteName } else if let displayURL { @@ -15,7 +16,7 @@ extension BlogDetailsViewController: SearchableActivityConvertable { return NSLocalizedString("My Site", comment: "Generic name for the detail screen for specific site - used for spotlight indexing on iOS. Note: this is only used if we cannot determine a name chances of this being used are small.") } - var activityKeywords: Set? { + public var activityKeywords: Set? { let keyWordString = NSLocalizedString("wordpress, sites, site, blogs, blog", comment: "This is a comma separated list of keywords used for spotlight indexing of the 'My Sites' tab.") var keywordArray = keyWordString.arrayOfTags() @@ -34,7 +35,7 @@ extension BlogDetailsViewController: SearchableActivityConvertable { return Set(keywordArray) } - var activityUserInfo: [String: String]? { + public var activityUserInfo: [String: String]? { var siteID: String if let dotComID = blog.dotComID, dotComID.intValue > 0 { siteID = dotComID.stringValue @@ -46,7 +47,7 @@ extension BlogDetailsViewController: SearchableActivityConvertable { return [WPActivityUserInfoKeys.siteId.rawValue: siteID] } - var activityDescription: String? { + public var activityDescription: String? { guard let displayURL else { return nil } diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m b/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m index bec5c27fc472..509035bbd7eb 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.m @@ -3,11 +3,10 @@ #import "AccountService.h" #import "BlogService.h" #import "CommentsViewController.h" -@import WordPressDataObjC; +@import WordPressData; #import "SiteSettingsViewController.h" #import "SharingViewController.h" #import "StatsViewController.h" -#import "WPAccount.h" #import "WPAppAnalytics.h" #import "WordPress-Swift.h" #import "MenusViewController.h" diff --git a/WordPress/Classes/ViewRelated/Blog/Sharing/PublicizeServiceCell.swift b/WordPress/Classes/ViewRelated/Blog/Sharing/PublicizeServiceCell.swift index f4e91cd1b705..a7180b5b3819 100644 --- a/WordPress/Classes/ViewRelated/Blog/Sharing/PublicizeServiceCell.swift +++ b/WordPress/Classes/ViewRelated/Blog/Sharing/PublicizeServiceCell.swift @@ -89,3 +89,13 @@ private extension PublicizeService.ServiceName { private enum Strings { static let numberOfAccounts = NSLocalizedString("socialSharing.connectionDetails.nAccount", value: "%d accounts", comment: "The number of connected accounts on a third party sharing service connected to the user's blog. The '%d' is a placeholder for the number of accounts.") } + +import WordPressData + +extension PublicizeService.ServiceName { + + /// Returns the local image for the icon representing the social network. + var localIconImage: UIImage { + WPStyleGuide.socialIcon(for: rawValue as NSString) + } +} diff --git a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingAuthorizationHelper.m b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingAuthorizationHelper.m index 3c061468a021..21288b72b713 100644 --- a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingAuthorizationHelper.m +++ b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingAuthorizationHelper.m @@ -1,7 +1,6 @@ #import "SharingAuthorizationHelper.h" - -#import "Blog.h" #import "BlogService.h" +@import WordPressData; #import "WordPress-Swift.h" @@ -207,7 +206,7 @@ - (void)fetchKeyringConnectionsForService:(PublicizeService *)pubServ fromViewController:weakSelf.navController]; return; } - + [weakSelf showAccountSelectorForKeyrings:marr]; } failure:^(NSError * __unused error) { if ([self.delegate respondsToSelector:@selector(sharingAuthorizationHelper:keyringFetchFailedForService:)]) { diff --git a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingConnectionsViewController.m b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingConnectionsViewController.m index d4aec707d768..bdaa0c1d56f8 100644 --- a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingConnectionsViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingConnectionsViewController.m @@ -1,6 +1,5 @@ #import "SharingConnectionsViewController.h" - -#import "Blog.h" +@import WordPressData; #import "BlogService.h" #import "SharingDetailViewController.h" #import "SharingAuthorizationHelper.h" diff --git a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingDetailViewController.m b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingDetailViewController.m index c5e75092d07e..d003cfb1c173 100644 --- a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingDetailViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingDetailViewController.m @@ -1,5 +1,5 @@ #import "SharingDetailViewController.h" -#import "Blog.h" +@import WordPressData; #import "BlogService.h" #import "SharingAuthorizationHelper.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingViewController.m b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingViewController.m index 721e9d6459cc..42f33248e864 100644 --- a/WordPress/Classes/ViewRelated/Blog/Sharing/SharingViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Sharing/SharingViewController.m @@ -1,5 +1,5 @@ #import "SharingViewController.h" -#import "Blog.h" +@import WordPressData; #import "BlogService.h" #import "SharingConnectionsViewController.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/ViewRelated/Blog/Site Picker/BlogList/BlogListSiteView.swift b/WordPress/Classes/ViewRelated/Blog/Site Picker/BlogList/BlogListSiteView.swift index 8ee2a7bd9525..f40b53f2a7ed 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Picker/BlogList/BlogListSiteView.swift +++ b/WordPress/Classes/ViewRelated/Blog/Site Picker/BlogList/BlogListSiteView.swift @@ -1,4 +1,5 @@ import SwiftUI +import WordPressData import WordPressUI import WordPressShared diff --git a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m index 96690ff1cbc8..f876e1a108aa 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Blog/Site Settings/SiteSettingsViewController.m @@ -1,9 +1,7 @@ #import "SiteSettingsViewController.h" -#import "Blog.h" #import "BlogService.h" -@import WordPressDataObjC; -#import "PostCategory.h" +@import WordPressData; #import "PostCategoryService.h" #import "SettingsSelectionViewController.h" #import "SettingsMultiTextViewController.h" @@ -15,7 +13,6 @@ @import WordPressKit; @import WordPressShared; -@import NSURL_IDN; NS_ENUM(NSInteger, SiteSettingsAccount) { SiteSettingsAccountUsername = 0, diff --git a/WordPress/Classes/ViewRelated/Comments/Controllers/CommentDetailViewController.swift b/WordPress/Classes/ViewRelated/Comments/Controllers/CommentDetailViewController.swift index 694227acc036..d899c6a2d558 100644 --- a/WordPress/Classes/ViewRelated/Comments/Controllers/CommentDetailViewController.swift +++ b/WordPress/Classes/ViewRelated/Comments/Controllers/CommentDetailViewController.swift @@ -1,5 +1,6 @@ import UIKit import CoreData +import WordPressData import WordPressUI import Aztec @@ -47,7 +48,7 @@ class CommentDetailViewController: UIViewController, NoResultsViewHost { } } } - private var notification: Notification? + private var notification: WordPressData.Notification? private let helper = ReaderCommentsHelper() private var isNotificationComment: Bool { @@ -218,7 +219,7 @@ class CommentDetailViewController: UIViewController, NoResultsViewHost { } init(comment: Comment, - notification: Notification, + notification: WordPressData.Notification, notificationDelegate: CommentDetailsNotificationDelegate?, managedObjectContext: NSManagedObjectContext = ContextManager.shared.mainContext) { self.comment = comment @@ -267,7 +268,7 @@ class CommentDetailViewController: UIViewController, NoResultsViewHost { } // Update the Notification Comment being displayed. - func refreshView(comment: Comment, notification: Notification) { + func refreshView(comment: Comment, notification: WordPressData.Notification) { hideNoResults() self.notification = notification displayComment(comment) diff --git a/WordPress/Classes/ViewRelated/Comments/Controllers/CommentsViewController.m b/WordPress/Classes/ViewRelated/Comments/Controllers/CommentsViewController.m index b28450406825..9ee1b530f320 100644 --- a/WordPress/Classes/ViewRelated/Comments/Controllers/CommentsViewController.m +++ b/WordPress/Classes/ViewRelated/Comments/Controllers/CommentsViewController.m @@ -1,5 +1,5 @@ #import "CommentsViewController.h" -#import "Blog.h" +@import WordPressData; #import "WordPress-Swift.h" #import "WPTableViewHandler.h" diff --git a/WordPress/Classes/ViewRelated/Comments/Controllers/Edit/CommentEditViewModel.swift b/WordPress/Classes/ViewRelated/Comments/Controllers/Edit/CommentEditViewModel.swift index 8e35d081da62..10a53ab8fff9 100644 --- a/WordPress/Classes/ViewRelated/Comments/Controllers/Edit/CommentEditViewModel.swift +++ b/WordPress/Classes/ViewRelated/Comments/Controllers/Edit/CommentEditViewModel.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressData import WordPressShared final class CommentEditViewModel { diff --git a/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentCellViewModel.swift b/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentCellViewModel.swift index d14cef207898..c7affae0739a 100644 --- a/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentCellViewModel.swift +++ b/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentCellViewModel.swift @@ -1,18 +1,19 @@ import UIKit import Combine +import WordPressData import WordPressShared final class CommentCellViewModel: NSObject { @objc let comment: Comment - private let notification: Notification? + private let notification: WordPressData.Notification? private let coreDataStack = ContextManager.shared @Published private(set) var content: String? @Published private(set) var avatar: Avatar? @Published private(set) var state: State - init(comment: Comment, notification: Notification? = nil) { + init(comment: Comment, notification: WordPressData.Notification? = nil) { self.comment = comment self.notification = notification diff --git a/WordPress/Classes/ViewRelated/Likes/LikesListController.swift b/WordPress/Classes/ViewRelated/Likes/LikesListController.swift index 0e1f4c7a5b77..591db35ccc91 100644 --- a/WordPress/Classes/ViewRelated/Likes/LikesListController.swift +++ b/WordPress/Classes/ViewRelated/Likes/LikesListController.swift @@ -1,5 +1,5 @@ -import Foundation import UIKit +import WordPressData import WordPressShared import WordPressKit import FormattableContentKit @@ -27,7 +27,7 @@ class LikesListController: NSObject { private let formatter = FormattableContentFormatter() private let content: ContentIdentifier private let siteID: NSNumber - private var notification: Notification? = nil + private var notification: WordPressData.Notification? = nil private var readerPost: ReaderPost? = nil private let tableView: UITableView private var loadingIndicator = UIActivityIndicatorView() @@ -89,7 +89,7 @@ class LikesListController: NSObject { /// Init with Notification /// - init?(tableView: UITableView, notification: Notification, delegate: LikesListControllerDelegate? = nil) { + init?(tableView: UITableView, notification: WordPressData.Notification, delegate: LikesListControllerDelegate? = nil) { guard let siteID = notification.metaSiteID else { return nil diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift b/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift index 8bf9d1246bdf..002621a5fc5f 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/AppSettingsViewController.swift @@ -71,7 +71,7 @@ class AppSettingsViewController: UITableViewController { } @objc - private func accountSettingsDidChange(_ notification: Notification) { + private func accountSettingsDidChange(_ notification: WordPressData.Notification) { reloadViewModel() } diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift b/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift index 056c827081b2..42298bfa2441 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift @@ -55,7 +55,7 @@ class PrivacySettingsViewController: UITableViewController { } @objc - private func accountSettingsDidChange(_ notification: Notification) { + private func accountSettingsDidChange(_ notification: WordPressData.Notification) { reloadViewModel() } diff --git a/WordPress/Classes/ViewRelated/Media/MediaItemViewController.swift b/WordPress/Classes/ViewRelated/Media/MediaItemViewController.swift index 9ae4966d1cba..0dda3b5d18d8 100644 --- a/WordPress/Classes/ViewRelated/Media/MediaItemViewController.swift +++ b/WordPress/Classes/ViewRelated/Media/MediaItemViewController.swift @@ -3,6 +3,7 @@ import Combine import UIKit import Gridicons import SVProgressHUD +import WordPressData import WordPressShared /// Displays an image preview and metadata for a single Media asset. diff --git a/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCell.swift b/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCell.swift index dc06177a30be..70bcbeb6543e 100644 --- a/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCell.swift +++ b/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCell.swift @@ -2,6 +2,7 @@ import UIKit import Combine import Gifu import AsyncImageKit +import WordPressData import WordPressUI final class SiteMediaCollectionCell: UICollectionViewCell, Reusable { diff --git a/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCellViewModel.swift b/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCellViewModel.swift index 5c32bf76fe12..ba8420dcc7f2 100644 --- a/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCellViewModel.swift +++ b/WordPress/Classes/ViewRelated/Media/SiteMedia/Views/SiteMediaCollectionCellViewModel.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData final class SiteMediaCollectionCellViewModel { let mediaID: TaggedManagedObjectID diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuDetailsViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuDetailsViewController.m index 52422b803412..207752b60759 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuDetailsViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuDetailsViewController.m @@ -1,8 +1,8 @@ #import "MenuDetailsViewController.h" #import "Menu.h" #import "Menu+ViewDesign.h" -#import "Blog.h" #import "WPAppAnalytics.h" +@import WordPressData; #import "WordPress-Swift.h" @import WordPressShared; diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuHeaderViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuHeaderViewController.m index fd366c2c6a62..7633cfc25a3a 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuHeaderViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuHeaderViewController.m @@ -1,9 +1,9 @@ #import "MenuHeaderViewController.h" #import "MenusSelectionView.h" -#import "Blog.h" #import "Menu.h" #import "Menu+ViewDesign.h" #import "MenuLocation.h" +@import WordPressData; #import "WordPress-Swift.h" @import WordPressShared; diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemCategoriesViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemCategoriesViewController.m index 10a29b1d8f2a..8627062a7eee 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemCategoriesViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemCategoriesViewController.m @@ -1,9 +1,8 @@ #import "MenuItemCategoriesViewController.h" -#import "PostCategory.h" #import "PostCategoryService.h" #import "Menu.h" #import "MenuItem.h" -#import "Blog.h" +@import WordPressData; #import "WordPress-Swift.h" static NSUInteger const CategorySyncLimit = 1000; diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemEditingViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemEditingViewController.m index 6479440eea5f..3e836da6f572 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemEditingViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemEditingViewController.m @@ -1,12 +1,11 @@ #import "MenuItemEditingViewController.h" #import "Menu.h" #import "MenuItem.h" -#import "Blog.h" #import "MenuItemEditingHeaderView.h" #import "MenuItemEditingFooterView.h" #import "MenuItemSourceViewController.h" #import "MenuItemTypeViewController.h" -@import WordPressDataObjC; +@import WordPressData; #import "WordPress-Swift.h" @import WordPressShared; diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemSourceResultsViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemSourceResultsViewController.m index 5deb0b131460..66a5f67b22a2 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemSourceResultsViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemSourceResultsViewController.m @@ -2,8 +2,8 @@ #import "MenuItemSourceTextBar.h" #import "Menu.h" #import "MenuItemSourceFooterView.h" -#import "Blog.h" #import "Menu+ViewDesign.h" +@import WordPressData; #import "WordPress-Swift.h" @import WordPressShared; diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTagsViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTagsViewController.m index 7e2cabc7b989..bf8830adf735 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTagsViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTagsViewController.m @@ -3,7 +3,7 @@ #import "PostTag.h" #import "Menu.h" #import "MenuItem.h" -#import "Blog.h" +@import WordPressData; static NSUInteger const MenuItemSourceTagSyncLimit = 100; diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTypeViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTypeViewController.m index 8bd50349b9c7..7dc9d418fd36 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTypeViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemTypeViewController.m @@ -1,8 +1,8 @@ #import "MenuItemTypeViewController.h" #import "MenuItemTypeSelectionView.h" #import "BlogService.h" -#import "Blog.h" #import "PostType.h" +@import WordPressData; #import "WordPress-Swift.h" @interface MenuItemTypeViewController () diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemsViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemsViewController.m index b20d0b8b07ab..9f769b6eb8fd 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemsViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenuItemsViewController.m @@ -5,7 +5,7 @@ #import "MenuItemView.h" #import "MenuItemInsertionView.h" #import "MenuItemsVisualOrderingView.h" -@import WordPressDataObjC; +@import WordPressData; #import "Menu+ViewDesign.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.m b/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.m index 533cc946d2f3..ff35ee24a609 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.m +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.m @@ -1,5 +1,4 @@ #import "MenusViewController.h" -#import "Blog.h" #import "MenusService.h" #import "Menu.h" #import "MenuLocation.h" @@ -9,7 +8,7 @@ #import "MenuItemsViewController.h" #import "MenuItemEditingViewController.h" #import "Menu+ViewDesign.h" -@import WordPressDataObjC; +@import WordPressData; #import "WPAppAnalytics.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.swift b/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.swift index a96d3d08dae6..57adfc7f6218 100644 --- a/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.swift +++ b/WordPress/Classes/ViewRelated/Menus/Controllers/MenusViewController.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData extension MenusViewController { diff --git a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationCommentDetailViewController.swift b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationCommentDetailViewController.swift index 9111d2e7a2b1..4ed0c293412c 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationCommentDetailViewController.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationCommentDetailViewController.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressUI class NotificationCommentDetailViewController: UIViewController, NoResultsViewHost { @@ -7,7 +8,7 @@ class NotificationCommentDetailViewController: UIViewController, NoResultsViewHo private var content: Content? - private var notification: Notification { + private var notification: WordPressData.Notification { didSet { title = notification.title } @@ -87,7 +88,7 @@ class NotificationCommentDetailViewController: UIViewController, NoResultsViewHo // MARK: - Init - init(notification: Notification, + init(notification: WordPressData.Notification, notificationDelegate: CommentDetailsNotificationDelegate) { self.notification = notification self.notificationDelegate = notificationDelegate @@ -114,7 +115,7 @@ class NotificationCommentDetailViewController: UIViewController, NoResultsViewHo configureNavBarButtons() } - func refreshViewController(notification: Notification) { + func refreshViewController(notification: WordPressData.Notification) { self.notification = notification loadComment() } @@ -196,7 +197,7 @@ private extension NotificationCommentDetailViewController { /// - notification: The notification object, used for additional information like site ID. /// /// - Returns: Either `.readerComments` with a `ReaderCommentsViewController` or `.commentDetails` with a `CommentDetailViewController`. - private func makeNewContent(with comment: Comment, notification: Notification) -> Content { + private func makeNewContent(with comment: Comment, notification: WordPressData.Notification) -> Content { let blogSupportsWpcomRestAPI: Bool = { return blog?.supports(.wpComRESTAPI) ?? true }() diff --git a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationContentRouter.swift b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationContentRouter.swift index dd9cd639192b..615a536bcdab 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationContentRouter.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationContentRouter.swift @@ -1,12 +1,13 @@ import UIKit import FormattableContentKit +import WordPressData struct NotificationContentRouter { private let coordinator: ContentCoordinator - private let notification: Notification + private let notification: WordPressData.Notification private let expirationFiveMinutes = TimeInterval(60 * 5) - init(activity: Notification, coordinator: ContentCoordinator) { + init(activity: WordPressData.Notification, coordinator: ContentCoordinator) { self.coordinator = coordinator self.notification = activity } diff --git a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationDetailsViewController.swift b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationDetailsViewController.swift index 902565ff65a0..7e601028fbbe 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationDetailsViewController.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationDetailsViewController.swift @@ -2,6 +2,7 @@ import Foundation import CoreData import Gridicons import SVProgressHUD +import WordPressData import WordPressShared import WordPressUI import FormattableContentKit @@ -9,8 +10,8 @@ import FormattableContentKit /// /// protocol NotificationsNavigationDataSource: AnyObject { - func notification(succeeding note: Notification) -> Notification? - func notification(preceding note: Notification) -> Notification? + func notification(succeeding note: WordPressData.Notification) -> WordPressData.Notification? + func notification(preceding note: WordPressData.Notification) -> WordPressData.Notification? } // MARK: - Renders a given Notification entity, onscreen @@ -75,7 +76,7 @@ class NotificationDetailsViewController: UIViewController, NoResultsViewHost { /// Notification being displayed /// - var note: Notification! { + var note: WordPressData.Notification! { didSet { guard oldValue != note && isViewLoaded else { return @@ -110,7 +111,7 @@ class NotificationDetailsViewController: UIViewController, NoResultsViewHost { /// Closure to be executed whenever the notification that's being currently displayed, changes. /// This happens due to Navigation Events (Next / Previous) /// - var onSelectedNoteChange: ((Notification) -> Void)? + var onSelectedNoteChange: ((WordPressData.Notification) -> Void)? var likesListController: LikesListController? @@ -785,7 +786,7 @@ extension NotificationDetailsViewController { refreshView(with: next) } - private func refreshView(with note: Notification) { + private func refreshView(with note: WordPressData.Notification) { onSelectedNoteChange?(note) trackDetailsOpened(for: note) @@ -799,7 +800,7 @@ extension NotificationDetailsViewController { showConfettiIfNeeded() } - private func showCommentDetails(with note: Notification) { + private func showCommentDetails(with note: WordPressData.Notification) { guard let commentDetailViewController = notificationCommentDetailCoordinator?.createViewController(with: note) else { DDLogError("Notification Details: failed creating Comment Detail view.") return @@ -875,7 +876,7 @@ private extension NotificationDetailsViewController { // MARK: - Tracks extension NotificationDetailsViewController { /// Tracks notification details opened - private func trackDetailsOpened(for note: Notification) { + private func trackDetailsOpened(for note: WordPressData.Notification) { let properties = ["notification_type": note.type ?? "unknown"] WPAnalytics.track(.openedNotificationDetails, withProperties: properties) } diff --git a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationTableViewCell.swift b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationTableViewCell.swift index 56b46360c130..8127af87657b 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationTableViewCell.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationTableViewCell.swift @@ -9,12 +9,12 @@ final class NotificationTableViewCell: HostingTableViewCell Void) { + func configure(with notification: WordPressData.Notification, deletionRequest: NotificationDeletionRequest, parent: NotificationsViewController, onDeletionRequestCanceled: @escaping () -> Void) { let style = NotificationsTableViewCellContent.Style.altered(.init(text: deletionRequest.kind.legendText, action: onDeletionRequestCanceled)) self.host(.init(style: style), parent: parent) } - func configure(with viewModel: NotificationsViewModel, notification: Notification, parent: NotificationsViewController) { + func configure(with viewModel: NotificationsViewModel, notification: WordPressData.Notification, parent: NotificationsViewController) { let title: AttributedString? = { guard let attributedSubject = notification.renderSubject() else { return nil @@ -38,7 +38,7 @@ final class NotificationTableViewCell: HostingTableViewCell NotificationsTableViewCellContent.InlineAction.Configuration? { + private func inlineAction(viewModel: NotificationsViewModel, notification: WordPressData.Notification, parent: NotificationsViewController) -> NotificationsTableViewCellContent.InlineAction.Configuration? { let notification = notification.parsed() switch notification { case .comment(let notification): @@ -53,7 +53,7 @@ final class NotificationTableViewCell: HostingTableViewCell NotificationsTableViewCellContent.InlineAction.Configuration { + private func shareInlineAction(viewModel: NotificationsViewModel, notification: WordPressData.Notification, parent: UIViewController) -> NotificationsTableViewCellContent.InlineAction.Configuration { let action: () -> Void = { [weak self] in guard let self, let content = viewModel.sharePostActionTapped(with: notification) else { return diff --git a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewController.swift b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewController.swift index af91039c6f81..e11d5fde6c2d 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewController.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewController.swift @@ -79,7 +79,7 @@ class NotificationsViewController: UIViewController, UITableViewDataSource, UITa /// Used to keep track of the currently selected notification, /// to restore it between table view reloads and state restoration. /// - fileprivate var selectedNotification: Notification? = nil + fileprivate var selectedNotification: WordPressData.Notification? = nil /// JetpackLoginVC being presented. /// @@ -284,7 +284,7 @@ class NotificationsViewController: UIViewController, UITableViewDataSource, UITa func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: TableViewCell.reuseIdentifier) as? TableViewCell, - let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? Notification else { + let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? WordPressData.Notification else { return UITableViewCell() } cell.selectionStyle = splitViewControllerIsHorizontallyCompact ? .none : .default @@ -347,7 +347,7 @@ class NotificationsViewController: UIViewController, UITableViewDataSource, UITa func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { // Failsafe: Make sure that the Notification (still) exists - guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? Notification else { + guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? WordPressData.Notification else { tableView.deselectSelectedRowWithAnimation(true) return } @@ -371,7 +371,7 @@ class NotificationsViewController: UIViewController, UITableViewDataSource, UITa func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { // skip when the notification is marked for deletion. - guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? Notification, + guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? WordPressData.Notification, deletionRequestForNoteWithID(note.objectID) == nil else { return nil } @@ -398,7 +398,7 @@ class NotificationsViewController: UIViewController, UITableViewDataSource, UITa func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? { // skip when the notification is marked for deletion. - guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? Notification, + guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? WordPressData.Notification, let block: FormattableCommentContent = note.contentGroup(ofKind: .comment)?.blockOfKind(.comment), deletionRequestForNoteWithID(note.objectID) == nil else { return nil @@ -426,7 +426,7 @@ class NotificationsViewController: UIViewController, UITableViewDataSource, UITa return configuration } - fileprivate func configureDetailsViewController(_ detailsViewController: NotificationDetailsViewController, withNote note: Notification) { + fileprivate func configureDetailsViewController(_ detailsViewController: NotificationDetailsViewController, withNote note: WordPressData.Notification) { detailsViewController.navigationItem.largeTitleDisplayMode = .never detailsViewController.hidesBottomBarWhenPushed = true detailsViewController.dataSource = self @@ -483,7 +483,7 @@ private extension NotificationsViewController { func makeMoreMenuElements() -> [UIAction] { // Mark All As Read let markAllAsRead: UIAction? = { () -> UIAction? in - guard let notes = tableViewHandler.resultsController?.fetchedObjects as? [Notification] else { + guard let notes = tableViewHandler.resultsController?.fetchedObjects as? [WordPressData.Notification] else { return nil } let isEnabled = notes.first { !$0.read } != nil @@ -695,7 +695,7 @@ private extension NotificationsViewController { @objc func dynamicTypeDidChange() { tableViewHandler.resultsController?.fetchedObjects?.forEach { - ($0 as? Notification)?.resetCachedAttributes() + ($0 as? WordPressData.Notification)?.resetCachedAttributes() } } } @@ -725,7 +725,7 @@ extension NotificationsViewController { /// Pushes the details for a given Notification Instance. /// - private func showDetails(for note: Notification) { + private func showDetails(for note: WordPressData.Notification) { DDLogInfo("Pushing Notification Details for: [\(note.notificationId)]") // Before trying to show the details of a notification, we need to make sure the view is loaded. @@ -792,7 +792,7 @@ extension NotificationsViewController { presentDetails(for: note) } - private func presentDetails(for note: Notification) { + private func presentDetails(for note: WordPressData.Notification) { // This dispatch avoids a bug that was occurring occasionally where navigation (nav bar and tab bar) // would be missing entirely when launching the app from the background and presenting a notification. // The issue seems tied to performing a `pop` in `prepareToShowDetails` and presenting @@ -819,7 +819,7 @@ extension NotificationsViewController { } } - private func getNotificationCommentDetailViewController(for note: Notification) -> NotificationCommentDetailViewController? { + private func getNotificationCommentDetailViewController(for note: WordPressData.Notification) -> NotificationCommentDetailViewController? { guard let commentDetailViewController = self.notificationCommentDetailCoordinator.createViewController(with: note) else { DDLogError("Notifications: failed creating Comment Detail view.") return nil @@ -833,7 +833,7 @@ extension NotificationsViewController { return commentDetailViewController } - private func getNotificationDetailsViewController(for note: Notification) -> NotificationDetailsViewController? { + private func getNotificationDetailsViewController(for note: WordPressData.Notification) -> NotificationDetailsViewController? { let viewControllerID = NotificationDetailsViewController.classNameWithoutNamespaces() let detailsViewController = storyboard?.instantiateViewController(withIdentifier: viewControllerID) guard let detailsViewController = detailsViewController as? NotificationDetailsViewController else { @@ -859,7 +859,7 @@ extension NotificationsViewController { /// Tracks: Details Event! /// - private func trackWillPushDetails(for note: Notification) { + private func trackWillPushDetails(for note: WordPressData.Notification) { // Ensure we don't track if the app has been launched by a push notification in the background if UIApplication.shared.applicationState != .background { let properties = [Stats.noteTypeKey: note.type ?? Stats.noteTypeUnknown] @@ -879,13 +879,13 @@ extension NotificationsViewController { /// This method will make sure the Notification that's about to be displayed is not currently being filtered. /// - private func ensureNoteIsNotBeingFiltered(_ note: Notification) { + private func ensureNoteIsNotBeingFiltered(_ note: WordPressData.Notification) { guard filter != .none else { return } let noteIndexPath = tableView.indexPathsForVisibleRows?.first { indexPath in - return note == tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? Notification + return note == tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? WordPressData.Notification } guard noteIndexPath == nil else { @@ -987,7 +987,7 @@ private extension NotificationsViewController { @objc func removeDeletedNotification(notification: NSNotification) { guard let userInfo = notification.userInfo, let deletedCommentID = userInfo[userInfoCommentIdKey] as? Int32, - let notifications = tableViewHandler.resultsController?.fetchedObjects as? [Notification] else { + let notifications = tableViewHandler.resultsController?.fetchedObjects as? [WordPressData.Notification] else { return } @@ -1002,7 +1002,7 @@ private extension NotificationsViewController { syncDeletedNotification(notification) } - func syncDeletedNotification(_ notification: Notification?) { + func syncDeletedNotification(_ notification: WordPressData.Notification?) { guard let notification else { return } @@ -1014,14 +1014,14 @@ private extension NotificationsViewController { }) } - func selectNextAvailableNotification(ignoring: [Notification]) { + func selectNextAvailableNotification(ignoring: [WordPressData.Notification]) { // If the currently selected notification is about to be removed, find the next available and select it. // This is only necessary for split view to prevent the details from showing for removed notifications. if !splitViewControllerIsHorizontallyCompact, let selectedNotification, ignoring.contains(selectedNotification) { - guard let notifications = tableViewHandler.resultsController?.fetchedObjects as? [Notification], + guard let notifications = tableViewHandler.resultsController?.fetchedObjects as? [WordPressData.Notification], let nextAvailable = notifications.first(where: { !ignoring.contains($0) }), let indexPath = tableViewHandler.resultsController?.indexPath(forObject: nextAvailable) else { self.selectedNotification = nil @@ -1058,7 +1058,7 @@ private extension NotificationsViewController { markAsRead(note: note) } - func markAsRead(note: Notification) { + func markAsRead(note: WordPressData.Notification) { guard !note.read else { return } @@ -1069,7 +1069,7 @@ private extension NotificationsViewController { /// Marks all messages as read under the selected filter. /// @objc func markAllAsRead() { - guard let notes = tableViewHandler.resultsController?.fetchedObjects as? [Notification] else { + guard let notes = tableViewHandler.resultsController?.fetchedObjects as? [WordPressData.Notification] else { return } @@ -1121,7 +1121,7 @@ private extension NotificationsViewController { present(alertController, animated: true, completion: nil) } - func markAsUnread(note: Notification) { + func markAsUnread(note: WordPressData.Notification) { guard note.read else { return } @@ -1144,7 +1144,7 @@ private extension NotificationsViewController { /// Updates the cached list of unread notifications, and optionally reloads the results controller. /// func refreshUnreadNotifications(reloadingResultsController: Bool = true) { - guard let notes = tableViewHandler.resultsController?.fetchedObjects as? [Notification] else { + guard let notes = tableViewHandler.resultsController?.fetchedObjects as? [WordPressData.Notification] else { return } @@ -1218,7 +1218,7 @@ private extension NotificationsViewController { } } - func selectRow(for notification: Notification, animated: Bool = true, + func selectRow(for notification: WordPressData.Notification, animated: Bool = true, scrollPosition: UITableView.ScrollPosition = .none) { selectedNotification = notification @@ -1313,7 +1313,7 @@ extension NotificationsViewController { } // If we don't currently have a selected notification and there is a notification in the list, then select it. - if let firstNotification = tableViewHandler.resultsController?.fetchedObjects?.first as? Notification, + if let firstNotification = tableViewHandler.resultsController?.fetchedObjects?.first as? WordPressData.Notification, let indexPath = tableViewHandler.resultsController?.indexPath(forObject: firstNotification) { selectRow(for: firstNotification, animated: false, scrollPosition: .none) self.tableView(tableView, didSelectRowAt: indexPath) @@ -1365,7 +1365,7 @@ extension NotificationsViewController: WPTableViewHandlerDelegate { } func configureCell(_ cell: UITableViewCell, at indexPath: IndexPath) { - guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? Notification, + guard let note = tableViewHandler.resultsController?.managedObject(atUnsafe: indexPath) as? WordPressData.Notification, let cell = cell as? ListTableViewCell else { return } @@ -1397,7 +1397,7 @@ extension NotificationsViewController: WPTableViewHandlerDelegate { func tableViewWillChangeContent(_ tableView: UITableView) { guard shouldCountNotificationsForSecondAlert, - let notification = tableViewHandler.resultsController?.fetchedObjects?.first as? Notification, + let notification = tableViewHandler.resultsController?.fetchedObjects?.first as? WordPressData.Notification, let timestamp = notification.timestamp else { timestampBeforeUpdatesForSecondAlert = nil return @@ -1441,7 +1441,7 @@ extension NotificationsViewController: WPTableViewHandlerDelegate { private var newNotificationsForSecondAlert: Int { guard let previousTimestamp = timestampBeforeUpdatesForSecondAlert, - let notifications = tableViewHandler.resultsController?.fetchedObjects as? [Notification] else { + let notifications = tableViewHandler.resultsController?.fetchedObjects as? [WordPressData.Notification] else { return 0 } @@ -1453,7 +1453,7 @@ extension NotificationsViewController: WPTableViewHandlerDelegate { return 0 } - private static func accessibilityHint(for note: Notification) -> String? { + private static func accessibilityHint(for note: WordPressData.Notification) -> String? { switch note.kind { case .comment: return NSLocalizedString("Shows details and moderation actions.", @@ -1650,7 +1650,7 @@ private extension NotificationsViewController { mediator?.sync() } - func syncNotification(with noteId: String, timeout: TimeInterval, success: @escaping (_ note: Notification) -> Void) { + func syncNotification(with noteId: String, timeout: TimeInterval, success: @escaping (_ note: WordPressData.Notification) -> Void) { let mediator = NotificationSyncMediator() let startDate = Date() @@ -1673,21 +1673,21 @@ private extension NotificationsViewController { } func updateLastSeenTime() { - guard let note = tableViewHandler.resultsController?.fetchedObjects?.first as? Notification else { + guard let note = tableViewHandler.resultsController?.fetchedObjects?.first as? WordPressData.Notification else { return } viewModel.lastSeenChanged(timestamp: note.timestamp) } - func loadNotification(with noteId: String) -> Notification? { + func loadNotification(with noteId: String) -> WordPressData.Notification? { let predicate = NSPredicate(format: "(notificationId == %@)", noteId) return mainContext.firstObject(ofType: Notification.self, matching: predicate) } - func loadNotification(near note: Notification, withIndexDelta delta: Int) -> Notification? { - guard let notifications = tableViewHandler?.resultsController?.fetchedObjects as? [Notification] else { + func loadNotification(near note: WordPressData.Notification, withIndexDelta delta: Int) -> WordPressData.Notification? { + guard let notifications = tableViewHandler?.resultsController?.fetchedObjects as? [WordPressData.Notification] else { return nil } @@ -1701,7 +1701,7 @@ private extension NotificationsViewController { func resetNotifications() { do { selectedNotification = nil - mainContext.deleteAllObjects(ofType: Notification.self) + mainContext.deleteAllObjects(ofType: WordPressData.Notification.self) try mainContext.save() } catch { DDLogError("Error while trying to nuke Notifications Collection: [\(error)]") @@ -1718,11 +1718,11 @@ private extension NotificationsViewController { // MARK: - Details Navigation Datasource // extension NotificationsViewController: NotificationsNavigationDataSource { - @objc func notification(succeeding note: Notification) -> Notification? { + @objc func notification(succeeding note: WordPressData.Notification) -> WordPressData.Notification? { return loadNotification(near: note, withIndexDelta: -1) } - @objc func notification(preceding note: Notification) -> Notification? { + @objc func notification(preceding note: WordPressData.Notification) -> WordPressData.Notification? { return loadNotification(near: note, withIndexDelta: +1) } } diff --git a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewModel.swift b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewModel.swift index 81214c116523..79503b6428ac 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewModel.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Controllers/NotificationsViewController/NotificationsViewModel.swift @@ -82,10 +82,10 @@ final class NotificationsViewModel { } func loadNotification( - near note: Notification, - allNotifications: [Notification], + near note: WordPressData.Notification, + allNotifications: [WordPressData.Notification], withIndexDelta delta: Int - ) -> Notification? { + ) -> WordPressData.Notification? { guard let noteIndex = allNotifications.firstIndex(of: note) else { return nil } @@ -95,7 +95,7 @@ final class NotificationsViewModel { return nil } - func notMatcher(_ note: Notification) -> Bool { + func notMatcher(_ note: WordPressData.Notification) -> Bool { return note.kind != .matcher } @@ -113,7 +113,7 @@ final class NotificationsViewModel { // MARK: - Handling Inline Actions - func sharePostActionTapped(with notification: Notification) -> ShareablePost? { + func sharePostActionTapped(with notification: WordPressData.Notification) -> ShareablePost? { guard let url = notification.url else { self.crashLogger.logMessage("Failed to share a notification post due to null url", level: .error) return nil @@ -165,7 +165,7 @@ final class NotificationsViewModel { // MARK: - Helpers - private func createSharingTitle(from notification: Notification) -> String { + private func createSharingTitle(from notification: WordPressData.Notification) -> String { guard notification.kind == .like, let header = notification.header, header.count == 2, diff --git a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/BodyContentGroup.swift b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/BodyContentGroup.swift index 43b2f531eae4..1d86ce18074b 100644 --- a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/BodyContentGroup.swift +++ b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/BodyContentGroup.swift @@ -1,7 +1,7 @@ import FormattableContentKit -class BodyContentGroup: FormattableContentGroup { - class func create(from body: [[String: AnyObject]], parent: Notification) -> [FormattableContentGroup] { +public class BodyContentGroup: FormattableContentGroup { + class func create(from body: [[String: AnyObject]], parent: WordPressData.Notification) -> [FormattableContentGroup] { let blocks = NotificationContentFactory.content(from: body, actionsParser: NotificationActionParser(), parent: parent) switch parent.kind { @@ -12,7 +12,7 @@ class BodyContentGroup: FormattableContentGroup { } } - private class func groupsForNonCommentBodyBlocks(_ blocks: [FormattableContent], parent: Notification) -> [FormattableContentGroup] { + private class func groupsForNonCommentBodyBlocks(_ blocks: [FormattableContent], parent: WordPressData.Notification) -> [FormattableContentGroup] { let parentKindsWithFooters: [NotificationKind] = [.follow, .like, .commentLike] let parentMayContainFooter = parentKindsWithFooters.contains(parent.kind) @@ -26,7 +26,7 @@ class BodyContentGroup: FormattableContentGroup { } } - private class func groupsForCommentBodyBlocks(_ blocks: [FormattableContent], parent: Notification) -> [FormattableContentGroup] { + private class func groupsForCommentBodyBlocks(_ blocks: [FormattableContent], parent: WordPressData.Notification) -> [FormattableContentGroup] { guard let comment: FormattableCommentContent = blockOfKind(.comment, from: blocks), let user: FormattableUserContent = blockOfKind(.user, from: blocks) else { return [] diff --git a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/FooterContentGroup.swift b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/FooterContentGroup.swift index 867842f330a3..207466e08c84 100644 --- a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/FooterContentGroup.swift +++ b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/FooterContentGroup.swift @@ -1,4 +1,3 @@ - import FormattableContentKit class FooterContentGroup: FormattableContentGroup { diff --git a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/HeaderContentGroup.swift b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/HeaderContentGroup.swift index 5a8055b15e76..fb15c4bda281 100644 --- a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/HeaderContentGroup.swift +++ b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/HeaderContentGroup.swift @@ -1,7 +1,7 @@ import FormattableContentKit extension HeaderContentGroup { - class func createGroup(from header: [[String: AnyObject]], parent: Notification) -> FormattableContentGroup { + class func createGroup(from header: [[String: AnyObject]], parent: WordPressData.Notification) -> FormattableContentGroup { let blocks = NotificationContentFactory.content(from: header, actionsParser: NotificationActionParser(), parent: parent) return FormattableContentGroup(blocks: blocks, kind: .header) } diff --git a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/SubjectContentGroup.swift b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/SubjectContentGroup.swift index feecfba7ec51..c152eea886c3 100644 --- a/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/SubjectContentGroup.swift +++ b/WordPress/Classes/ViewRelated/Notifications/FormattableContent/Groups/SubjectContentGroup.swift @@ -2,7 +2,7 @@ import FormattableContentKit extension SubjectContentGroup { - class func createGroup(from subject: [[String: AnyObject]], parent: Notification) -> FormattableContentGroup { + class func createGroup(from subject: [[String: AnyObject]], parent: WordPressData.Notification) -> FormattableContentGroup { let blocks = NotificationContentFactory.content(from: subject, actionsParser: NotificationActionParser(), parent: parent) return FormattableContentGroup(blocks: blocks, kind: .subject) } diff --git a/WordPress/Classes/ViewRelated/Notifications/Tools/NotificationCommentDetailCoordinator.swift b/WordPress/Classes/ViewRelated/Notifications/Tools/NotificationCommentDetailCoordinator.swift index ca56af639c72..8e0dc3ddfb6b 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Tools/NotificationCommentDetailCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Tools/NotificationCommentDetailCoordinator.swift @@ -4,9 +4,9 @@ import WordPressShared // This facilitates showing the CommentDetailViewController within the context of Notifications. protocol CommentDetailsNotificationDelegate: AnyObject { - func previousNotificationTapped(current: Notification?) - func nextNotificationTapped(current: Notification?) - func commentWasModerated(for notification: Notification?) + func previousNotificationTapped(current: WordPressData.Notification?) + func nextNotificationTapped(current: WordPressData.Notification?) + func commentWasModerated(for notification: WordPressData.Notification?) } class NotificationCommentDetailCoordinator: NSObject { @@ -16,7 +16,7 @@ class NotificationCommentDetailCoordinator: NSObject { private var viewController: NotificationCommentDetailViewController? private let managedObjectContext = ContextManager.shared.mainContext - private var notification: Notification? { + private var notification: WordPressData.Notification? { didSet { markNotificationReadIfNeeded() } @@ -27,11 +27,11 @@ class NotificationCommentDetailCoordinator: NSObject { // Closure to be executed whenever the notification that's being currently displayed, changes. // This happens due to Navigation Events (Next / Previous) - var onSelectedNoteChange: ((Notification) -> Void)? + var onSelectedNoteChange: ((WordPressData.Notification) -> Void)? // Keep track of Notifications that have moderated Comments so they can be updated // the next time the Notifications list is displayed. - var notificationsCommentModerated: [Notification] = [] + var notificationsCommentModerated: [WordPressData.Notification] = [] // MARK: - Init @@ -42,7 +42,7 @@ class NotificationCommentDetailCoordinator: NSObject { // MARK: - Public Methods - func createViewController(with notification: Notification) -> NotificationCommentDetailViewController? { + func createViewController(with notification: WordPressData.Notification) -> NotificationCommentDetailViewController? { self.notification = notification viewController = NotificationCommentDetailViewController(notification: notification, notificationDelegate: self) updateNavigationButtonStates() @@ -63,7 +63,7 @@ private extension NotificationCommentDetailCoordinator { NotificationSyncMediator()?.markAsRead(notification) } - func updateViewWith(notification: Notification) { + func updateViewWith(notification: WordPressData.Notification) { trackDetailsOpened(for: notification) onSelectedNoteChange?(notification) @@ -75,7 +75,7 @@ private extension NotificationCommentDetailCoordinator { refreshViewControllerWith(notification) } - func showNotificationDetails(with notification: Notification) { + func showNotificationDetails(with notification: WordPressData.Notification) { let storyboard = UIStoryboard(name: Notifications.storyboardName, bundle: nil) guard let viewController, @@ -95,7 +95,7 @@ private extension NotificationCommentDetailCoordinator { navigationController?.pushViewController(notificationDetailsViewController, animated: false) } - func refreshViewControllerWith(_ notification: Notification) { + func refreshViewControllerWith(_ notification: WordPressData.Notification) { self.notification = notification viewController?.refreshViewController(notification: notification) updateNavigationButtonStates() @@ -121,7 +121,7 @@ private extension NotificationCommentDetailCoordinator { return notificationsNavigationDataSource?.notification(succeeding: notification) != nil } - func trackDetailsOpened(for notification: Notification) { + func trackDetailsOpened(for notification: WordPressData.Notification) { let properties = ["notification_type": notification.type ?? "unknown"] WPAnalytics.track(.openedNotificationDetails, withProperties: properties) } @@ -137,7 +137,7 @@ private extension NotificationCommentDetailCoordinator { extension NotificationCommentDetailCoordinator: CommentDetailsNotificationDelegate { - func previousNotificationTapped(current: Notification?) { + func previousNotificationTapped(current: WordPressData.Notification?) { guard let current, let previousNotification = notificationsNavigationDataSource?.notification(preceding: current) else { return @@ -147,7 +147,7 @@ extension NotificationCommentDetailCoordinator: CommentDetailsNotificationDelega updateViewWith(notification: previousNotification) } - func nextNotificationTapped(current: Notification?) { + func nextNotificationTapped(current: WordPressData.Notification?) { guard let current, let nextNotification = notificationsNavigationDataSource?.notification(succeeding: current) else { return @@ -157,7 +157,7 @@ extension NotificationCommentDetailCoordinator: CommentDetailsNotificationDelega updateViewWith(notification: nextNotification) } - func commentWasModerated(for notification: Notification?) { + func commentWasModerated(for notification: WordPressData.Notification?) { guard let notification, !notificationsCommentModerated.contains(notification) else { return diff --git a/WordPress/Classes/ViewRelated/Notifications/Views/ListTableViewCell+Notifications.swift b/WordPress/Classes/ViewRelated/Notifications/Views/ListTableViewCell+Notifications.swift index acb1e98df488..9facdefeabcd 100644 --- a/WordPress/Classes/ViewRelated/Notifications/Views/ListTableViewCell+Notifications.swift +++ b/WordPress/Classes/ViewRelated/Notifications/Views/ListTableViewCell+Notifications.swift @@ -4,7 +4,7 @@ import WordPressShared /// Encapsulates logic that configures `ListTableViewCell` with `Notification` models. /// extension ListTableViewCell { - func configureWithNotification(_ notification: Notification) { + func configureWithNotification(_ notification: WordPressData.Notification) { indicatorColor = Style.unreadIndicatorColor showsIndicator = !notification.read configureImage(with: notification.iconURL) diff --git a/WordPress/Classes/ViewRelated/Pages/Controllers/PageListViewController.swift b/WordPress/Classes/ViewRelated/Pages/Controllers/PageListViewController.swift index 17a74ba53c0f..dc95412bb81e 100644 --- a/WordPress/Classes/ViewRelated/Pages/Controllers/PageListViewController.swift +++ b/WordPress/Classes/ViewRelated/Pages/Controllers/PageListViewController.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressShared import WordPressFlux import WordPressUI diff --git a/WordPress/Classes/ViewRelated/People/Controllers/InvitePersonViewController.swift b/WordPress/Classes/ViewRelated/People/Controllers/InvitePersonViewController.swift index 298f2751d687..30b94ea4ec7e 100644 --- a/WordPress/Classes/ViewRelated/People/Controllers/InvitePersonViewController.swift +++ b/WordPress/Classes/ViewRelated/People/Controllers/InvitePersonViewController.swift @@ -1,5 +1,7 @@ import UIKit import SVProgressHUD +import WordPressData +import WordPressShared import WordPressUI /// Allows the user to Invite Followers / Users diff --git a/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift b/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift index 70007657416b..a980f868e28f 100644 --- a/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift +++ b/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift @@ -1,5 +1,6 @@ import UIKit import Combine +import WordPressData import WordPressShared import WordPressUI diff --git a/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift b/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift index de2d0d30087c..e176232f49f4 100644 --- a/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift +++ b/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift @@ -1,5 +1,6 @@ import Foundation import UIKit +import WordPressData import WordPressShared import WordPressUI import Gravatar diff --git a/WordPress/Classes/ViewRelated/Post/Categories/PostCategoryCreateView.swift b/WordPress/Classes/ViewRelated/Post/Categories/PostCategoryCreateView.swift index ecb8d43a0ef3..6075e14bed0b 100644 --- a/WordPress/Classes/ViewRelated/Post/Categories/PostCategoryCreateView.swift +++ b/WordPress/Classes/ViewRelated/Post/Categories/PostCategoryCreateView.swift @@ -1,4 +1,5 @@ import SwiftUI +import WordPressData struct PostCategoryCreateView: View { let blog: Blog diff --git a/WordPress/Classes/ViewRelated/Post/Controllers/AbstractPostListViewController.swift b/WordPress/Classes/ViewRelated/Post/Controllers/AbstractPostListViewController.swift index 6ab10baec022..67f40c5c915c 100644 --- a/WordPress/Classes/ViewRelated/Post/Controllers/AbstractPostListViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Controllers/AbstractPostListViewController.swift @@ -1,6 +1,7 @@ import Foundation import CoreData import Gridicons +import WordPressData import WordPressShared import WordPressFlux import WordPressUI diff --git a/WordPress/Classes/ViewRelated/Post/PostEditor+JetpackSocial.swift b/WordPress/Classes/ViewRelated/Post/PostEditor+JetpackSocial.swift index 6cc4f0df79aa..7c96775b239b 100644 --- a/WordPress/Classes/ViewRelated/Post/PostEditor+JetpackSocial.swift +++ b/WordPress/Classes/ViewRelated/Post/PostEditor+JetpackSocial.swift @@ -1,3 +1,4 @@ +import WordPressData extension PostEditor { diff --git a/WordPress/Classes/ViewRelated/Post/PostEditor.swift b/WordPress/Classes/ViewRelated/Post/PostEditor.swift index 42e6db1dcb69..b39703713717 100644 --- a/WordPress/Classes/ViewRelated/Post/PostEditor.swift +++ b/WordPress/Classes/ViewRelated/Post/PostEditor.swift @@ -1,6 +1,7 @@ import UIKit import Combine import SVProgressHUD +import WordPressData import WordPressFlux enum EditMode { diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+Swift.swift b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+Swift.swift index ca4003dea48d..138e6c1293c0 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+Swift.swift +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController+Swift.swift @@ -1,6 +1,7 @@ import UIKit import CoreData import Combine +import WordPressData import WordPressKit import WordPressShared import SwiftUI diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index 94708a2c6fb0..1f9f2fbe28a2 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -3,7 +3,7 @@ #import "Media.h" #import "SettingsSelectionViewController.h" #import "SharingDetailViewController.h" -@import WordPressDataObjC; +@import WordPressData; #import "MediaService.h" #import "WordPress-Swift.h" diff --git a/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift b/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift index c8078a71b6f9..0af5ec673af7 100644 --- a/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Revisions/RevisionsTableViewController.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressUI class RevisionsTableViewController: UITableViewController { diff --git a/WordPress/Classes/ViewRelated/Post/Search/PostSearchSuggestionsService.swift b/WordPress/Classes/ViewRelated/Post/Search/PostSearchSuggestionsService.swift index 290264e8aa7a..4ab6a0dc15bc 100644 --- a/WordPress/Classes/ViewRelated/Post/Search/PostSearchSuggestionsService.swift +++ b/WordPress/Classes/ViewRelated/Post/Search/PostSearchSuggestionsService.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressShared /// Suggests search token for the given input and context. Performs all of the diff --git a/WordPress/Classes/ViewRelated/Post/Utils/PostListFilter.swift b/WordPress/Classes/ViewRelated/Post/Utils/PostListFilter.swift index b5b3ad1a5c4e..d4750971b4b5 100644 --- a/WordPress/Classes/ViewRelated/Post/Utils/PostListFilter.swift +++ b/WordPress/Classes/ViewRelated/Post/Utils/PostListFilter.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData @objc class PostListFilter: NSObject, FilterTabBarItem { diff --git a/WordPress/Classes/ViewRelated/Post/Views/PageMenuViewModel.swift b/WordPress/Classes/ViewRelated/Post/Views/PageMenuViewModel.swift index 8ef6995a137b..527207585750 100644 --- a/WordPress/Classes/ViewRelated/Post/Views/PageMenuViewModel.swift +++ b/WordPress/Classes/ViewRelated/Post/Views/PageMenuViewModel.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData final class PageMenuViewModel: AbstractPostMenuViewModel { diff --git a/WordPress/Classes/ViewRelated/Post/Views/PostCardStatusViewModel.swift b/WordPress/Classes/ViewRelated/Post/Views/PostCardStatusViewModel.swift index 354710be5887..33e1ff804dbb 100644 --- a/WordPress/Classes/ViewRelated/Post/Views/PostCardStatusViewModel.swift +++ b/WordPress/Classes/ViewRelated/Post/Views/PostCardStatusViewModel.swift @@ -1,5 +1,6 @@ import UIKit import Gridicons +import WordPressData import WordPressUI /// Encapsulates status display logic for PostCardTableViewCells. diff --git a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderDiscoverViewController.swift b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderDiscoverViewController.swift index 3c5f77f32ddb..c03c926ab802 100644 --- a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderDiscoverViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderDiscoverViewController.swift @@ -1,6 +1,7 @@ import Foundation import UIKit import Combine +import WordPressData import WordPressKit import WordPressShared diff --git a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderBlockUserAction.swift b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderBlockUserAction.swift index c58ef65db83c..128a2e5926a8 100644 --- a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderBlockUserAction.swift +++ b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderBlockUserAction.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressData import WordPressShared /// Encapsulates a command to block a user diff --git a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarListsSection.swift b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarListsSection.swift index e0eb818b6257..1e373b44613a 100644 --- a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarListsSection.swift +++ b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarListsSection.swift @@ -1,6 +1,7 @@ import UIKit import SwiftUI import Combine +import WordPressData import WordPressUI struct ReaderSidebarListsSection: View { diff --git a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarOrganizationSection.swift b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarOrganizationSection.swift index b41a4380f856..2518955d0d2f 100644 --- a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarOrganizationSection.swift +++ b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarOrganizationSection.swift @@ -1,6 +1,7 @@ import UIKit import SwiftUI import Combine +import WordPressData import WordPressUI struct ReaderSidebarOrganizationSection: View { diff --git a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarSubscriptionsSection.swift b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarSubscriptionsSection.swift index 0e7155f0fef3..7ba59213aa13 100644 --- a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarSubscriptionsSection.swift +++ b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarSubscriptionsSection.swift @@ -1,6 +1,7 @@ import UIKit import SwiftUI import Combine +import WordPressData import WordPressUI struct ReaderSidebarSubscriptionsSection: View { diff --git a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarTagsSection.swift b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarTagsSection.swift index 7dc0e9bcced4..d92b6273159e 100644 --- a/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarTagsSection.swift +++ b/WordPress/Classes/ViewRelated/Reader/Sidebar/ReaderSidebarTagsSection.swift @@ -1,6 +1,7 @@ import UIKit import SwiftUI import Combine +import WordPressData import WordPressUI struct ReaderSidebarTagsSection: View { diff --git a/WordPress/Classes/ViewRelated/Stats/Period Stats/SiteStatsPeriodTableViewController.swift b/WordPress/Classes/ViewRelated/Stats/Period Stats/SiteStatsPeriodTableViewController.swift index 68b18252f04d..5e8217207dc9 100644 --- a/WordPress/Classes/ViewRelated/Stats/Period Stats/SiteStatsPeriodTableViewController.swift +++ b/WordPress/Classes/ViewRelated/Stats/Period Stats/SiteStatsPeriodTableViewController.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressFlux import WordPressUI import Combine diff --git a/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsDetailTableViewController.swift b/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsDetailTableViewController.swift index 5436e9796b34..b60261b8142e 100644 --- a/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsDetailTableViewController.swift +++ b/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsDetailTableViewController.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressFlux import WordPressUI diff --git a/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsInsightsDetailsTableViewController.swift b/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsInsightsDetailsTableViewController.swift index f2042002971b..5347fe56427b 100644 --- a/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsInsightsDetailsTableViewController.swift +++ b/WordPress/Classes/ViewRelated/Stats/Shared Views/Stats Detail/SiteStatsInsightsDetailsTableViewController.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressData import WordPressFlux import WordPressUI diff --git a/WordPress/Classes/ViewRelated/Stats/StatsViewController.m b/WordPress/Classes/ViewRelated/Stats/StatsViewController.m index eba225fa5bbe..90bb2567de17 100644 --- a/WordPress/Classes/ViewRelated/Stats/StatsViewController.m +++ b/WordPress/Classes/ViewRelated/Stats/StatsViewController.m @@ -1,11 +1,9 @@ #import "StatsViewController.h" -#import "Blog.h" -#import "WPAccount.h" #import "BlogService.h" #import "WordPress-Swift.h" #import "WPAppAnalytics.h" -@import WordPressDataObjC; +@import WordPressData; @import WordPressShared; @import Reachability; @@ -42,10 +40,10 @@ - (void)viewDidLoad self.view.backgroundColor = [UIColor systemGroupedBackgroundColor]; self.navigationItem.title = NSLocalizedString(@"Stats", @"Stats window title"); - + UINavigationController *statsNavVC = [[UIStoryboard storyboardWithName:@"SiteStatsDashboard" bundle:nil] instantiateInitialViewController]; self.siteStatsDashboardVC = statsNavVC.viewControllers.firstObject; - + self.noResultsViewController = [NoResultsViewController controller]; self.noResultsViewController.delegate = self; @@ -94,17 +92,17 @@ - (void)initStats // WordPress.com + Jetpack REST if (self.blog.account) { - + // Prompt user to enable site stats if stats module is disabled if (!self.isActivatingStatsModule && ![self.blog isStatsActive]) { [self showStatsModuleDisabled]; return; } - + SiteStatsInformation.sharedInstance.oauth2Token = self.blog.account.authToken; SiteStatsInformation.sharedInstance.siteID = self.blog.dotComID; SiteStatsInformation.sharedInstance.supportsFileDownloads = [self.blog supports:BlogFeatureFileDownloadsStats]; - + [self addStatsViewControllerToView]; [self initializeStatsWidgetsIfNeeded]; return; @@ -199,9 +197,9 @@ - (void)reachabilityChanged:(NSNotification *)notification -(void)actionButtonPressed { [self showEnablingSiteStats]; - + self.isActivatingStatsModule = YES; - + __weak __typeof(self) weakSelf = self; [self activateStatsModuleWithSuccess:^{ diff --git a/WordPress/Classes/ViewRelated/System/Notices/NoticePresenter.swift b/WordPress/Classes/ViewRelated/System/Notices/NoticePresenter.swift index e165aa627693..9b2eea528e25 100644 --- a/WordPress/Classes/ViewRelated/System/Notices/NoticePresenter.swift +++ b/WordPress/Classes/ViewRelated/System/Notices/NoticePresenter.swift @@ -458,7 +458,7 @@ private extension NoticePresenter { fatalError("init(coder:) has not been implemented") } - @objc func updateFrame(notification: Notification) { + @objc func updateFrame(notification: WordPressData.Notification) { setNeedsLayout() } diff --git a/WordPress/Classes/ViewRelated/System/WPTabBarController.m b/WordPress/Classes/ViewRelated/System/WPTabBarController.m index 0fb073259f63..254ca18c508b 100644 --- a/WordPress/Classes/ViewRelated/System/WPTabBarController.m +++ b/WordPress/Classes/ViewRelated/System/WPTabBarController.m @@ -1,9 +1,8 @@ #import "WPTabBarController.h" #import "AccountService.h" -@import WordPressDataObjC; +@import WordPressData; #import "BlogService.h" -#import "Blog.h" #import "BlogDetailsViewController.h" #import "WPAppAnalytics.h" diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 5f2688f199fb..45964edd382a 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -65,7 +65,6 @@ 082EA3D72B4C202600E7F361 /* NotificationsViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 082EA3D62B4C202600E7F361 /* NotificationsViewModelTests.swift */; }; 084D94AF1EDF842F00C385A6 /* test-video-device-gps.m4v in Resources */ = {isa = PBXBuildFile; fileRef = 084D94AE1EDF842600C385A6 /* test-video-device-gps.m4v */; }; 084FC3B729913B1B00A17BCF /* JetpackPluginOverlayViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 084FC3B629913B1B00A17BCF /* JetpackPluginOverlayViewModelTests.swift */; }; - 0879FC161E9301DD00E1EFC8 /* MediaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0879FC151E9301DD00E1EFC8 /* MediaTests.swift */; }; 088134FF2A56C5240027C086 /* CompliancePopoverViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 088134FE2A56C5240027C086 /* CompliancePopoverViewModelTests.swift */; }; 0885A3671E837AFE00619B4D /* URLIncrementalFilenameTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0885A3661E837AFE00619B4D /* URLIncrementalFilenameTests.swift */; }; 088CAD4E2BBD8223005996DE /* BlogListViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 088CAD4D2BBD8223005996DE /* BlogListViewModelTests.swift */; }; @@ -75,7 +74,6 @@ 08AA640C2A8511FB0076E38D /* DashboardGoogleDomainsViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AA640B2A8511FB0076E38D /* DashboardGoogleDomainsViewModelTests.swift */; }; 08AA640E2A8540590076E38D /* MockEventTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08AA640D2A8540590076E38D /* MockEventTracker.swift */; }; 08AAD6A11CBEA610002B2418 /* MenusServiceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 08AAD6A01CBEA610002B2418 /* MenusServiceTests.m */; }; - 08B6E51C1F037ADD00268F57 /* MediaFileManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08B6E51B1F037ADD00268F57 /* MediaFileManagerTests.swift */; }; 08B832421EC130D60079808D /* test-gif.gif in Resources */ = {isa = PBXBuildFile; fileRef = 08B832411EC130D60079808D /* test-gif.gif */; }; 08C42C31281807880034720B /* ReaderSubscribeCommentsActionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08C42C30281807880034720B /* ReaderSubscribeCommentsActionTests.swift */; }; 08DF9C441E8475530058678C /* test-image-portrait.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 08DF9C431E8475530058678C /* test-image-portrait.jpg */; }; @@ -113,8 +111,6 @@ 0C6C4CD42A4F0AD90049E762 /* blaze-search-page-1.json in Resources */ = {isa = PBXBuildFile; fileRef = 0C6C4CD32A4F0AD80049E762 /* blaze-search-page-1.json */; }; 0C6C4CD62A4F0AEE0049E762 /* blaze-search-page-2.json in Resources */ = {isa = PBXBuildFile; fileRef = 0C6C4CD52A4F0AEE0049E762 /* blaze-search-page-2.json */; }; 0C6C4CD82A4F0F2C0049E762 /* Bundle+TestExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C6C4CD72A4F0F2C0049E762 /* Bundle+TestExtensions.swift */; }; - 0C77A5B32CDE7924005BC0DA /* ReaderPostTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C77A5B22CDE7924005BC0DA /* ReaderPostTests.swift */; }; - 0C7D481A2A4DB9300023CF84 /* blaze-search-response.json in Resources */ = {isa = PBXBuildFile; fileRef = 0C7D48192A4DB9300023CF84 /* blaze-search-response.json */; }; 0C896DE72A3A832B00D7D4E7 /* SiteVisibilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C896DE62A3A832B00D7D4E7 /* SiteVisibilityTests.swift */; }; 0C8FC9AA2A8C57000059DCE4 /* ItemProviderMediaExporterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FC9A92A8C57000059DCE4 /* ItemProviderMediaExporterTests.swift */; }; 0C8FC9AC2A8C57930059DCE4 /* test-webp.webp in Resources */ = {isa = PBXBuildFile; fileRef = 0C8FC9AB2A8C57930059DCE4 /* test-webp.webp */; }; @@ -125,7 +121,6 @@ 0CB424F42ADF3CBE0080B807 /* PostSearchViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CB424F32ADF3CBE0080B807 /* PostSearchViewModelTests.swift */; }; 0CD382862A4B6FCF00612173 /* DashboardBlazeCardCellViewModelTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CD382852A4B6FCE00612173 /* DashboardBlazeCardCellViewModelTest.swift */; }; 0CD6299B2B9AAA9A00325EA4 /* Foundation+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CD6299A2B9AAA9A00325EA4 /* Foundation+Extensions.swift */; }; - 0CF7D6C32ABB753A006D1E89 /* MediaImageServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CF7D6C22ABB753A006D1E89 /* MediaImageServiceTests.swift */; }; 0CFFFECB2C36F5760044709B /* XcodeTarget_WordPressAuthentificatorTests in Frameworks */ = {isa = PBXBuildFile; productRef = 0CFFFECA2C36F5760044709B /* XcodeTarget_WordPressAuthentificatorTests */; }; 173D82E7238EE2A7008432DA /* FeatureFlagTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 173D82E6238EE2A7008432DA /* FeatureFlagTests.swift */; }; 174C116F2624603400346EC6 /* MBarRouteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 174C116E2624603400346EC6 /* MBarRouteTests.swift */; }; @@ -140,17 +135,10 @@ 1D91080729F847A2003F9A5E /* MediaServiceUpdateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D91080629F847A2003F9A5E /* MediaServiceUpdateTests.m */; }; 1DE9F2B32BA30E820044AA53 /* GutenbergFileUploadProcessorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9F2B22BA30E820044AA53 /* GutenbergFileUploadProcessorTests.swift */; }; 1DF7A0D32BA0B1810003CBA3 /* GutenbergContentParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1DF7A0D22BA0B1810003CBA3 /* GutenbergContentParser.swift */; }; - 2422A2C02C5846DB00402A81 /* Blog+RestAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2422A2BF2C5846DB00402A81 /* Blog+RestAPITests.swift */; }; 24351254264DCA08009BB2B6 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24351253264DCA08009BB2B6 /* Secrets.swift */; }; 24351255264DCA08009BB2B6 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24351253264DCA08009BB2B6 /* Secrets.swift */; }; - 246D0A0325E97D5D0028B83F /* Blog+ObjcTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 246D0A0225E97D5D0028B83F /* Blog+ObjcTests.m */; }; 2481B1D5260D4E8B00AE59DB /* AccountBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2481B1D4260D4E8B00AE59DB /* AccountBuilder.swift */; }; - 2481B1E8260D4EAC00AE59DB /* WPAccount+LookupTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2481B1E7260D4EAC00AE59DB /* WPAccount+LookupTests.swift */; }; - 2481B20C260D8FED00AE59DB /* WPAccount+ObjCLookupTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2481B20B260D8FED00AE59DB /* WPAccount+ObjCLookupTests.m */; }; - 24A2948325D602710000A51E /* BlogTimeZoneTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 24A2948225D602710000A51E /* BlogTimeZoneTests.m */; }; 24B1AE3124FEC79900B9F334 /* RemoteFeatureFlagTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24B1AE3024FEC79900B9F334 /* RemoteFeatureFlagTests.swift */; }; - 24C69A8B2612421900312D9A /* UserSettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24C69A8A2612421900312D9A /* UserSettingsTests.swift */; }; - 24C69AC22612467C00312D9A /* UserSettingsTestsObjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 24C69AC12612467C00312D9A /* UserSettingsTestsObjc.m */; }; 24CDE3412C5863A1005E5E43 /* TestKeychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24CDE3402C5863A1005E5E43 /* TestKeychain.swift */; }; 24E55D4E2CC9A5C8008D071D /* ImagePlayground.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24E55D4D2CC9A5C8008D071D /* ImagePlayground.framework */; }; 24E55D4F2CC9A5CD008D071D /* ImagePlayground.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24E55D4D2CC9A5C8008D071D /* ImagePlayground.framework */; }; @@ -163,6 +151,9 @@ 3F28CEA52A4ABB8800B79686 /* PrivacySettingsAnalyticsTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F28CEA42A4ABB8800B79686 /* PrivacySettingsAnalyticsTrackerTests.swift */; }; 3F28CEA92A4ACB1000B79686 /* AnalyticsEventTrackingSpy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F28CEA82A4ACB1000B79686 /* AnalyticsEventTrackingSpy.swift */; }; 3F28CEAF2A4ACEBE00B79686 /* PrivacySettingsViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F28CEAE2A4ACEBE00B79686 /* PrivacySettingsViewControllerTests.swift */; }; + 3F2AA3EB2D81457F002A4E94 /* WordPressData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F2AA3E32D81457F002A4E94 /* WordPressData.framework */; }; + 3F2AA3F62D81457F002A4E94 /* WordPressData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F2AA3E32D81457F002A4E94 /* WordPressData.framework */; }; + 3F2AA3F72D81457F002A4E94 /* WordPressData.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3F2AA3E32D81457F002A4E94 /* WordPressData.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 3F2F856326FAF612000FCDA5 /* EditorGutenbergTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC2BB0CF228ACF710034F9AB /* EditorGutenbergTests.swift */; }; 3F3D854B251E6418001CA4D2 /* AnnouncementsDataStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F3D854A251E6418001CA4D2 /* AnnouncementsDataStoreTests.swift */; }; 3F46AAFE25BF5D6300CE2E98 /* Sites.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 3F46AB0225BF5D6300CE2E98 /* Sites.intentdefinition */; settings = {ATTRIBUTES = (codegen, ); }; }; @@ -191,7 +182,6 @@ 3F60D39D2D2C4BA4008ACD86 /* yoga.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3F60D3932D2C4BA4008ACD86 /* yoga.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 3F6E6A5B2D82ACE000DAF6EA /* KeychainUtilsMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F6E6A5A2D82ACE000DAF6EA /* KeychainUtilsMock.swift */; }; 3F751D462491A93D0008A2B1 /* ZendeskUtilsTests+Plans.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F751D452491A93D0008A2B1 /* ZendeskUtilsTests+Plans.swift */; }; - 3F759FBA2A2DA93B0039A845 /* WPAccount+Fixture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F759FB92A2DA93B0039A845 /* WPAccount+Fixture.swift */; }; 3F759FBC2A2DB2CF0039A845 /* TestError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F759FBB2A2DB2CF0039A845 /* TestError.swift */; }; 3F759FBE2A2DB3280039A845 /* AccountSettingsRemoteInterfaceStub.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F759FBD2A2DB3280039A845 /* AccountSettingsRemoteInterfaceStub.swift */; }; 3F86A83729D19C15005D20C0 /* SignupEpilogueTableViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F86A83629D19C15005D20C0 /* SignupEpilogueTableViewControllerTests.swift */; }; @@ -200,6 +190,8 @@ 3FDDFE9627C8178C00606933 /* SiteStatsInformationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FDDFE9527C8178C00606933 /* SiteStatsInformationTests.swift */; }; 3FE6D31E2B0705D400D14923 /* JetpackBrandingVisibilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE6D31D2B0705D400D14923 /* JetpackBrandingVisibilityTests.swift */; }; 3FFB3F222AFC72EC00A742B0 /* DeepLinkSourceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFB3F212AFC72EC00A742B0 /* DeepLinkSourceTests.swift */; }; + 3FFCBCE12D814EEC00C2F712 /* XcodeTarget_WordPressData in Frameworks */ = {isa = PBXBuildFile; productRef = 3FFCBCE02D814EEC00C2F712 /* XcodeTarget_WordPressData */; }; + 3FFCBCE42D814FA700C2F712 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FFCBCE32D814FA700C2F712 /* CoreData.framework */; }; 3FFE3C0828FE00D10021BB96 /* StatsSegmentedControlDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFE3C0728FE00D10021BB96 /* StatsSegmentedControlDataTests.swift */; }; 406A0EF0224D39C50016AD6A /* Flags.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 406A0EEF224D39C50016AD6A /* Flags.xcassets */; }; 40ACCF14224E167900190713 /* FlagsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40ACCF13224E167900190713 /* FlagsTest.swift */; }; @@ -230,8 +222,6 @@ 4A0274C42C226A4D00290D8B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4A0274BD2C226A4D00290D8B /* Assets.xcassets */; }; 4A17C1A4281A823E0001FFE5 /* NSManagedObject+Fixture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A17C1A3281A823E0001FFE5 /* NSManagedObject+Fixture.swift */; }; 4A266B8F282B05210089CF3D /* JSONObjectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A266B8E282B05210089CF3D /* JSONObjectTests.swift */; }; - 4A266B91282B13A70089CF3D /* CoreDataTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A266B90282B13A70089CF3D /* CoreDataTestCase.swift */; }; - 4A2C73E42A943DEA00ACE79E /* TaggedManagedObjectIDTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A2C73E32A943DEA00ACE79E /* TaggedManagedObjectIDTests.swift */; }; 4A2C73F72A9585B000ACE79E /* PostRepositoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A2C73F62A9585B000ACE79E /* PostRepositoryTests.swift */; }; 4A5598852B05AC180083C220 /* PagesListTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A5598842B05AC180083C220 /* PagesListTests.swift */; }; 4A5EDD812CE58B9900A605FC /* ZendeskUtilsTests+A8CEmail.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A5EDD802CE58B9900A605FC /* ZendeskUtilsTests+A8CEmail.swift */; }; @@ -255,7 +245,6 @@ 4AAD69082A6F68A5007FE77E /* MediaRepositoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AAD69072A6F68A5007FE77E /* MediaRepositoryTests.swift */; }; 4AB6A3602B7C3EB500769115 /* PinghubWebSocketTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AB6A35F2B7C3EB500769115 /* PinghubWebSocketTests.swift */; }; 4AC299D72C6EEB16002E74C8 /* ApplicationPasswordsViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AC299D62C6EEB16002E74C8 /* ApplicationPasswordsViewModelTests.swift */; }; - 4AD5657228E543A30054C676 /* BlogQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AD5657128E543A30054C676 /* BlogQueryTests.swift */; }; 4AD862E52AFAEF1700A07557 /* PostsListAPIStub.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AD862E42AFAEF1700A07557 /* PostsListAPIStub.swift */; }; 4AD8DCB02CC6505E0058DE55 /* WordPressDotComAuthenticatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AD8DCAF2CC6505E0058DE55 /* WordPressDotComAuthenticatorTests.swift */; }; 4AD953C72C21451700D0EEFA /* WordPressAuthenticator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AD953B42C21451700D0EEFA /* WordPressAuthenticator.framework */; }; @@ -470,13 +459,11 @@ 4AD955C82C2171F000D0EEFA /* MemoryManagementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AD955982C2171F000D0EEFA /* MemoryManagementTests.swift */; }; 4AEF2DD929A84B2C00345734 /* ReaderSiteServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AEF2DD829A84B2C00345734 /* ReaderSiteServiceTests.swift */; }; 4AFB8FBF2824999500A2F4B2 /* ContextManager+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AFB8FBE2824999400A2F4B2 /* ContextManager+Helpers.swift */; }; - 570BFD902282418A007859A8 /* PostBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 570BFD8F2282418A007859A8 /* PostBuilder.swift */; }; 572FB401223A806000933C76 /* NoticeStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 572FB400223A806000933C76 /* NoticeStoreTests.swift */; }; 575802132357C41200E4C63C /* MediaCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575802122357C41200E4C63C /* MediaCoordinatorTests.swift */; }; 57889AB823589DF100DAE56D /* PageBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57889AB723589DF100DAE56D /* PageBuilder.swift */; }; 57B71D4E230DB5F200789A68 /* BlogBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B71D4D230DB5F200789A68 /* BlogBuilder.swift */; }; 5948AD111AB73D19006E8882 /* WPAppAnalyticsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5948AD101AB73D19006E8882 /* WPAppAnalyticsTests.m */; }; - 5960967F1CF7959300848496 /* PostTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5960967E1CF7959300848496 /* PostTests.swift */; }; 59B48B621B99E132008EBB84 /* JSONObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59B48B611B99E132008EBB84 /* JSONObject.swift */; }; 59ECF87B1CB7061D00E68F25 /* PostSharingControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59ECF87A1CB7061D00E68F25 /* PostSharingControllerTests.swift */; }; 59FBD5621B5684F300734466 /* ThemeServiceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 59FBD5611B5684F300734466 /* ThemeServiceTests.m */; }; @@ -582,7 +569,6 @@ 834CE7341256D0DE0046A4A3 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 834CE7331256D0DE0046A4A3 /* CFNetwork.framework */; }; 8355D7D911D260AA00A61362 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8355D7D811D260AA00A61362 /* CoreData.framework */; }; 83BFAE502A6EBF9900C7B683 /* DashboardJetpackSocialCardCellTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83BFAE4F2A6EBF9900C7B683 /* DashboardJetpackSocialCardCellTests.swift */; }; - 83EF3D7F2937F08C000AF9BF /* SharedDataIssueSolverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83EF3D7C2937E969000AF9BF /* SharedDataIssueSolverTests.swift */; }; 83F3E26011275E07004CD686 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83F3E25F11275E07004CD686 /* MapKit.framework */; }; 83F3E2D311276371004CD686 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83F3E2D211276371004CD686 /* CoreLocation.framework */; }; 8511CFC51C60884400B7CEED /* SnapshotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8511CFC41C60884400B7CEED /* SnapshotHelper.swift */; }; @@ -600,11 +586,8 @@ 8B69F0E4255C2C3F006B1CEF /* ActivityListViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B69F0E3255C2C3F006B1CEF /* ActivityListViewModelTests.swift */; }; 8B69F100255C4870006B1CEF /* ActivityStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B69F0FF255C4870006B1CEF /* ActivityStoreTests.swift */; }; 8B749E9025AF8D2E00023F03 /* JetpackCapabilitiesServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B749E8F25AF8D2E00023F03 /* JetpackCapabilitiesServiceTests.swift */; }; - 8B8C814D2318073300A0E620 /* BasePostTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B8C814C2318073300A0E620 /* BasePostTests.swift */; }; 8BB185CE24B62CE100A4CCE8 /* ReaderCardServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BB185CD24B62CE100A4CCE8 /* ReaderCardServiceTests.swift */; }; 8BB185CF24B62D7600A4CCE8 /* reader-cards.json in Resources */ = {isa = PBXBuildFile; fileRef = 8BB185CB24B6058600A4CCE8 /* reader-cards.json */; }; - 8BBBEBB224B8F8C0005E358E /* ReaderCardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BBBEBB124B8F8C0005E358E /* ReaderCardTests.swift */; }; - 8BC6020D2390412000EFE3D0 /* NullBlogPropertySanitizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC6020C2390412000EFE3D0 /* NullBlogPropertySanitizerTests.swift */; }; 8BD34F0927D144FF005E931C /* BlogDashboardStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD34F0827D144FF005E931C /* BlogDashboardStateTests.swift */; }; 8BD36E062395CC4400EFFF1C /* MediaEditorOperation+DescriptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD36E052395CC4400EFFF1C /* MediaEditorOperation+DescriptionTests.swift */; }; 8BDA5A6D247C2F8400AB124C /* ReaderDetailViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BDA5A6C247C2F8400AB124C /* ReaderDetailViewControllerTests.swift */; }; @@ -618,7 +601,6 @@ 931215E1267DE1C0008C3B69 /* StatsTotalRowDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 931215E0267DE1C0008C3B69 /* StatsTotalRowDataTests.swift */; }; 931D26F619ED7F7000114F17 /* BlogServiceTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 930FD0A519882742000CC81D /* BlogServiceTest.m */; }; 931D26F719ED7F7500114F17 /* ReaderPostServiceTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 5DE8A0401912D95B00B2FF59 /* ReaderPostServiceTest.m */; }; - 931D270019EDAE8600114F17 /* CoreDataMigrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 931D26FF19EDAE8600114F17 /* CoreDataMigrationTests.m */; }; 931DF4D618D09A2F00540BDD /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 931DF4D818D09A2F00540BDD /* InfoPlist.strings */; }; 932225B11C7CE50300443B02 /* WordPressShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 932225A71C7CE50300443B02 /* WordPressShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 932645A41E7C206600134988 /* GutenbergSettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 932645A31E7C206600134988 /* GutenbergSettingsTests.swift */; }; @@ -639,7 +621,6 @@ 93CD939319099BE70049096E /* authtoken.json in Resources */ = {isa = PBXBuildFile; fileRef = 93CD939219099BE70049096E /* authtoken.json */; }; 93D86B981C691E71003D8E3E /* LocalCoreDataServiceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 59A9AB391B4C3ECD00A433DC /* LocalCoreDataServiceTests.m */; }; 93E5285619A77BAC003A1A9C /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93E5283B19A7741A003A1A9C /* NotificationCenter.framework */; }; - 93EF094C19ED533500C89770 /* ContextManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E9050319E6F242005513C9 /* ContextManagerTests.swift */; }; 93F2E53E1E9E5A010050D489 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E131CB5116CACA6B004B0314 /* CoreText.framework */; }; 93F2E5401E9E5A180050D489 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F2E53F1E9E5A180050D489 /* libsqlite3.tbd */; }; 93F2E5421E9E5A350050D489 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F2E5411E9E5A350050D489 /* QuickLook.framework */; }; @@ -658,7 +639,6 @@ B532ACD31DC3AE1200FFFA57 /* OHHTTPStubs+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = B532ACD21DC3AE1200FFFA57 /* OHHTTPStubs+Helpers.swift */; }; B5416CFE1C1756B900006DD8 /* PushNotificationsManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B5416CFD1C1756B900006DD8 /* PushNotificationsManagerTests.m */; }; B556EFCB1DCA374200728F93 /* DictionaryHelpersTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B556EFCA1DCA374200728F93 /* DictionaryHelpersTests.swift */; }; - B55F1AA21C107CE200FD04D4 /* BlogSettingsDiscussionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55F1AA11C107CE200FD04D4 /* BlogSettingsDiscussionTests.swift */; }; B566EC751B83867800278395 /* NSMutableAttributedStringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B566EC741B83867800278395 /* NSMutableAttributedStringTests.swift */; }; B5772AC61C9C84900031F97E /* GravatarServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5772AC51C9C84900031F97E /* GravatarServiceTests.swift */; }; B5882C471D5297D1008E0EAA /* NotificationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5882C461D5297D1008E0EAA /* NotificationTests.swift */; }; @@ -669,7 +649,6 @@ B5AEEC7C1ACACFDA008BF2A4 /* notifications-new-follower.json in Resources */ = {isa = PBXBuildFile; fileRef = B5AEEC771ACACFDA008BF2A4 /* notifications-new-follower.json */; }; B5AEEC7D1ACACFDA008BF2A4 /* notifications-replied-comment.json in Resources */ = {isa = PBXBuildFile; fileRef = B5AEEC781ACACFDA008BF2A4 /* notifications-replied-comment.json */; }; B5DA8A5F20ADAA1D00D5BDE1 /* plugin-directory-jetpack.json in Resources */ = {isa = PBXBuildFile; fileRef = B5DA8A5E20ADAA1C00D5BDE1 /* plugin-directory-jetpack.json */; }; - B5ECA6CD1DBAAD510062D7E0 /* CoreDataHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5ECA6CC1DBAAD510062D7E0 /* CoreDataHelperTests.swift */; }; B5EFB1C91B333C5A007608A3 /* NotificationSettingsServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5EFB1C81B333C5A007608A3 /* NotificationSettingsServiceTests.swift */; }; B5EFB1D11B33630C007608A3 /* notifications-settings.json in Resources */ = {isa = PBXBuildFile; fileRef = B5EFB1D01B33630C007608A3 /* notifications-settings.json */; }; BE2B4E9F1FD664F5007AE3E4 /* BaseScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE2B4E9E1FD664F5007AE3E4 /* BaseScreen.swift */; }; @@ -678,7 +657,6 @@ BED4D8331FF11E3800A11345 /* LoginFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED4D8321FF11E3800A11345 /* LoginFlow.swift */; }; C314543B262770BE005B216B /* BlogServiceAuthorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C314543A262770BE005B216B /* BlogServiceAuthorTests.swift */; }; C373D6EA280452F6008F8C26 /* SiteIntentDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C373D6E9280452F6008F8C26 /* SiteIntentDataTests.swift */; }; - C38C5D8127F61D2C002F517E /* MenuItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38C5D8027F61D2C002F517E /* MenuItemTests.swift */; }; C396C80B280F2401006FE7AC /* SiteDesignTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C396C80A280F2401006FE7AC /* SiteDesignTests.swift */; }; C3C2F84628AC8BC700937E45 /* JetpackBannerScrollVisibilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C2F84528AC8BC700937E45 /* JetpackBannerScrollVisibilityTests.swift */; }; C3C70C562835C5BB00DD2546 /* SiteDesignSectionLoaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3C70C552835C5BB00DD2546 /* SiteDesignSectionLoaderTests.swift */; }; @@ -729,8 +707,6 @@ D848CC0F20FF2D9B00A9038F /* notifications-comment-range.json in Resources */ = {isa = PBXBuildFile; fileRef = D848CC0E20FF2D9B00A9038F /* notifications-comment-range.json */; }; D848CC1120FF310400A9038F /* notifications-site-range.json in Resources */ = {isa = PBXBuildFile; fileRef = D848CC1020FF310400A9038F /* notifications-site-range.json */; }; D848CC1320FF31BB00A9038F /* notifications-blockquote-range.json in Resources */ = {isa = PBXBuildFile; fileRef = D848CC1220FF31BB00A9038F /* notifications-blockquote-range.json */; }; - D848CC1520FF33FC00A9038F /* NotificationContentRangeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D848CC1420FF33FC00A9038F /* NotificationContentRangeTests.swift */; }; - D848CC1720FF38EA00A9038F /* FormattableCommentRangeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D848CC1620FF38EA00A9038F /* FormattableCommentRangeTests.swift */; }; D848CC1920FF3A2400A9038F /* FormattableNotIconTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D848CC1820FF3A2400A9038F /* FormattableNotIconTests.swift */; }; D88A6492208D7A0A008AE9BC /* MockStockPhotosService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D88A6491208D7A0A008AE9BC /* MockStockPhotosService.swift */; }; D88A649E208D82D2008AE9BC /* XCTestCase+Wait.swift in Sources */ = {isa = PBXBuildFile; fileRef = D88A649D208D82D2008AE9BC /* XCTestCase+Wait.swift */; }; @@ -793,7 +769,6 @@ E1EBC3731C118ED200F638E0 /* ImmuTableTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1EBC3721C118ED200F638E0 /* ImmuTableTest.swift */; }; E1EBC3751C118EDE00F638E0 /* ImmuTableTestViewCellWithNib.xib in Resources */ = {isa = PBXBuildFile; fileRef = E1EBC3741C118EDE00F638E0 /* ImmuTableTestViewCellWithNib.xib */; }; E66969C81B9E0A6800EC9C00 /* ReaderTopicServiceTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E66969C71B9E0A6800EC9C00 /* ReaderTopicServiceTest.swift */; }; - E6A215901D1065F200DE5270 /* AbstractPostTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6A2158F1D1065F200DE5270 /* AbstractPostTest.swift */; }; E6B9B8AF1B94FA1C0001B92F /* ReaderStreamViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6B9B8AE1B94FA1C0001B92F /* ReaderStreamViewControllerTests.swift */; }; EA14532A29AD874C001F3143 /* ReaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB10E3F27487F5D000DA4C1 /* ReaderTests.swift */; }; EA14532B29AD874C001F3143 /* EditorAztecTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED4D82F1FF11DEF00A11345 /* EditorAztecTests.swift */; }; @@ -818,7 +793,6 @@ F15D1FBA265C41A900854EE5 /* BloggingRemindersStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F15D1FB9265C41A900854EE5 /* BloggingRemindersStoreTests.swift */; }; F17A2A2023BFBD84001E96AC /* UIView+ExistingConstraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = F17A2A1F23BFBD84001E96AC /* UIView+ExistingConstraints.swift */; }; F18B43781F849F580089B817 /* PostAttachmentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F18B43771F849F580089B817 /* PostAttachmentTests.swift */; }; - F1B1E7A324098FA100549E2A /* BlogTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1B1E7A224098FA100549E2A /* BlogTests.swift */; }; F1BB660C274E704D00A319BE /* LikeUserHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1BB660B274E704D00A319BE /* LikeUserHelperTests.swift */; }; F1F083F6241FFE930056D3B1 /* AtomicAuthenticationServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1F083F5241FFE930056D3B1 /* AtomicAuthenticationServiceTests.swift */; }; F406F3ED2B55960700AFC04A /* CompliancePopoverCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F406F3EC2B55960700AFC04A /* CompliancePopoverCoordinatorTests.swift */; }; @@ -919,11 +893,9 @@ FEA312842987FB0100FFD405 /* BlogJetpackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEA312832987FB0100FFD405 /* BlogJetpackTests.swift */; }; FEAA6F79298CE4A600ADB44C /* PluginJetpackProxyServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEAA6F78298CE4A600ADB44C /* PluginJetpackProxyServiceTests.swift */; }; FECA44322836647100D01F15 /* PromptRemindersSchedulerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FECA44312836647100D01F15 /* PromptRemindersSchedulerTests.swift */; }; - FEE48EFF2A4C9855008A48E0 /* Blog+PublicizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEE48EFE2A4C9855008A48E0 /* Blog+PublicizeTests.swift */; }; FEF7F3402AFEA0C200F793FC /* blogging-prompts-bloganuary.json in Resources */ = {isa = PBXBuildFile; fileRef = FEF7F33F2AFEA0C200F793FC /* blogging-prompts-bloganuary.json */; }; FEFA263E26C58427009CCB7E /* ShareAppTextActivityItemSourceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEFA263D26C58427009CCB7E /* ShareAppTextActivityItemSourceTests.swift */; }; FEFA6AC62A86824A004EE5E6 /* PostHelperJetpackSocialTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEFA6AC52A86824A004EE5E6 /* PostHelperJetpackSocialTests.swift */; }; - FEFA6AC82A88D5FC004EE5E6 /* Post+JetpackSocialTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEFA6AC72A88D5FC004EE5E6 /* Post+JetpackSocialTests.swift */; }; FEFC0F8C273131A6001F7F1D /* CommentService+RepliesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEFC0F8B273131A6001F7F1D /* CommentService+RepliesTests.swift */; }; FEFC0F8E27313DD0001F7F1D /* comments-v2-success.json in Resources */ = {isa = PBXBuildFile; fileRef = FEFC0F8D27313DCF001F7F1D /* comments-v2-success.json */; }; FEFC0F9027315634001F7F1D /* empty-array.json in Resources */ = {isa = PBXBuildFile; fileRef = FEFC0F8F27315634001F7F1D /* empty-array.json */; }; @@ -954,6 +926,20 @@ remoteGlobalIDString = 0107E13828FE9DB200DE87DB; remoteInfo = JetpackIntents; }; + 3F2AA3EC2D81457F002A4E94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F2AA3E22D81457F002A4E94; + remoteInfo = WordPressData; + }; + 3F2AA3F42D81457F002A4E94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F2AA3E22D81457F002A4E94; + remoteInfo = WordPressData; + }; 3F47AC4F2A72074300208F0D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -982,6 +968,13 @@ remoteGlobalIDString = FFA8E22A1F94E3DE0002170F; remoteInfo = SwiftLint; }; + 3FFC8EEE2D818E4D00C2F712 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3F2AA3E22D81457F002A4E94; + remoteInfo = WordPressData; + }; 4AD953BD2C21451700D0EEFA /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; @@ -1204,6 +1197,7 @@ 3F60D3992D2C4BA4008ACD86 /* RNTAztecView.xcframework in Embed Frameworks */, 4AD953C82C21451700D0EEFA /* WordPressAuthenticator.framework in Embed Frameworks */, 3F60D3952D2C4BA4008ACD86 /* React.xcframework in Embed Frameworks */, + 3F2AA3F72D81457F002A4E94 /* WordPressData.framework in Embed Frameworks */, 3F60D39B2D2C4BA4008ACD86 /* hermes.xcframework in Embed Frameworks */, 3F60D39D2D2C4BA4008ACD86 /* yoga.xcframework in Embed Frameworks */, ); @@ -1287,7 +1281,6 @@ 082EA3D62B4C202600E7F361 /* NotificationsViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsViewModelTests.swift; sourceTree = ""; }; 084D94AE1EDF842600C385A6 /* test-video-device-gps.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-video-device-gps.m4v"; sourceTree = ""; }; 084FC3B629913B1B00A17BCF /* JetpackPluginOverlayViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackPluginOverlayViewModelTests.swift; sourceTree = ""; }; - 0879FC151E9301DD00E1EFC8 /* MediaTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaTests.swift; sourceTree = ""; }; 088134FE2A56C5240027C086 /* CompliancePopoverViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompliancePopoverViewModelTests.swift; sourceTree = ""; }; 0885A3661E837AFE00619B4D /* URLIncrementalFilenameTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLIncrementalFilenameTests.swift; sourceTree = ""; }; 088CAD4D2BBD8223005996DE /* BlogListViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogListViewModelTests.swift; sourceTree = ""; }; @@ -1297,7 +1290,6 @@ 08AA640B2A8511FB0076E38D /* DashboardGoogleDomainsViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardGoogleDomainsViewModelTests.swift; sourceTree = ""; }; 08AA640D2A8540590076E38D /* MockEventTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockEventTracker.swift; sourceTree = ""; }; 08AAD6A01CBEA610002B2418 /* MenusServiceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenusServiceTests.m; sourceTree = ""; }; - 08B6E51B1F037ADD00268F57 /* MediaFileManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaFileManagerTests.swift; sourceTree = ""; }; 08B832411EC130D60079808D /* test-gif.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "test-gif.gif"; sourceTree = ""; }; 08C42C30281807880034720B /* ReaderSubscribeCommentsActionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderSubscribeCommentsActionTests.swift; sourceTree = ""; }; 08DF9C431E8475530058678C /* test-image-portrait.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "test-image-portrait.jpg"; sourceTree = ""; }; @@ -1360,8 +1352,6 @@ 0C6C4CD32A4F0AD80049E762 /* blaze-search-page-1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "blaze-search-page-1.json"; sourceTree = ""; }; 0C6C4CD52A4F0AEE0049E762 /* blaze-search-page-2.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "blaze-search-page-2.json"; sourceTree = ""; }; 0C6C4CD72A4F0F2C0049E762 /* Bundle+TestExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+TestExtensions.swift"; sourceTree = ""; }; - 0C77A5B22CDE7924005BC0DA /* ReaderPostTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderPostTests.swift; sourceTree = ""; }; - 0C7D48192A4DB9300023CF84 /* blaze-search-response.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "blaze-search-response.json"; sourceTree = ""; }; 0C896DE62A3A832B00D7D4E7 /* SiteVisibilityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteVisibilityTests.swift; sourceTree = ""; }; 0C8FC9A92A8C57000059DCE4 /* ItemProviderMediaExporterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemProviderMediaExporterTests.swift; sourceTree = ""; }; 0C8FC9AB2A8C57930059DCE4 /* test-webp.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-webp.webp"; sourceTree = ""; }; @@ -1373,7 +1363,6 @@ 0CB424F32ADF3CBE0080B807 /* PostSearchViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostSearchViewModelTests.swift; sourceTree = ""; }; 0CD382852A4B6FCE00612173 /* DashboardBlazeCardCellViewModelTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardBlazeCardCellViewModelTest.swift; sourceTree = ""; }; 0CD6299A2B9AAA9A00325EA4 /* Foundation+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Foundation+Extensions.swift"; sourceTree = ""; }; - 0CF7D6C22ABB753A006D1E89 /* MediaImageServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaImageServiceTests.swift; sourceTree = ""; }; 173D82E6238EE2A7008432DA /* FeatureFlagTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlagTests.swift; sourceTree = ""; }; 174C116E2624603400346EC6 /* MBarRouteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBarRouteTests.swift; sourceTree = ""; }; 1759F1711FE017F20003EC81 /* QueueTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueueTests.swift; sourceTree = ""; }; @@ -1388,16 +1377,11 @@ 1D91080629F847A2003F9A5E /* MediaServiceUpdateTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MediaServiceUpdateTests.m; sourceTree = ""; }; 1DE9F2B22BA30E820044AA53 /* GutenbergFileUploadProcessorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergFileUploadProcessorTests.swift; sourceTree = ""; }; 1DF7A0D22BA0B1810003CBA3 /* GutenbergContentParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergContentParser.swift; sourceTree = ""; }; - 2422A2BF2C5846DB00402A81 /* Blog+RestAPITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Blog+RestAPITests.swift"; sourceTree = ""; }; 24350E7C264DB76E009BB2B6 /* Jetpack.debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Jetpack.debug.xcconfig; sourceTree = ""; }; 24351059264DC1E2009BB2B6 /* Jetpack.release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Jetpack.release.xcconfig; sourceTree = ""; }; 24351253264DCA08009BB2B6 /* Secrets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Secrets.swift; path = ../Secrets/Secrets.swift; sourceTree = BUILT_PRODUCTS_DIR; }; 2439B1DB264ECBDF00239130 /* Jetpack.alpha.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Jetpack.alpha.xcconfig; sourceTree = ""; }; - 246D0A0225E97D5D0028B83F /* Blog+ObjcTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Blog+ObjcTests.m"; sourceTree = ""; }; 2481B1D4260D4E8B00AE59DB /* AccountBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountBuilder.swift; sourceTree = ""; }; - 2481B1E7260D4EAC00AE59DB /* WPAccount+LookupTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WPAccount+LookupTests.swift"; sourceTree = ""; }; - 2481B20B260D8FED00AE59DB /* WPAccount+ObjCLookupTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "WPAccount+ObjCLookupTests.m"; sourceTree = ""; }; - 24A2948225D602710000A51E /* BlogTimeZoneTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BlogTimeZoneTests.m; sourceTree = ""; }; 24AD66BE25FC25FD0056102C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Sites.strings; sourceTree = ""; }; 24AD66C025FC25FE0056102C /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/Sites.strings; sourceTree = ""; }; 24AD66C225FC26000056102C /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Sites.strings; sourceTree = ""; }; @@ -1437,8 +1421,6 @@ 24B54FAE2624F8430041B18E /* JetpackRelease-Alpha.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "JetpackRelease-Alpha.entitlements"; sourceTree = ""; }; 24B54FAF2624F84C0041B18E /* JetpackRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = JetpackRelease.entitlements; sourceTree = ""; }; 24B54FB02624F8690041B18E /* JetpackDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = JetpackDebug.entitlements; sourceTree = ""; }; - 24C69A8A2612421900312D9A /* UserSettingsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSettingsTests.swift; sourceTree = ""; }; - 24C69AC12612467C00312D9A /* UserSettingsTestsObjc.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserSettingsTestsObjc.m; sourceTree = ""; }; 24CDE3402C5863A1005E5E43 /* TestKeychain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestKeychain.swift; sourceTree = ""; }; 24E55D4D2CC9A5C8008D071D /* ImagePlayground.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImagePlayground.framework; path = System/Library/Frameworks/ImagePlayground.framework; sourceTree = SDKROOT; }; 28A0AAE50D9B0CCF005BE974 /* WordPress_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordPress_Prefix.pch; sourceTree = ""; }; @@ -1451,6 +1433,8 @@ 3F28CEA42A4ABB8800B79686 /* PrivacySettingsAnalyticsTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacySettingsAnalyticsTrackerTests.swift; sourceTree = ""; }; 3F28CEA82A4ACB1000B79686 /* AnalyticsEventTrackingSpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsEventTrackingSpy.swift; sourceTree = ""; }; 3F28CEAE2A4ACEBE00B79686 /* PrivacySettingsViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrivacySettingsViewControllerTests.swift; sourceTree = ""; }; + 3F2AA3E32D81457F002A4E94 /* WordPressData.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WordPressData.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3F2AA3EA2D81457F002A4E94 /* WordPressDataTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WordPressDataTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3F3D854A251E6418001CA4D2 /* AnnouncementsDataStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnouncementsDataStoreTests.swift; sourceTree = ""; }; 3F46AB0125BF5D6300CE2E98 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; name = Base; path = Base.lproj/Sites.intentdefinition; sourceTree = ""; }; 3F4A4C202AD39CB100DE5DF8 /* TruthTable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TruthTable.swift; sourceTree = ""; }; @@ -1466,7 +1450,6 @@ 3F60D3932D2C4BA4008ACD86 /* yoga.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = yoga.xcframework; path = Frameworks/yoga.xcframework; sourceTree = ""; }; 3F6E6A5A2D82ACE000DAF6EA /* KeychainUtilsMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainUtilsMock.swift; sourceTree = ""; }; 3F751D452491A93D0008A2B1 /* ZendeskUtilsTests+Plans.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ZendeskUtilsTests+Plans.swift"; sourceTree = ""; }; - 3F759FB92A2DA93B0039A845 /* WPAccount+Fixture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WPAccount+Fixture.swift"; sourceTree = ""; }; 3F759FBB2A2DB2CF0039A845 /* TestError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestError.swift; sourceTree = ""; }; 3F759FBD2A2DB3280039A845 /* AccountSettingsRemoteInterfaceStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSettingsRemoteInterfaceStub.swift; sourceTree = ""; }; 3F86A83629D19C15005D20C0 /* SignupEpilogueTableViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignupEpilogueTableViewControllerTests.swift; sourceTree = ""; }; @@ -1478,6 +1461,7 @@ 3FDDFE9527C8178C00606933 /* SiteStatsInformationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteStatsInformationTests.swift; sourceTree = ""; }; 3FE6D31D2B0705D400D14923 /* JetpackBrandingVisibilityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackBrandingVisibilityTests.swift; sourceTree = ""; }; 3FFB3F212AFC72EC00A742B0 /* DeepLinkSourceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeepLinkSourceTests.swift; sourceTree = ""; }; + 3FFCBCE32D814FA700C2F712 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = DEVELOPER_DIR; }; 3FFE3C0728FE00D10021BB96 /* StatsSegmentedControlDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsSegmentedControlDataTests.swift; sourceTree = ""; }; 406A0EEF224D39C50016AD6A /* Flags.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Flags.xcassets; sourceTree = ""; }; 40ACCF13224E167900190713 /* FlagsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlagsTest.swift; sourceTree = ""; }; @@ -1505,8 +1489,6 @@ 4A1267D52C21739300717174 /* WordPressAuthenticator.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = WordPressAuthenticator.xctestplan; path = ../WordPressAuthenticator.xctestplan; sourceTree = ""; }; 4A17C1A3281A823E0001FFE5 /* NSManagedObject+Fixture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSManagedObject+Fixture.swift"; sourceTree = ""; }; 4A266B8E282B05210089CF3D /* JSONObjectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONObjectTests.swift; sourceTree = ""; }; - 4A266B90282B13A70089CF3D /* CoreDataTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataTestCase.swift; sourceTree = ""; }; - 4A2C73E32A943DEA00ACE79E /* TaggedManagedObjectIDTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaggedManagedObjectIDTests.swift; sourceTree = ""; }; 4A2C73F62A9585B000ACE79E /* PostRepositoryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostRepositoryTests.swift; sourceTree = ""; }; 4A5598842B05AC180083C220 /* PagesListTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagesListTests.swift; sourceTree = ""; }; 4A5EDD802CE58B9900A605FC /* ZendeskUtilsTests+A8CEmail.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ZendeskUtilsTests+A8CEmail.swift"; sourceTree = ""; }; @@ -1526,7 +1508,6 @@ 4AAD69072A6F68A5007FE77E /* MediaRepositoryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaRepositoryTests.swift; sourceTree = ""; }; 4AB6A35F2B7C3EB500769115 /* PinghubWebSocketTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinghubWebSocketTests.swift; sourceTree = ""; }; 4AC299D62C6EEB16002E74C8 /* ApplicationPasswordsViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationPasswordsViewModelTests.swift; sourceTree = ""; }; - 4AD5657128E543A30054C676 /* BlogQueryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogQueryTests.swift; sourceTree = ""; }; 4AD862E42AFAEF1700A07557 /* PostsListAPIStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostsListAPIStub.swift; sourceTree = ""; }; 4AD8DCAF2CC6505E0058DE55 /* WordPressDotComAuthenticatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPressDotComAuthenticatorTests.swift; sourceTree = ""; }; 4AD953B42C21451700D0EEFA /* WordPressAuthenticator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WordPressAuthenticator.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1739,13 +1720,11 @@ 4AD955982C2171F000D0EEFA /* MemoryManagementTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MemoryManagementTests.swift; sourceTree = ""; }; 4AEF2DD829A84B2C00345734 /* ReaderSiteServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderSiteServiceTests.swift; sourceTree = ""; }; 4AFB8FBE2824999400A2F4B2 /* ContextManager+Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ContextManager+Helpers.swift"; sourceTree = ""; }; - 570BFD8F2282418A007859A8 /* PostBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostBuilder.swift; sourceTree = ""; }; 572FB400223A806000933C76 /* NoticeStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoticeStoreTests.swift; sourceTree = ""; }; 575802122357C41200E4C63C /* MediaCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MediaCoordinatorTests.swift; path = Services/MediaCoordinatorTests.swift; sourceTree = ""; }; 57889AB723589DF100DAE56D /* PageBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PageBuilder.swift; path = TestUtilities/PageBuilder.swift; sourceTree = ""; }; 57B71D4D230DB5F200789A68 /* BlogBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogBuilder.swift; sourceTree = ""; }; 5948AD101AB73D19006E8882 /* WPAppAnalyticsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = WPAppAnalyticsTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 5960967E1CF7959300848496 /* PostTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostTests.swift; sourceTree = ""; }; 59A9AB391B4C3ECD00A433DC /* LocalCoreDataServiceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocalCoreDataServiceTests.m; sourceTree = ""; }; 59B48B611B99E132008EBB84 /* JSONObject.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = JSONObject.swift; path = TestUtilities/JSONObject.swift; sourceTree = ""; }; 59ECF87A1CB7061D00E68F25 /* PostSharingControllerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PostSharingControllerTests.swift; path = Posts/PostSharingControllerTests.swift; sourceTree = ""; }; @@ -1850,7 +1829,6 @@ 8355D7D811D260AA00A61362 /* CoreData.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 835E2402126E66E50085940B /* AssetsLibrary.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = AssetsLibrary.framework; path = System/Library/Frameworks/AssetsLibrary.framework; sourceTree = SDKROOT; }; 83BFAE4F2A6EBF9900C7B683 /* DashboardJetpackSocialCardCellTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DashboardJetpackSocialCardCellTests.swift; sourceTree = ""; }; - 83EF3D7C2937E969000AF9BF /* SharedDataIssueSolverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharedDataIssueSolverTests.swift; sourceTree = ""; }; 83F3E25F11275E07004CD686 /* MapKit.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 83F3E2D211276371004CD686 /* CoreLocation.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 83FB4D3E122C38F700DB9506 /* MediaPlayer.framework */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; @@ -1876,11 +1854,8 @@ 8B69F0E3255C2C3F006B1CEF /* ActivityListViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityListViewModelTests.swift; sourceTree = ""; }; 8B69F0FF255C4870006B1CEF /* ActivityStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityStoreTests.swift; sourceTree = ""; }; 8B749E8F25AF8D2E00023F03 /* JetpackCapabilitiesServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackCapabilitiesServiceTests.swift; sourceTree = ""; }; - 8B8C814C2318073300A0E620 /* BasePostTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BasePostTests.swift; sourceTree = ""; }; 8BB185CB24B6058600A4CCE8 /* reader-cards.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "reader-cards.json"; sourceTree = ""; }; 8BB185CD24B62CE100A4CCE8 /* ReaderCardServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderCardServiceTests.swift; sourceTree = ""; }; - 8BBBEBB124B8F8C0005E358E /* ReaderCardTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderCardTests.swift; sourceTree = ""; }; - 8BC6020C2390412000EFE3D0 /* NullBlogPropertySanitizerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NullBlogPropertySanitizerTests.swift; sourceTree = ""; }; 8BD34F0827D144FF005E931C /* BlogDashboardStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogDashboardStateTests.swift; sourceTree = ""; }; 8BD36E052395CC4400EFFF1C /* MediaEditorOperation+DescriptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MediaEditorOperation+DescriptionTests.swift"; sourceTree = ""; }; 8BDA5A6C247C2F8400AB124C /* ReaderDetailViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderDetailViewControllerTests.swift; sourceTree = ""; }; @@ -1894,7 +1869,6 @@ 91CFB9542CE21196005CD369 /* URLHelpersTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLHelpersTests.swift; sourceTree = ""; }; 930FD0A519882742000CC81D /* BlogServiceTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlogServiceTest.m; sourceTree = ""; }; 931215E0267DE1C0008C3B69 /* StatsTotalRowDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsTotalRowDataTests.swift; sourceTree = ""; }; - 931D26FF19EDAE8600114F17 /* CoreDataMigrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreDataMigrationTests.m; sourceTree = ""; }; 931DF4D718D09A2F00540BDD /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 931DF4D918D09A9B00540BDD /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = ""; }; 931DF4DA18D09AE100540BDD /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -1936,7 +1910,6 @@ 93D86B941C63EC31003D8E3E /* en-CA */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-CA"; path = "en-CA.lproj/Localizable.strings"; sourceTree = ""; }; 93E5283B19A7741A003A1A9C /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; 93E9050219E6F240005513C9 /* WordPressTest-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WordPressTest-Bridging-Header.h"; sourceTree = ""; }; - 93E9050319E6F242005513C9 /* ContextManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContextManagerTests.swift; sourceTree = ""; }; 93F2E53F1E9E5A180050D489 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; 93F2E5411E9E5A350050D489 /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = System/Library/Frameworks/QuickLook.framework; sourceTree = SDKROOT; }; 93F2E5431E9E5A570050D489 /* CoreSpotlight.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreSpotlight.framework; path = System/Library/Frameworks/CoreSpotlight.framework; sourceTree = SDKROOT; }; @@ -1967,7 +1940,6 @@ B532ACD21DC3AE1200FFFA57 /* OHHTTPStubs+Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OHHTTPStubs+Helpers.swift"; sourceTree = ""; }; B5416CFD1C1756B900006DD8 /* PushNotificationsManagerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PushNotificationsManagerTests.m; sourceTree = ""; }; B556EFCA1DCA374200728F93 /* DictionaryHelpersTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DictionaryHelpersTests.swift; sourceTree = ""; }; - B55F1AA11C107CE200FD04D4 /* BlogSettingsDiscussionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlogSettingsDiscussionTests.swift; sourceTree = ""; }; B566EC741B83867800278395 /* NSMutableAttributedStringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSMutableAttributedStringTests.swift; sourceTree = ""; }; B5772AC51C9C84900031F97E /* GravatarServiceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GravatarServiceTests.swift; sourceTree = ""; }; B5882C461D5297D1008E0EAA /* NotificationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationTests.swift; sourceTree = ""; }; @@ -1978,7 +1950,6 @@ B5AEEC771ACACFDA008BF2A4 /* notifications-new-follower.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "notifications-new-follower.json"; sourceTree = ""; }; B5AEEC781ACACFDA008BF2A4 /* notifications-replied-comment.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "notifications-replied-comment.json"; sourceTree = ""; }; B5DA8A5E20ADAA1C00D5BDE1 /* plugin-directory-jetpack.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "plugin-directory-jetpack.json"; sourceTree = ""; }; - B5ECA6CC1DBAAD510062D7E0 /* CoreDataHelperTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CoreDataHelperTests.swift; sourceTree = ""; }; B5EFB1C81B333C5A007608A3 /* NotificationSettingsServiceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationSettingsServiceTests.swift; sourceTree = ""; }; B5EFB1D01B33630C007608A3 /* notifications-settings.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "notifications-settings.json"; sourceTree = ""; }; BE2B4E9E1FD664F5007AE3E4 /* BaseScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseScreen.swift; sourceTree = ""; }; @@ -1987,7 +1958,6 @@ BED4D8321FF11E3800A11345 /* LoginFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginFlow.swift; sourceTree = ""; }; C314543A262770BE005B216B /* BlogServiceAuthorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogServiceAuthorTests.swift; sourceTree = ""; }; C373D6E9280452F6008F8C26 /* SiteIntentDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteIntentDataTests.swift; sourceTree = ""; }; - C38C5D8027F61D2C002F517E /* MenuItemTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MenuItemTests.swift; path = Menus/MenuItemTests.swift; sourceTree = ""; }; C396C80A280F2401006FE7AC /* SiteDesignTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteDesignTests.swift; sourceTree = ""; }; C3C2F84528AC8BC700937E45 /* JetpackBannerScrollVisibilityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JetpackBannerScrollVisibilityTests.swift; sourceTree = ""; }; C3C70C552835C5BB00DD2546 /* SiteDesignSectionLoaderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteDesignSectionLoaderTests.swift; sourceTree = ""; }; @@ -2042,8 +2012,6 @@ D848CC0E20FF2D9B00A9038F /* notifications-comment-range.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "notifications-comment-range.json"; sourceTree = ""; }; D848CC1020FF310400A9038F /* notifications-site-range.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "notifications-site-range.json"; sourceTree = ""; }; D848CC1220FF31BB00A9038F /* notifications-blockquote-range.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "notifications-blockquote-range.json"; sourceTree = ""; }; - D848CC1420FF33FC00A9038F /* NotificationContentRangeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationContentRangeTests.swift; sourceTree = ""; }; - D848CC1620FF38EA00A9038F /* FormattableCommentRangeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormattableCommentRangeTests.swift; sourceTree = ""; }; D848CC1820FF3A2400A9038F /* FormattableNotIconTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormattableNotIconTests.swift; sourceTree = ""; }; D88A6491208D7A0A008AE9BC /* MockStockPhotosService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockStockPhotosService.swift; sourceTree = ""; }; D88A649D208D82D2008AE9BC /* XCTestCase+Wait.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCTestCase+Wait.swift"; sourceTree = ""; }; @@ -2130,7 +2098,6 @@ E1EBC3721C118ED200F638E0 /* ImmuTableTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImmuTableTest.swift; sourceTree = ""; }; E1EBC3741C118EDE00F638E0 /* ImmuTableTestViewCellWithNib.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ImmuTableTestViewCellWithNib.xib; sourceTree = ""; }; E66969C71B9E0A6800EC9C00 /* ReaderTopicServiceTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReaderTopicServiceTest.swift; sourceTree = ""; }; - E6A2158F1D1065F200DE5270 /* AbstractPostTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AbstractPostTest.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; E6B9B8AE1B94FA1C0001B92F /* ReaderStreamViewControllerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReaderStreamViewControllerTests.swift; sourceTree = ""; }; EA14534229AD874C001F3143 /* JetpackUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JetpackUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; EA14534629AEF479001F3143 /* JetpackUITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = JetpackUITests.xctestplan; sourceTree = ""; }; @@ -2151,7 +2118,6 @@ F15D1FB9265C41A900854EE5 /* BloggingRemindersStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BloggingRemindersStoreTests.swift; sourceTree = ""; }; F17A2A1F23BFBD84001E96AC /* UIView+ExistingConstraints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+ExistingConstraints.swift"; sourceTree = ""; }; F18B43771F849F580089B817 /* PostAttachmentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PostAttachmentTests.swift; path = Posts/PostAttachmentTests.swift; sourceTree = ""; }; - F1B1E7A224098FA100549E2A /* BlogTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogTests.swift; sourceTree = ""; }; F1BB660B274E704D00A319BE /* LikeUserHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LikeUserHelperTests.swift; sourceTree = ""; }; F1F083F5241FFE930056D3B1 /* AtomicAuthenticationServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AtomicAuthenticationServiceTests.swift; sourceTree = ""; }; F1F163C025658B4D003DC13B /* IntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentHandler.swift; sourceTree = ""; }; @@ -2213,11 +2179,9 @@ FEA312832987FB0100FFD405 /* BlogJetpackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlogJetpackTests.swift; sourceTree = ""; }; FEAA6F78298CE4A600ADB44C /* PluginJetpackProxyServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginJetpackProxyServiceTests.swift; sourceTree = ""; }; FECA44312836647100D01F15 /* PromptRemindersSchedulerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromptRemindersSchedulerTests.swift; sourceTree = ""; }; - FEE48EFE2A4C9855008A48E0 /* Blog+PublicizeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Blog+PublicizeTests.swift"; sourceTree = ""; }; FEF7F33F2AFEA0C200F793FC /* blogging-prompts-bloganuary.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "blogging-prompts-bloganuary.json"; sourceTree = ""; }; FEFA263D26C58427009CCB7E /* ShareAppTextActivityItemSourceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareAppTextActivityItemSourceTests.swift; sourceTree = ""; }; FEFA6AC52A86824A004EE5E6 /* PostHelperJetpackSocialTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostHelperJetpackSocialTests.swift; sourceTree = ""; }; - FEFA6AC72A88D5FC004EE5E6 /* Post+JetpackSocialTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Post+JetpackSocialTests.swift"; sourceTree = ""; }; FEFC0F8B273131A6001F7F1D /* CommentService+RepliesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CommentService+RepliesTests.swift"; sourceTree = ""; }; FEFC0F8D27313DCF001F7F1D /* comments-v2-success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "comments-v2-success.json"; sourceTree = ""; }; FEFC0F8F27315634001F7F1D /* empty-array.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "empty-array.json"; sourceTree = ""; }; @@ -2249,12 +2213,71 @@ FFE69A2A1B1BFE200073C2EB /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/InfoPlist.strings; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 3F2AA3FF2D81457F002A4E94 /* Exceptions for "WordPressData" folder in "WordPressData" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + publicHeaders = ( + "Objective-C/include/AbstractPost.h", + "Objective-C/include/BasePost.h", + "Objective-C/include/Blog.h", + "Objective-C/include/CoreDataService.h", + "Objective-C/include/CoreDataStack.h", + "Objective-C/include/LocalCoreDataService.h", + "Objective-C/include/Media.h", + "Objective-C/include/PostCategory.h", + "Objective-C/include/PostContentProvider.h", + "Objective-C/include/PostHelper.h", + "Objective-C/include/PostService.h", + "Objective-C/include/PostServiceOptions.h", + "Objective-C/include/ReaderPost.h", + "Objective-C/include/SourcePostAttribution.h", + "Objective-C/include/WPAccount.h", + WordPressData.h, + ); + target = 3F2AA3E22D81457F002A4E94 /* WordPressData */; + }; + 3FE8B6732D8B56FB000A3E7B /* Exceptions for "WordPressData-Staging-Folder" folder in "WordPressTest" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + AbstractPostTest.swift, + BasePostTests.swift, + "Blog+ObjcTests.m", + "Blog+PublicizeTests.swift", + "Blog+RestAPITests.swift", + BlogQueryTests.swift, + BlogSettingsDiscussionTests.swift, + BlogTests.swift, + BlogTimeZoneTests.m, + ContextManagerTests.swift, + CoreDataHelperTests.swift, + CoreDataMigrationTests.m, + CoreDataTestCase.swift, + MediaFileManagerTests.swift, + MediaImageServiceTests.swift, + MediaTests.swift, + MenuItemTests.swift, + NotificationCommentRangeTests.swift, + NotificationContentRangeTests.swift, + NullBlogPropertySanitizerTests.swift, + NullMockUserDefaults.swift, + "Post+JetpackSocialTests.swift", + PostBuilder.swift, + PostTests.swift, + ReaderCardTests.swift, + ReaderPostTests.swift, + SharedDataIssueSolverTests.swift, + TaggedManagedObjectIDTests.swift, + UserSettingsTests.swift, + UserSettingsTestsObjc.m, + "WPAccount+Fixture.swift", + "WPAccount+LookupTests.swift", + "WPAccount+ObjCLookupTests.m", + ); + target = E16AB92914D978240047A2E5 /* WordPressTest */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + /* Begin PBXFileSystemSynchronizedRootGroup section */ - 0C1CB0CD2D95C63C00494A8C /* Sources */ = { - isa = PBXFileSystemSynchronizedRootGroup; - path = Sources; - sourceTree = ""; - }; 0C1C180E2D95DA5200494A8C /* Icons */ = { isa = PBXFileSystemSynchronizedRootGroup; name = Icons; @@ -2266,6 +2289,11 @@ path = Icons; sourceTree = ""; }; + 0C1CB0CD2D95C63C00494A8C /* Sources */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Sources; + sourceTree = ""; + }; 0C5083352D8DB82F007987AB /* Sources */ = { isa = PBXFileSystemSynchronizedRootGroup; path = Sources; @@ -2281,6 +2309,27 @@ path = Classes; sourceTree = ""; }; + 3F2AA3E42D81457F002A4E94 /* WordPressData */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 3F2AA3FF2D81457F002A4E94 /* Exceptions for "WordPressData" folder in "WordPressData" target */, + ); + path = WordPressData; + sourceTree = ""; + }; + 3F2AA3F02D81457F002A4E94 /* WordPressDataTests */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = WordPressDataTests; + sourceTree = ""; + }; + 3FE8B6722D8B5692000A3E7B /* WordPressData-Staging-Folder */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 3FE8B6732D8B56FB000A3E7B /* Exceptions for "WordPressData-Staging-Folder" folder in "WordPressTest" target */, + ); + path = "WordPressData-Staging-Folder"; + sourceTree = ""; + }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2328,6 +2377,7 @@ E10B3652158F2D3F00419A93 /* QuartzCore.framework in Frameworks */, 3F60D3942D2C4BA4008ACD86 /* React.xcframework in Frameworks */, 3F60D3982D2C4BA4008ACD86 /* RNTAztecView.xcframework in Frameworks */, + 3F2AA3F62D81457F002A4E94 /* WordPressData.framework in Frameworks */, E1A386CB14DB063800954CF8 /* MediaPlayer.framework in Frameworks */, E1A386CA14DB05F700954CF8 /* CoreMedia.framework in Frameworks */, 3F60D3962D2C4BA4008ACD86 /* Gutenberg.xcframework in Frameworks */, @@ -2346,6 +2396,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3F2AA3E02D81457F002A4E94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3FFCBCE12D814EEC00C2F712 /* XcodeTarget_WordPressData in Frameworks */, + 3FFCBCE42D814FA700C2F712 /* CoreData.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F2AA3E72D81457F002A4E94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3F2AA3EB2D81457F002A4E94 /* WordPressData.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4AD953B12C21451700D0EEFA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2603,7 +2670,6 @@ 08F8CD2B1EBD243A0049D0C0 /* Media */ = { isa = PBXGroup; children = ( - 08B6E51B1F037ADD00268F57 /* MediaFileManagerTests.swift */, 08F8CD2C1EBD245F0049D0C0 /* MediaExporterTests.swift */, 08F8CD301EBD2A960049D0C0 /* MediaImageExporterTests.swift */, 08F8CD3A1EBD2D020049D0C0 /* MediaURLExporterTests.swift */, @@ -2617,7 +2683,6 @@ 0C7D48182A4DB91B0023CF84 /* Blaze */ = { isa = PBXGroup; children = ( - 0C7D48192A4DB9300023CF84 /* blaze-search-response.json */, 0C6C4CD32A4F0AD80049E762 /* blaze-search-page-1.json */, 0C6C4CD52A4F0AEE0049E762 /* blaze-search-page-2.json */, ); @@ -2673,6 +2738,8 @@ EA14534229AD874C001F3143 /* JetpackUITests.xctest */, 4AD953B42C21451700D0EEFA /* WordPressAuthenticator.framework */, 4AD953BB2C21451700D0EEFA /* WordPressAuthenticatorTests.xctest */, + 3F2AA3E32D81457F002A4E94 /* WordPressData.framework */, + 3F2AA3EA2D81457F002A4E94 /* WordPressDataTests.xctest */, ); name = Products; sourceTree = ""; @@ -2708,6 +2775,8 @@ 8511CFB71C607A7000B7CEED /* WordPressScreenshotGeneration */, FAF64BC82637DF0600E8A1DF /* JetpackScreenshotGeneration */, 4AD953B52C21451700D0EEFA /* WordPressAuthenticator */, + 3F2AA3E42D81457F002A4E94 /* WordPressData */, + 3F2AA3F02D81457F002A4E94 /* WordPressDataTests */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, 93FA0F0118E451A80007903B /* LICENSE */, @@ -2754,6 +2823,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 3FFCBCE32D814FA700C2F712 /* CoreData.framework */, 3F60D3902D2C4BA3008ACD86 /* Gutenberg.xcframework */, 3F60D3922D2C4BA3008ACD86 /* hermes.xcframework */, 3F60D38F2D2C4BA3008ACD86 /* React.xcframework */, @@ -3535,7 +3605,6 @@ F11023A223186BCA00C4E84A /* MediaBuilder.swift */, 3F593FDC2A81DC6D00B29E86 /* NSError+TestInstance.swift */, 57889AB723589DF100DAE56D /* PageBuilder.swift */, - 570BFD8F2282418A007859A8 /* PostBuilder.swift */, 3F56F55B2AEA2F67006BDCEA /* ReaderPostBuilder.swift */, 3F759FBB2A2DB2CF0039A845 /* TestError.swift */, ); @@ -3560,36 +3629,6 @@ name = Sounds; sourceTree = ""; }; - 5D7A577D1AFBFD7C0097C028 /* Models */ = { - isa = PBXGroup; - children = ( - E6A2158F1D1065F200DE5270 /* AbstractPostTest.swift */, - 8B8C814C2318073300A0E620 /* BasePostTests.swift */, - 246D0A0225E97D5D0028B83F /* Blog+ObjcTests.m */, - FEE48EFE2A4C9855008A48E0 /* Blog+PublicizeTests.swift */, - 4AD5657128E543A30054C676 /* BlogQueryTests.swift */, - B55F1AA11C107CE200FD04D4 /* BlogSettingsDiscussionTests.swift */, - F1B1E7A224098FA100549E2A /* BlogTests.swift */, - 24A2948225D602710000A51E /* BlogTimeZoneTests.m */, - D848CC1620FF38EA00A9038F /* FormattableCommentRangeTests.swift */, - 0879FC151E9301DD00E1EFC8 /* MediaTests.swift */, - 0CF7D6C22ABB753A006D1E89 /* MediaImageServiceTests.swift */, - C38C5D8027F61D2C002F517E /* MenuItemTests.swift */, - D848CC1420FF33FC00A9038F /* NotificationContentRangeTests.swift */, - 5960967E1CF7959300848496 /* PostTests.swift */, - FEFA6AC72A88D5FC004EE5E6 /* Post+JetpackSocialTests.swift */, - 8BBBEBB124B8F8C0005E358E /* ReaderCardTests.swift */, - 0C77A5B22CDE7924005BC0DA /* ReaderPostTests.swift */, - 24C69A8A2612421900312D9A /* UserSettingsTests.swift */, - 24C69AC12612467C00312D9A /* UserSettingsTestsObjc.m */, - 3F759FB92A2DA93B0039A845 /* WPAccount+Fixture.swift */, - 2481B1E7260D4EAC00AE59DB /* WPAccount+LookupTests.swift */, - 2481B20B260D8FED00AE59DB /* WPAccount+ObjCLookupTests.m */, - 2422A2BF2C5846DB00402A81 /* Blog+RestAPITests.swift */, - ); - name = Models; - sourceTree = ""; - }; 73178C2021BEE09300E37C9A /* SiteCreation */ = { isa = PBXGroup; children = ( @@ -3780,6 +3819,7 @@ 801D951C291ADB7E0051993E /* OverlayFrequencyTrackerTests.swift */, 80535DC4294BF4BE00873161 /* JetpackBrandingMenuCardPresenterTests.swift */, 803BB99329667CF700B3F6D6 /* JetpackBrandingTextProviderTests.swift */, + FE320CC4294705990046899B /* ReaderPostBackupTests.swift */, ); name = Jetpack; sourceTree = ""; @@ -3822,7 +3862,6 @@ isa = PBXGroup; children = ( 8332DD2729259BEB00802F7D /* DataMigratorTests.swift */, - 83EF3D7C2937E969000AF9BF /* SharedDataIssueSolverTests.swift */, 08AA640D2A8540590076E38D /* MockEventTracker.swift */, 3F6E6A5A2D82ACE000DAF6EA /* KeychainUtilsMock.swift */, ); @@ -3867,7 +3906,6 @@ F551E7F623FC9A5C00751212 /* Collection+RotateTests.swift */, E180BD4B1FB462FF00D0D781 /* CookieJarTests.swift */, E1AB5A391E0C464700574B4E /* DelayTests.swift */, - 4A266B90282B13A70089CF3D /* CoreDataTestCase.swift */, 173D82E6238EE2A7008432DA /* FeatureFlagTests.swift */, E1EBC3721C118ED200F638E0 /* ImmuTableTest.swift */, 4A266B8E282B05210089CF3D /* JSONObjectTests.swift */, @@ -4088,11 +4126,6 @@ B5AEEC731ACACF3B008BF2A4 /* Core Data */ = { isa = PBXGroup; children = ( - 93E9050319E6F242005513C9 /* ContextManagerTests.swift */, - B5ECA6CC1DBAAD510062D7E0 /* CoreDataHelperTests.swift */, - 4A2C73E32A943DEA00ACE79E /* TaggedManagedObjectIDTests.swift */, - 931D26FF19EDAE8600114F17 /* CoreDataMigrationTests.m */, - FE320CC4294705990046899B /* ReaderPostBackupTests.swift */, ); name = "Core Data"; sourceTree = ""; @@ -4127,7 +4160,6 @@ E135965C1E7152D1006C6606 /* RecentSitesServiceTests.swift */, B5EFB1C81B333C5A007608A3 /* NotificationSettingsServiceTests.swift */, B532ACCE1DC3AB8E00FFFA57 /* NotificationSyncMediatorTests.swift */, - 8BC6020C2390412000EFE3D0 /* NullBlogPropertySanitizerTests.swift */, 08A2AD7A1CCED8E500E84454 /* PostCategoryServiceTests.m */, 0CA15B4D2BB2128800518D6E /* PostCoordinatorTests.swift */, FEFA6AC52A86824A004EE5E6 /* PostHelperJetpackSocialTests.swift */, @@ -4470,7 +4502,6 @@ FF9A6E6F21F9359200D36D14 /* Gutenberg */, 803DE81D29063689007D4E9C /* Jetpack */, FF7C89A11E3A1029000472A8 /* MediaPicker */, - 5D7A577D1AFBFD7C0097C028 /* Models */, 85F8E1991B017A8E000859BB /* Networking */, B5416CF81C17542900006DD8 /* Notifications */, 9A9D34FB23607C8400BC95A3 /* Operations */, @@ -4525,6 +4556,7 @@ E16AB92F14D978240047A2E5 /* WordPressTest */ = { isa = PBXGroup; children = ( + 3FE8B6722D8B5692000A3E7B /* WordPressData-Staging-Folder */, E16AB93014D978240047A2E5 /* Supporting Files */, B532ACD41DC3AE1F00FFFA57 /* Extensions */, E16AB94414D9A13A0047A2E5 /* Mock Data */, @@ -4914,6 +4946,13 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + 3F2AA3DE2D81457F002A4E94 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4AD953AF2C21451700D0EEFA /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -4998,6 +5037,7 @@ 7457667B202B558C00F42E40 /* PBXTargetDependency */, 7358E6BE210BD318002323EB /* PBXTargetDependency */, 4AD953C62C21451700D0EEFA /* PBXTargetDependency */, + 3F2AA3F52D81457F002A4E94 /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( 0C1C180E2D95DA5200494A8C /* Icons */, @@ -5012,6 +5052,53 @@ productReference = 1D6058910D05DD3D006BFB54 /* WordPress.app */; productType = "com.apple.product-type.application"; }; + 3F2AA3E22D81457F002A4E94 /* WordPressData */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F2AA3FE2D81457F002A4E94 /* Build configuration list for PBXNativeTarget "WordPressData" */; + buildPhases = ( + 3F2AA3DE2D81457F002A4E94 /* Headers */, + 3F2AA3DF2D81457F002A4E94 /* Sources */, + 3F2AA3E02D81457F002A4E94 /* Frameworks */, + 3F2AA3E12D81457F002A4E94 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 3F2AA3E42D81457F002A4E94 /* WordPressData */, + ); + name = WordPressData; + packageProductDependencies = ( + 3FFCBCE02D814EEC00C2F712 /* XcodeTarget_WordPressData */, + ); + productName = WordPressData; + productReference = 3F2AA3E32D81457F002A4E94 /* WordPressData.framework */; + productType = "com.apple.product-type.framework"; + }; + 3F2AA3E92D81457F002A4E94 /* WordPressDataTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3F2AA4002D81457F002A4E94 /* Build configuration list for PBXNativeTarget "WordPressDataTests" */; + buildPhases = ( + 3F2AA3E62D81457F002A4E94 /* Sources */, + 3F2AA3E72D81457F002A4E94 /* Frameworks */, + 3F2AA3E82D81457F002A4E94 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3F2AA3ED2D81457F002A4E94 /* PBXTargetDependency */, + ); + fileSystemSynchronizedGroups = ( + 3F2AA3F02D81457F002A4E94 /* WordPressDataTests */, + ); + name = WordPressDataTests; + packageProductDependencies = ( + ); + productName = WordPressDataTests; + productReference = 3F2AA3EA2D81457F002A4E94 /* WordPressDataTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 4AD953B32C21451700D0EEFA /* WordPressAuthenticator */ = { isa = PBXNativeTarget; buildConfigurationList = 4AD953D22C21451800D0EEFA /* Build configuration list for PBXNativeTarget "WordPressAuthenticator" */; @@ -5281,6 +5368,7 @@ 8096219028E55F8600940A5D /* PBXTargetDependency */, 80F6D05F28EE88FC00953C1A /* PBXTargetDependency */, 4AD9555D2C21716A00D0EEFA /* PBXTargetDependency */, + 3FFC8EEF2D818E4D00C2F712 /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( 0C1C18F32D95DA6D00494A8C /* Icons */, @@ -5341,7 +5429,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1540; + LastSwiftUpdateCheck = 1620; LastUpgradeCheck = 1540; ORGANIZATIONNAME = WordPress; TargetAttributes = { @@ -5366,6 +5454,13 @@ }; }; }; + 3F2AA3E22D81457F002A4E94 = { + CreatedOnToolsVersion = 16.2; + LastSwiftMigration = 1620; + }; + 3F2AA3E92D81457F002A4E94 = { + CreatedOnToolsVersion = 16.2; + }; 3F47AC482A7206BE00208F0D = { CreatedOnToolsVersion = 14.3.1; }; @@ -5509,6 +5604,8 @@ 3F47AC482A7206BE00208F0D /* ConfigureSimulatorForUITesting */, 4AD953B32C21451700D0EEFA /* WordPressAuthenticator */, 4AD953BA2C21451700D0EEFA /* WordPressAuthenticatorTests */, + 3F2AA3E22D81457F002A4E94 /* WordPressData */, + 3F2AA3E92D81457F002A4E94 /* WordPressDataTests */, ); }; /* End PBXProject section */ @@ -5548,6 +5645,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3F2AA3E12D81457F002A4E94 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F2AA3E82D81457F002A4E94 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4AD953B22C21451700D0EEFA /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -5675,7 +5786,6 @@ E12BE5EE1C5235DB000FD5CA /* get-me-settings-v1.1.json in Resources */, 933D1F6C1EA7A3AB009FB462 /* TestingMode.storyboard in Resources */, 08F8CD371EBD2AA80049D0C0 /* test-image-device-photo-gps.jpg in Resources */, - 0C7D481A2A4DB9300023CF84 /* blaze-search-response.json in Resources */, D88A64A6208D92B1008AE9BC /* stock-photos-media.json in Resources */, C8567492243F3751001A995E /* tenor-search-response.json in Resources */, 0C9CD7A02B9A6FDC0045BE03 /* remote-post.json in Resources */, @@ -6062,6 +6172,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3F2AA3DF2D81457F002A4E94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F2AA3E62D81457F002A4E94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 4AD953B02C21451700D0EEFA /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -6340,12 +6464,9 @@ 73C8F06621BEF76B00DDDF7E /* SiteAssemblyViewTests.swift in Sources */, 73178C2821BEE09300E37C9A /* SiteCreationDataCoordinatorTests.swift in Sources */, 4A266B8F282B05210089CF3D /* JSONObjectTests.swift in Sources */, - 0C77A5B32CDE7924005BC0DA /* ReaderPostTests.swift in Sources */, D81C2F6020F891C4002AE1F1 /* TrashCommentActionTests.swift in Sources */, FA4ADADA1C509FE400F858D7 /* SiteManagementServiceTests.swift in Sources */, 3F1B66A323A2F54B0075F09E /* ReaderReblogActionTests.swift in Sources */, - FEE48EFF2A4C9855008A48E0 /* Blog+PublicizeTests.swift in Sources */, - 08B6E51C1F037ADD00268F57 /* MediaFileManagerTests.swift in Sources */, 73178C2C21BEE09300E37C9A /* SiteCreationHeaderDataTests.swift in Sources */, 3F28CEAF2A4ACEBE00B79686 /* PrivacySettingsViewControllerTests.swift in Sources */, 08A2AD7B1CCED8E500E84454 /* PostCategoryServiceTests.m in Sources */, @@ -6360,13 +6481,11 @@ 806E53E427E01CFE0064315E /* DashboardStatsViewModelTests.swift in Sources */, D88A649E208D82D2008AE9BC /* XCTestCase+Wait.swift in Sources */, 0C6C4CD82A4F0F2C0049E762 /* Bundle+TestExtensions.swift in Sources */, - C38C5D8127F61D2C002F517E /* MenuItemTests.swift in Sources */, 3FB6D13D2AD0F67300768C07 /* CachedAnnouncementsStoreTests.swift in Sources */, E18549DB230FBFEF003C620E /* BlogServiceDeduplicationTests.swift in Sources */, 0148CC292859127F00CF5D96 /* StatsWidgetsStoreTests.swift in Sources */, 7320C8BD2190C9FC0082FED5 /* UITextView+SummaryTests.swift in Sources */, 0CA15B4E2BB2128800518D6E /* PostCoordinatorTests.swift in Sources */, - 24A2948325D602710000A51E /* BlogTimeZoneTests.m in Sources */, 80B016CF27FEBDC900D15566 /* DashboardCardTests.swift in Sources */, 7E53AB0420FE6681005796FE /* ActivityContentRouterTests.swift in Sources */, F11023A323186BCA00C4E84A /* MediaBuilder.swift in Sources */, @@ -6381,15 +6500,12 @@ 08AA640E2A8540590076E38D /* MockEventTracker.swift in Sources */, F4426FD9287F02FD00218003 /* SiteSuggestionsServiceMock.swift in Sources */, DC3B9B2F27739887003F7249 /* TimeZoneSelectorViewModelTests.swift in Sources */, - E6A215901D1065F200DE5270 /* AbstractPostTest.swift in Sources */, 3FB6D13F2AD2AC5A00768C07 /* Announcement+Fixture.swift in Sources */, D8BA274D20FDEA2E007A5C77 /* NotificationTextContentTests.swift in Sources */, 2481B1D5260D4E8B00AE59DB /* AccountBuilder.swift in Sources */, E66969C81B9E0A6800EC9C00 /* ReaderTopicServiceTest.swift in Sources */, - 2422A2C02C5846DB00402A81 /* Blog+RestAPITests.swift in Sources */, E1EBC3731C118ED200F638E0 /* ImmuTableTest.swift in Sources */, F5C00EAE242179780047846F /* WeekdaysHeaderViewTests.swift in Sources */, - 24C69AC22612467C00312D9A /* UserSettingsTestsObjc.m in Sources */, 088CAD4E2BBD8223005996DE /* BlogListViewModelTests.swift in Sources */, E1AB5A091E0BF31E00574B4E /* ArrayTests.swift in Sources */, C8567496243F3D37001A995E /* TenorResultsPageTests.swift in Sources */, @@ -6408,7 +6524,6 @@ 803DE81F290636A4007D4E9C /* JetpackFeaturesRemovalCoordinatorTests.swift in Sources */, 937250EE267A492D0086075F /* StatsPeriodStoreTests.swift in Sources */, 801D951D291ADB7E0051993E /* OverlayFrequencyTrackerTests.swift in Sources */, - F1B1E7A324098FA100549E2A /* BlogTests.swift in Sources */, 57889AB823589DF100DAE56D /* PageBuilder.swift in Sources */, 3FDDFE9627C8178C00606933 /* SiteStatsInformationTests.swift in Sources */, 74B335EC1F06F9520053A184 /* MockWordPressComRestApi.swift in Sources */, @@ -6422,7 +6537,6 @@ F151EC832665271200AEA89E /* BloggingRemindersSchedulerTests.swift in Sources */, D81C2F6620F8ACCD002AE1F1 /* FormattableContentFormatterTests.swift in Sources */, 08AA640C2A8511FB0076E38D /* DashboardGoogleDomainsViewModelTests.swift in Sources */, - 83EF3D7F2937F08C000AF9BF /* SharedDataIssueSolverTests.swift in Sources */, 4A5EDD812CE58B9900A605FC /* ZendeskUtilsTests+A8CEmail.swift in Sources */, 8070EB3E28D807CB005C6513 /* InMemoryUserDefaults.swift in Sources */, F93735F822D53C3B00A3C312 /* LoggingURLRedactorTests.swift in Sources */, @@ -6435,7 +6549,6 @@ C3C2F84628AC8BC700937E45 /* JetpackBannerScrollVisibilityTests.swift in Sources */, D8B6BEB7203E11F2007C8A19 /* Bundle+LoadFromNib.swift in Sources */, 8B2D4F5527ECE376009B085C /* BlogDashboardPostsParserTests.swift in Sources */, - 4A266B91282B13A70089CF3D /* CoreDataTestCase.swift in Sources */, 24B1AE3124FEC79900B9F334 /* RemoteFeatureFlagTests.swift in Sources */, E135965D1E7152D1006C6606 /* RecentSitesServiceTests.swift in Sources */, F4D7FD6C2A57030E00642E06 /* CompliancePopoverViewControllerTests.swift in Sources */, @@ -6448,9 +6561,7 @@ E157D5E01C690A6C00F04FB9 /* ImmuTableTestUtils.swift in Sources */, C81CCD86243C00E000A83E27 /* TenorPageableTests.swift in Sources */, 46F58501262605930010A723 /* BlockEditorSettingsServiceTests.swift in Sources */, - 8BBBEBB224B8F8C0005E358E /* ReaderCardTests.swift in Sources */, D81C2F5E20F88CE5002AE1F1 /* MarkAsSpamActionTests.swift in Sources */, - D848CC1520FF33FC00A9038F /* NotificationContentRangeTests.swift in Sources */, 084FC3B729913B1B00A17BCF /* JetpackPluginOverlayViewModelTests.swift in Sources */, 7E987F58210811CC00CAFB88 /* NotificationContentRouterTests.swift in Sources */, E1C9AA561C10427100732665 /* MathTest.swift in Sources */, @@ -6477,7 +6588,6 @@ 01B7590E2B3EEEA400179AE6 /* SiteDomainsViewModelTests.swift in Sources */, FEFC0F8C273131A6001F7F1D /* CommentService+RepliesTests.swift in Sources */, 40E4698F2017E0700030DB5F /* PluginDirectoryEntryStateTests.swift in Sources */, - 8BC6020D2390412000EFE3D0 /* NullBlogPropertySanitizerTests.swift in Sources */, 57B71D4E230DB5F200789A68 /* BlogBuilder.swift in Sources */, F406F3ED2B55960700AFC04A /* CompliancePopoverCoordinatorTests.swift in Sources */, D848CC1920FF3A2400A9038F /* FormattableNotIconTests.swift in Sources */, @@ -6492,13 +6602,10 @@ 3F4A4C212AD39CB100DE5DF8 /* TruthTable.swift in Sources */, FF2EC3C22209AC19006176E1 /* GutenbergImgUploadProcessorTests.swift in Sources */, D81C2F5A20F86E94002AE1F1 /* LikeCommentActionTests.swift in Sources */, - 8B8C814D2318073300A0E620 /* BasePostTests.swift in Sources */, F1F083F6241FFE930056D3B1 /* AtomicAuthenticationServiceTests.swift in Sources */, C373D6EA280452F6008F8C26 /* SiteIntentDataTests.swift in Sources */, 8B69F100255C4870006B1CEF /* ActivityStoreTests.swift in Sources */, 4A5598852B05AC180083C220 /* PagesListTests.swift in Sources */, - 2481B20C260D8FED00AE59DB /* WPAccount+ObjCLookupTests.m in Sources */, - FEFA6AC82A88D5FC004EE5E6 /* Post+JetpackSocialTests.swift in Sources */, 40ACCF14224E167900190713 /* FlagsTest.swift in Sources */, E15027651E03E54100B847E3 /* PinghubTests.swift in Sources */, E1B642131EFA5113001DC6D7 /* ModelTestHelper.swift in Sources */, @@ -6545,14 +6652,10 @@ 8BDA5A74247C5EAA00AB124C /* ReaderDetailCoordinatorTests.swift in Sources */, 74585B991F0D58F300E7E667 /* DomainsServiceTests.swift in Sources */, D88A64B0208DA093008AE9BC /* StockPhotosResultsPageTests.swift in Sources */, - 0879FC161E9301DD00E1EFC8 /* MediaTests.swift in Sources */, B556EFCB1DCA374200728F93 /* DictionaryHelpersTests.swift in Sources */, DC06DFF927BD52BE00969974 /* WeeklyRoundupBackgroundTaskTests.swift in Sources */, - 24C69A8B2612421900312D9A /* UserSettingsTests.swift in Sources */, DC13DB7E293FD09F00E33561 /* StatsInsightsStoreTests.swift in Sources */, 0C9CD79D2B9A6ABF0045BE03 /* PostRepositorySaveTests.swift in Sources */, - 4A2C73E42A943DEA00ACE79E /* TaggedManagedObjectIDTests.swift in Sources */, - 0CF7D6C32ABB753A006D1E89 /* MediaImageServiceTests.swift in Sources */, 8BFE36FF230F1C850061EBA8 /* AbstractPost+fixLocalMediaURLsTests.swift in Sources */, 08A2AD791CCED2A800E84454 /* PostTagServiceTests.m in Sources */, 019C5B972BD6A49900A69DB0 /* StatsSubscribersViewModelTests.swift in Sources */, @@ -6560,12 +6663,9 @@ 3FE6D31E2B0705D400D14923 /* JetpackBrandingVisibilityTests.swift in Sources */, 027AC5212278983F0033E56E /* DomainCreditEligibilityTests.swift in Sources */, F551E7F723FC9A5C00751212 /* Collection+RotateTests.swift in Sources */, - 2481B1E8260D4EAC00AE59DB /* WPAccount+LookupTests.swift in Sources */, E10F3DA11E5C2CE0008FAADA /* PostListFilterTests.swift in Sources */, DCF892D0282FA42A00BB71E1 /* SiteStatsImmuTableRowsTests.swift in Sources */, - 93EF094C19ED533500C89770 /* ContextManagerTests.swift in Sources */, F17A2A2023BFBD84001E96AC /* UIView+ExistingConstraints.swift in Sources */, - 3F759FBA2A2DA93B0039A845 /* WPAccount+Fixture.swift in Sources */, 77A141172B68546100BF75DD /* BooleanUserDefaultsDebugViewModelTests.swift in Sources */, 73178C3521BEE9AC00E37C9A /* TitleSubtitleHeaderTests.swift in Sources */, 08AAD6A11CBEA610002B2418 /* MenusServiceTests.m in Sources */, @@ -6575,7 +6675,6 @@ 1D91080729F847A2003F9A5E /* MediaServiceUpdateTests.m in Sources */, C81CCD6C243AEFBF00A83E27 /* TenorReponseData.swift in Sources */, 805CC0BF29668A97002941DC /* MockCurrentDateProvider.swift in Sources */, - 570BFD902282418A007859A8 /* PostBuilder.swift in Sources */, C738CB0F28626466001BE107 /* QRLoginScanningCoordinatorTests.swift in Sources */, 3F86A83729D19C15005D20C0 /* SignupEpilogueTableViewControllerTests.swift in Sources */, 010459ED2915519C000C7778 /* JetpackNotificationMigrationServiceTests.swift in Sources */, @@ -6615,8 +6714,6 @@ 73178C3321BEE94700E37C9A /* SiteAssemblyServiceTests.swift in Sources */, D88A6492208D7A0A008AE9BC /* MockStockPhotosService.swift in Sources */, F5D0A65223CCD3B600B20D27 /* PreviewWebKitViewControllerTests.swift in Sources */, - B5ECA6CD1DBAAD510062D7E0 /* CoreDataHelperTests.swift in Sources */, - 931D270019EDAE8600114F17 /* CoreDataMigrationTests.m in Sources */, 80EF9284280CFEB60064A971 /* DashboardPostsSyncManagerTests.swift in Sources */, 7EC9FE0B22C627DB00C5A888 /* PostEditorAnalyticsSessionTests.swift in Sources */, 4AEF2DD929A84B2C00345734 /* ReaderSiteServiceTests.swift in Sources */, @@ -6629,7 +6726,6 @@ F4D9AF53288AE2BA00803D40 /* SuggestionsTableViewDelegateMock.swift in Sources */, B532ACD31DC3AE1200FFFA57 /* OHHTTPStubs+Helpers.swift in Sources */, E11DF3E420C97F0A00C0B07C /* NotificationCenterObserveOnceTests.swift in Sources */, - 5960967F1CF7959300848496 /* PostTests.swift in Sources */, 4AFB8FBF2824999500A2F4B2 /* ContextManager+Helpers.swift in Sources */, 3F751D462491A93D0008A2B1 /* ZendeskUtilsTests+Plans.swift in Sources */, F44FB6CB287895AF0001E3CE /* SuggestionsListViewModelTests.swift in Sources */, @@ -6643,9 +6739,6 @@ 3F56F55C2AEA2F67006BDCEA /* ReaderPostBuilder.swift in Sources */, D81C2F5C20F872C2002AE1F1 /* ReplyToCommentActionTests.swift in Sources */, 08C42C31281807880034720B /* ReaderSubscribeCommentsActionTests.swift in Sources */, - D848CC1720FF38EA00A9038F /* FormattableCommentRangeTests.swift in Sources */, - 246D0A0325E97D5D0028B83F /* Blog+ObjcTests.m in Sources */, - 4AD5657228E543A30054C676 /* BlogQueryTests.swift in Sources */, 9A9D34FF2360A4E200BC95A3 /* StatsPeriodAsyncOperationTests.swift in Sources */, 8BE9AB8827B6B5A300708E45 /* BlogDashboardPersistenceTests.swift in Sources */, B5EFB1C91B333C5A007608A3 /* NotificationSettingsServiceTests.swift in Sources */, @@ -6694,7 +6787,6 @@ D81C2F6A20F8B449002AE1F1 /* NotificationActionParserTest.swift in Sources */, F15D1FBA265C41A900854EE5 /* BloggingRemindersStoreTests.swift in Sources */, D88A64A2208D8F05008AE9BC /* StockPhotosMediaTests.swift in Sources */, - B55F1AA21C107CE200FD04D4 /* BlogSettingsDiscussionTests.swift in Sources */, 4AD8DCB02CC6505E0058DE55 /* WordPressDotComAuthenticatorTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -6785,6 +6877,16 @@ target = 0107E13828FE9DB200DE87DB /* JetpackIntents */; targetProxy = 0107E15628FEA03800DE87DB /* PBXContainerItemProxy */; }; + 3F2AA3ED2D81457F002A4E94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F2AA3E22D81457F002A4E94 /* WordPressData */; + targetProxy = 3F2AA3EC2D81457F002A4E94 /* PBXContainerItemProxy */; + }; + 3F2AA3F52D81457F002A4E94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F2AA3E22D81457F002A4E94 /* WordPressData */; + targetProxy = 3F2AA3F42D81457F002A4E94 /* PBXContainerItemProxy */; + }; 3F47AC502A72074300208F0D /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 3F47AC482A7206BE00208F0D /* ConfigureSimulatorForUITesting */; @@ -6805,6 +6907,11 @@ target = FFA8E22A1F94E3DE0002170F /* SwiftLint */; targetProxy = 3FCFFAFF2994AB25002840C9 /* PBXContainerItemProxy */; }; + 3FFC8EEF2D818E4D00C2F712 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3F2AA3E22D81457F002A4E94 /* WordPressData */; + targetProxy = 3FFC8EEE2D818E4D00C2F712 /* PBXContainerItemProxy */; + }; 4AD953BE2C21451700D0EEFA /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4AD953B32C21451700D0EEFA /* WordPressAuthenticator */; @@ -7417,6 +7524,295 @@ }; name = Release; }; + 3F2AA3F82D81457F002A4E94 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3F9DD3F62CC214BF00DF1760 /* Common.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WordPressData/WordPressDataPrefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 WordPress. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressData; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3F2AA3F92D81457F002A4E94 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0C96AC202D92FC17000779B8 /* Common.release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "Apple Distribution: Automattic, Inc. (PZYM8XX95Q)"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WordPressData/WordPressDataPrefix.pch; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 WordPress. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressData; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 3F2AA3FA2D81457F002A4E94 /* Release-Alpha */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3F9DD3F72CC2188400DF1760 /* Common.alpha.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "iPhone Distribution: Automattic, Inc."; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = WordPressData/WordPressDataPrefix.pch; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 WordPress. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressData; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = "Release-Alpha"; + }; + 3F2AA3FB2D81457F002A4E94 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3F9DD3F62CC214BF00DF1760 /* Common.debug.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressDataTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3F2AA3FC2D81457F002A4E94 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 0C96AC202D92FC17000779B8 /* Common.release.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressDataTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 3F2AA3FD2D81457F002A4E94 /* Release-Alpha */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3F9DD3F72CC2188400DF1760 /* Common.alpha.xcconfig */; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.automattic.WordPressDataTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = "Release-Alpha"; + }; 3F47AC492A7206C000208F0D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -8539,7 +8935,6 @@ "-lxml2", "-licucore", ); - PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -8853,7 +9248,6 @@ "-lxml2", "-licucore", ); - PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; @@ -8905,7 +9299,6 @@ "-lxml2", "-licucore", ); - PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -9609,6 +10002,26 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 3F2AA3FE2D81457F002A4E94 /* Build configuration list for PBXNativeTarget "WordPressData" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F2AA3F82D81457F002A4E94 /* Debug */, + 3F2AA3F92D81457F002A4E94 /* Release */, + 3F2AA3FA2D81457F002A4E94 /* Release-Alpha */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3F2AA4002D81457F002A4E94 /* Build configuration list for PBXNativeTarget "WordPressDataTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3F2AA3FB2D81457F002A4E94 /* Debug */, + 3F2AA3FC2D81457F002A4E94 /* Release */, + 3F2AA3FD2D81457F002A4E94 /* Release-Alpha */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 3F47AC4D2A7206C000208F0D /* Build configuration list for PBXAggregateTarget "ConfigureSimulatorForUITesting" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -9849,6 +10262,10 @@ isa = XCSwiftPackageProductDependency; productName = XcodeTarget_WordPressAuthentificatorTests; }; + 3FFCBCE02D814EEC00C2F712 /* XcodeTarget_WordPressData */ = { + isa = XCSwiftPackageProductDependency; + productName = XcodeTarget_WordPressData; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; diff --git a/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPress.xcscheme b/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPress.xcscheme index b788ce676be2..e8aa5b14c46a 100644 --- a/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPress.xcscheme +++ b/WordPress/WordPress.xcodeproj/xcshareddata/xcschemes/WordPress.xcscheme @@ -78,6 +78,17 @@ ReferencedContainer = "container:WordPress.xcodeproj"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WordPress/Classes/Models/AbstractPost.m b/WordPress/WordPressData/Objective-C/AbstractPost.m similarity index 78% rename from WordPress/Classes/Models/AbstractPost.m rename to WordPress/WordPressData/Objective-C/AbstractPost.m index 55d68a55515b..13393e315adf 100644 --- a/WordPress/Classes/Models/AbstractPost.m +++ b/WordPress/WordPressData/Objective-C/AbstractPost.m @@ -1,9 +1,8 @@ #import "AbstractPost.h" #import "Media.h" -@import WordPressDataObjC; -#import "WordPress-Swift.h" +// FIXME: Why is the module header not generated? +//#import "WordPressData-Swift.h" #import "BasePost.h" - @import WordPressKit; @import WordPressShared; @@ -29,7 +28,8 @@ @implementation AbstractPost - (void)save { - [[ContextManager sharedInstance] saveContext:self.managedObjectContext]; + // FIXME: Disabled to experiment with a compilation error +// [[ContextManager sharedInstance] saveContext:self.managedObjectContext]; } @@ -85,7 +85,8 @@ - (AbstractPost *)createRevision AbstractPost *post = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass(self.class) inManagedObjectContext:self.managedObjectContext]; [post cloneFrom:self]; - post.remoteStatus = AbstractPostRemoteStatusLocalRevision; + // FIXME: Disabled to experiment with a compilation error +// post.remoteStatus = AbstractPostRemoteStatusLocalRevision; [post setValue:self forKey:@"original"]; [post setValue:nil forKey:@"revision"]; return post; @@ -237,26 +238,33 @@ - (BOOL)hasRemote // If the post has a scheduled status. - (BOOL)isScheduled { - return ([self.status isEqualToString:PostStatusScheduled]); + // FIXME: Disabled to experiment with a compilation error +// return ([self.status isEqualToString:PostStatusScheduled]); + return NO; } - (BOOL)isDraft { - return [self.status isEqualToString:PostStatusDraft]; + // FIXME: Disabled to experiment with a compilation error +// return [self.status isEqualToString:PostStatusDraft]; + return NO; } - (BOOL)isPublished { - return [self.status isEqualToString:PostStatusPublish]; + // FIXME: Disabled to experiment with a compilation error +// return [self.status isEqualToString:PostStatusPublish]; + return NO; } - (BOOL)originalIsDraft { - if ([self.status isEqualToString:PostStatusDraft]) { - return YES; - } else if (self.isRevision && [self.original.status isEqualToString:PostStatusDraft]) { - return YES; - } + // FIXME: Disabled to experiment with a compilation error +// if ([self.status isEqualToString:PostStatusDraft]) { +// return YES; +// } else if (self.isRevision && [self.original.status isEqualToString:PostStatusDraft]) { +// return YES; +// } return NO; } @@ -280,7 +288,9 @@ - (NSURL *)avatarURLForDisplay - (NSString *)blogNameForDisplay { - return [self.blog.settings.name makePlainText]; + // FIXME: Disabled to experiment with a compilation error +// return [self.blog.settings.name makePlainText]; + return NO; } - (NSURL *)blogURL @@ -305,14 +315,16 @@ - (NSString *)contentPreviewForDisplay - (NSString *)dateStringForDisplay { - if ([self originalIsDraft] || [self.status isEqualToString:PostStatusPending]) { - return [[self dateModified] mediumString]; - } else if ([self isScheduled]) { - return [[self dateCreated] mediumStringWithTime]; - } else if ([self shouldPublishImmediately]) { - return NSLocalizedString(@"Publish Immediately",@"A short phrase indicating a post is due to be immedately published."); - } - return [[self dateCreated] mediumString]; + // FIXME: Disabled to experiment with a compilation error +// if ([self originalIsDraft] || [self.status isEqualToString:PostStatusPending]) { +// return [[self dateModified] mediumString]; +// } else if ([self isScheduled]) { +// return [[self dateCreated] mediumStringWithTime]; +// } else if ([self shouldPublishImmediately]) { +// return NSLocalizedString(@"Publish Immediately",@"A short phrase indicating a post is due to be immedately published."); +// } +// return [[self dateCreated] mediumString]; + return @"TODO"; } - (BOOL)isPrivateAtWPCom @@ -327,7 +339,9 @@ - (BOOL)isMultiAuthorBlog - (BOOL)isUploading { - return self.remoteStatus == AbstractPostRemoteStatusPushing; + // FIXME: Disabled to experiment with a compilation error +// return self.remoteStatus == AbstractPostRemoteStatusPushing; + return NO; } #pragma mark - Post diff --git a/WordPress/Classes/Models/BasePost.m b/WordPress/WordPressData/Objective-C/BasePost.m similarity index 98% rename from WordPress/Classes/Models/BasePost.m rename to WordPress/WordPressData/Objective-C/BasePost.m index 26bc21d8d08b..38c0d187aee9 100644 --- a/WordPress/Classes/Models/BasePost.m +++ b/WordPress/WordPressData/Objective-C/BasePost.m @@ -1,7 +1,6 @@ #import "BasePost.h" #import "Media.h" -@import WordPressDataObjC; - +@import WordPressData; @import WordPressShared; @implementation BasePost diff --git a/WordPress/Classes/Models/Blog/Blog.m b/WordPress/WordPressData/Objective-C/Blog.m similarity index 66% rename from WordPress/Classes/Models/Blog/Blog.m rename to WordPress/WordPressData/Objective-C/Blog.m index 06368c0280a7..4864f5dd61eb 100644 --- a/WordPress/Classes/Models/Blog/Blog.m +++ b/WordPress/WordPressData/Objective-C/Blog.m @@ -1,9 +1,10 @@ -#import "Blog.h" +#import #import "WPAccount.h" #import "AccountService.h" -@import WordPressDataObjC; +// FIXME: Having issues with CocoaLumberjack as a transitive dependency when added to Objective-C files +//@import CocoaLumberjack; +@import WordPressKit; @import WordPressShared; -#import "WordPress-Swift.h" @import SFHFKeychainUtils; @import NSObject_SafeExpectations; @@ -97,17 +98,6 @@ @implementation Blog #pragma mark - NSManagedObject subclass methods -- (void)willSave { - [super willSave]; - - // The `dotComID` getter has a speicial code to _update_ `blogID` value. - // This is a weird patch to make sure `blogID` is set to a correct value. - // - // It's important that calling `[self dotComID]` repeatedly only updates - // `Blog` instance once, which is the case at the moment. - [self dotComID]; -} - - (void)prepareForDeletion { [super prepareForDeletion]; @@ -118,7 +108,8 @@ - (void)prepareForDeletion } if (self.account == nil) { - [self deleteApplicationToken]; + // FIXME: Disabled to experiment with a compilation error +// [self deleteApplicationToken]; } [_xmlrpcApi invalidateAndCancelTasks]; @@ -151,7 +142,7 @@ - (void)didTurnIntoFault - (NSNumber *)organizationID { NSNumber *organizationID = [self primitiveValueForKey:@"organizationID"]; - + if (organizationID == nil) { return @0; } else { @@ -184,7 +175,7 @@ - (NSString *)displayURL DDLogInfo(@"Blog display URL is nil"); return nil; } - + NSError *error = nil; NSRegularExpression *protocol = [NSRegularExpression regularExpressionWithPattern:@"http(s?)://" options:NSRegularExpressionCaseInsensitive error:&error]; NSString *result = [NSString stringWithFormat:@"%@", [protocol stringByReplacingMatchesInString:self.url options:0 range:NSMakeRange(0, [self.url length]) withTemplate:@""]]; @@ -302,7 +293,7 @@ - (NSArray *)sortedPostFormats } - (NSArray *)sortedPostFormatNames -{ +{ return [[self sortedPostFormats] wp_map:^id(NSString *key) { return self.postFormats[key]; }]; @@ -327,7 +318,9 @@ - (NSArray *)sortedConnections - (NSString *)defaultPostFormatText { - return [self postFormatTextFromSlug:self.settings.defaultPostFormat]; + // FIXME: Disabled to experiment with a compilation error +// return [self postFormatTextFromSlug:self.settings.defaultPostFormat]; + return @"TODO"; } - (BOOL)hasMappedDomain { @@ -396,7 +389,9 @@ - (NSString *)postFormatTextFromSlug:(NSString *)postFormatSlug /// - (BOOL)isPrivate { - return [self.settings.privacy isEqualToNumber:@(SiteVisibilityPrivate)]; + // FIXME: Disabled to experiment with a compilation error +// return [self.settings.privacy isEqualToNumber:@(SiteVisibilityPrivate)]; + return YES; } /// Call this method to know whether the blog is private AND hosted at WP.com. @@ -406,42 +401,6 @@ - (BOOL)isPrivateAtWPCom return (self.isHostedAtWPcom && [self isPrivate]); } -- (SiteVisibility)siteVisibility -{ - switch ([self.settings.privacy integerValue]) { - case (SiteVisibilityHidden): - return SiteVisibilityHidden; - break; - case (SiteVisibilityPublic): - return SiteVisibilityPublic; - break; - case (SiteVisibilityPrivate): - return SiteVisibilityPrivate; - break; - default: - break; - } - return SiteVisibilityUnknown; -} - -- (void)setSiteVisibility:(SiteVisibility)siteVisibility -{ - switch (siteVisibility) { - case (SiteVisibilityHidden): - self.settings.privacy = @(SiteVisibilityHidden); - break; - case (SiteVisibilityPublic): - self.settings.privacy = @(SiteVisibilityPublic); - break; - case (SiteVisibilityPrivate): - self.settings.privacy = @(SiteVisibilityPrivate); - break; - default: - NSParameterAssert(siteVisibility >= SiteVisibilityPrivate && siteVisibility <= SiteVisibilityPublic); - break; - } -} - - (NSDictionary *)getImageResizeDimensions { CGSize smallSize, mediumSize, largeSize; @@ -546,190 +505,16 @@ - (BOOL)supportsFeaturedImages return NO; } -- (BOOL)supports:(BlogFeature)feature -{ - switch (feature) { - case BlogFeatureRemovable: - return ![self accountIsDefaultAccount]; - case BlogFeatureVisibility: - /* - See -[BlogListViewController fetchRequestPredicateForHideableBlogs] - If the logic for this changes that needs to be updated as well - */ - return [self accountIsDefaultAccount]; - case BlogFeaturePeople: - return [self supportsRestApi] && self.isListingUsersAllowed; - case BlogFeatureWPComRESTAPI: - case BlogFeatureCommentLikes: - return [self supportsRestApi]; - case BlogFeatureStats: - return [self supportsRestApi] && [self isViewingStatsAllowed]; - case BlogFeatureStockPhotos: - return [self supportsRestApi] && [JetpackFeaturesRemovalCoordinator jetpackFeaturesEnabled]; - case BlogFeatureTenor: - return [JetpackFeaturesRemovalCoordinator jetpackFeaturesEnabled]; - case BlogFeatureSharing: - return [self supportsSharing]; - case BlogFeatureOAuth2Login: - return [self isHostedAtWPcom]; - case BlogFeatureMentions: - return [self isAccessibleThroughWPCom]; - case BlogFeatureXposts: - return [self isAccessibleThroughWPCom]; - case BlogFeatureReblog: - case BlogFeaturePlans: - return [self isHostedAtWPcom] && [self isAdmin]; - case BlogFeaturePluginManagement: - return [self supportsPluginManagement] && [self isAdmin]; - case BlogFeatureJetpackImageSettings: - return [self supportsJetpackImageSettings]; - case BlogFeatureJetpackSettings: - return [self supportsJetpackSettings]; - case BlogFeaturePushNotifications: - return [self supportsPushNotifications]; - case BlogFeatureThemeBrowsing: - return [self supportsRestApi] && [self isAdmin]; - case BlogFeatureActivity: { - // For now Activity is suported for admin users - return [self supportsRestApi] && [self isAdmin]; - } - case BlogFeatureCustomThemes: - return [self supportsRestApi] && [self isAdmin] && ![self isHostedAtWPcom]; - case BlogFeaturePremiumThemes: - return [self supports:BlogFeatureCustomThemes] && (self.planID.integerValue == JetpackProfessionalYearlyPlanId - || self.planID.integerValue == JetpackProfessionalMonthlyPlanId); - case BlogFeatureMenus: - return [self supportsRestApi] && [self isAdmin]; - case BlogFeaturePrivate: - // Private visibility is only supported by wpcom blogs - return [self isHostedAtWPcom]; - case BlogFeatureSiteManagement: - return [self supportsSiteManagementServices]; - case BlogFeatureDomains: - return ([self isHostedAtWPcom] || [self isAtomic]) && [self isAdmin] && ![self isWPForTeams]; - case BlogFeatureNoncePreviews: - return [self supportsRestApi] && ![self isHostedAtWPcom]; - case BlogFeatureMediaMetadataEditing: - return [self isAdmin]; - case BlogFeatureMediaAltEditing: - // alt is not supported via XML-RPC API - // https://core.trac.wordpress.org/ticket/58582 - // https://github.com/wordpress-mobile/WordPress-Android/issues/18514#issuecomment-1589752274 - return [self supportsRestApi]; - case BlogFeatureMediaDeletion: - return [self isAdmin]; - case BlogFeatureHomepageSettings: - return [self supportsRestApi] && [self isAdmin]; - case BlogFeatureContactInfo: - return [self supportsContactInfo]; - case BlogFeatureBlockEditorSettings: - return [self supportsBlockEditorSettings]; - case BlogFeatureLayoutGrid: - return [self supportsLayoutGrid]; - case BlogFeatureTiledGallery: - return [self supportsTiledGallery]; - case BlogFeatureVideoPress: - return [self supportsVideoPress]; - case BlogFeatureVideoPressV5: - return [self supportsVideoPressV5]; - case BlogFeatureFacebookEmbed: - return [self supportsEmbedVariation: @"9.0"]; - case BlogFeatureInstagramEmbed: - return [self supportsEmbedVariation: @"9.0"]; - case BlogFeatureLoomEmbed: - return [self supportsEmbedVariation: @"9.0"]; - case BlogFeatureSmartframeEmbed: - return [self supportsEmbedVariation: @"10.2"]; - case BlogFeatureFileDownloadsStats: - return [self isHostedAtWPcom]; - case BlogFeatureBlaze: - return [self canBlaze]; - case BlogFeaturePages: - return [self isListingPagesAllowed]; - case BlogFeatureSiteMonitoring: - return [self isAdmin] && [self isAtomic]; - } -} - --(BOOL)supportsSharing -{ - return [self supportsPublicize] || [self supportsShareButtons]; -} - -- (BOOL)supportsPublicize -{ - // Publicize is only supported via REST - if (![self supports:BlogFeatureWPComRESTAPI]) { - return NO; - } - - if (![self isPublishingPostsAllowed]) { - return NO; - } - - if (self.isHostedAtWPcom) { - // For WordPress.com YES unless it's disabled - return ![[self getOptionValue:OptionsKeyPublicizeDisabled] boolValue]; - - } else { - // For Jetpack, check if the module is enabled - return [self jetpackPublicizeModuleEnabled]; - } -} - -- (BOOL)supportsShareButtons -{ - // Share Button settings are only supported via REST, and for admins - if (![self isAdmin] || ![self supports:BlogFeatureWPComRESTAPI]) { - return NO; - } - - if (self.isHostedAtWPcom) { - // For WordPress.com YES - return YES; - - } else { - // For Jetpack, check if the module is enabled - return [self jetpackSharingButtonsModuleEnabled]; - } -} - - (BOOL)isStatsActive { return [self jetpackStatsModuleEnabled] || [self isHostedAtWPcom]; } -- (BOOL)supportsPushNotifications -{ - return [self accountIsDefaultAccount]; -} - - (BOOL)supportsJetpackImageSettings { return [self hasRequiredJetpackVersion:@"5.6"]; } -- (BOOL)supportsPluginManagement -{ - BOOL hasRequiredJetpack = [self hasRequiredJetpackVersion:@"5.6"]; - - BOOL isTransferrable = self.isHostedAtWPcom - && self.hasBusinessPlan - && self.siteVisibility != SiteVisibilityPrivate; - - BOOL supports = isTransferrable || hasRequiredJetpack; - - // If the site is not hosted on WP.com we can still manage plugins directly using the WP.org rest API - // Reference: https://make.wordpress.org/core/2020/07/16/new-and-modified-rest-api-endpoints-in-wordpress-5-5/ - if(!supports && !self.account){ - supports = !self.isHostedAtWPcom - && self.selfHostedSiteRestApi - && [self hasRequiredWordPressVersion:@"5.5"]; - } - - return supports; -} - - (BOOL)supportsContactInfo { return [self hasRequiredJetpackVersion:@"8.5"] || self.isHostedAtWPcom; @@ -745,16 +530,6 @@ - (BOOL)supportsTiledGallery return self.isHostedAtWPcom; } -- (BOOL)supportsVideoPress -{ - return self.isHostedAtWPcom; -} - -- (BOOL)supportsVideoPressV5 -{ - return self.isHostedAtWPcom || self.isAtomic || [self hasRequiredJetpackVersion:@"8.5"]; -} - - (BOOL)supportsEmbedVariation:(NSString *)requiredJetpackVersion { return [self hasRequiredJetpackVersion:requiredJetpackVersion] || self.isHostedAtWPcom; @@ -762,45 +537,21 @@ - (BOOL)supportsEmbedVariation:(NSString *)requiredJetpackVersion - (BOOL)supportsJetpackSettings { - return [JetpackFeaturesRemovalCoordinator jetpackFeaturesEnabled] + // FIXME: Disabled to experiment with a compilation error +// return [JetpackFeaturesRemovalCoordinator jetpackFeaturesEnabled] + return YES && [self supportsRestApi] && ![self isHostedAtWPcom] && [self isAdmin]; } -- (BOOL)accountIsDefaultAccount -{ - return [[self account] isDefaultWordPressComAccount]; -} - -- (NSNumber *)dotComID -{ - [self willAccessValueForKey:@"blogID"]; - NSNumber *dotComID = [self primitiveValueForKey:@"blogID"]; - if (dotComID.integerValue == 0) { - dotComID = self.jetpack.siteID; - if (dotComID.integerValue > 0) { - self.dotComID = dotComID; - } - } - [self didAccessValueForKey:@"blogID"]; - return dotComID; -} - -- (void)setDotComID:(NSNumber *)dotComID -{ - [self willChangeValueForKey:@"blogID"]; - [self setPrimitiveValue:dotComID forKey:@"blogID"]; - [self didChangeValueForKey:@"blogID"]; -} - - (NSSet *)allowedFileTypes { NSArray *allowedFileTypes = [self.options arrayForKeyPath:@"allowed_file_types.value"]; if (!allowedFileTypes || allowedFileTypes.count == 0) { return nil; } - + return [NSSet setWithArray:allowedFileTypes]; } @@ -811,19 +562,21 @@ + (NSSet *)keyPathsForValuesAffectingJetpack - (NSString *)logDescription { - NSString *extra = @""; - if (self.account) { - extra = [NSString stringWithFormat:@" wp.com account: %@ blogId: %@ plan: %@ (%@)", self.account ? self.account.username : @"NO", self.dotComID, self.planTitle, self.planID]; - } else { - extra = [NSString stringWithFormat:@" jetpack: %@", [self.jetpack description]]; - } - return [NSString stringWithFormat:@"", self.settings.name, self.url, self.xmlrpc, extra, self.objectID.URIRepresentation]; + // FIXME: Disabled to experiment with a compilation error +// NSString *extra = @""; +// if (self.account) { +// extra = [NSString stringWithFormat:@" wp.com account: %@ blogId: %@ plan: %@ (%@)", self.account ? self.account.username : @"NO", self.dotComID, self.planTitle, self.planID]; +// } else { +// extra = [NSString stringWithFormat:@" jetpack: %@", [self.jetpack description]]; +// } +// return [NSString stringWithFormat:@"", self.settings.name, self.url, self.xmlrpc, extra, self.objectID.URIRepresentation]; + return @"TODO"; } - (NSString *)supportDescription { // Gather information - + NSString *blogType = [NSString stringWithFormat:@"Type: (%@)", [self stateDescription]]; NSString *urlType = [self wordPressComRestApi] ? @"REST" : @"Self-hosted"; NSString *url = [NSString stringWithFormat:@"URL: %@", self.url]; @@ -833,16 +586,18 @@ - (NSString *)supportDescription if (self.account) { planDescription = [NSString stringWithFormat:@"Plan: %@ (%@)", self.planTitle, self.planID]; } else { - username = [self.jetpack connectedUsername]; + // FIXME: Disabled to experiment with a compilation error +// username = [self.jetpack connectedUsername]; } - + NSString *jetpackVersion; - if ([self.jetpack isInstalled]) { - jetpackVersion = [NSString stringWithFormat:@"Jetpack-version: %@", [self.jetpack version]]; - } - + // FIXME: Disabled to experiment with a compilation error +// if ([self.jetpack isInstalled]) { +// jetpackVersion = [NSString stringWithFormat:@"Jetpack-version: %@", [self.jetpack version]]; +// } + // Add information to array in the order we want to display it. - + NSMutableArray *blogInformation = [[NSMutableArray alloc] init]; [blogInformation addObject:blogType]; if (username) { @@ -853,10 +608,11 @@ - (NSString *)supportDescription if (planDescription) { [blogInformation addObject:planDescription]; } - if (jetpackVersion) { - [blogInformation addObject:jetpackVersion]; - } - + // FIXME: Disabled to experiment with a compilation error (see disabled code above, where jetpackVersion is defined) +// if (jetpackVersion) { +// [blogInformation addObject:jetpackVersion]; +// } + // Combine and return. return [NSString stringWithFormat:@"<%@>", [blogInformation componentsJoinedByString:@" "]]; } @@ -866,16 +622,17 @@ - (NSString *)stateDescription if (self.account) { return @"wpcom"; } - - if ([self.jetpack isConnected]) { - NSString *apiType = [self wordPressComRestApi] ? @"REST" : @"XML-RPC"; - return [NSString stringWithFormat:@"jetpack_connected - %@", apiType]; - } - - if ([self.jetpack isInstalled]) { - return @"self-hosted - jetpack_installed"; - } - + + // FIXME: Disabled to experiment with a compilation error +// if ([self.jetpack isConnected]) { +// NSString *apiType = [self wordPressComRestApi] ? @"REST" : @"XML-RPC"; +// return [NSString stringWithFormat:@"jetpack_connected - %@", apiType]; +// } +// +// if ([self.jetpack isInstalled]) { +// return @"self-hosted - jetpack_installed"; +// } + return @"self_hosted"; } @@ -896,7 +653,11 @@ - (WordPressOrgXMLRPCApi *)xmlrpcApi - (WordPressOrgRestApi *)selfHostedSiteRestApi { if (_selfHostedSiteRestApi == nil) { - _selfHostedSiteRestApi = self.account == nil ? [[WordPressOrgRestApi alloc] initWithBlog:self] : nil; + // FIXME: Disabled to experiment with a compilation error + // + // The method is defined in the Swift part of WordPress... + // +// _selfHostedSiteRestApi = self.account == nil ? [[WordPressOrgRestApi alloc] initWithBlog:self] : nil; } return _selfHostedSiteRestApi; } @@ -904,7 +665,7 @@ - (WordPressOrgRestApi *)selfHostedSiteRestApi - (WordPressComRestApi *)wordPressComRestApi { if (self.account) { - return self.account.wordPressComRestApi; + return self.account._private_wordPressComRestApi; } return nil; } @@ -960,8 +721,9 @@ - (BOOL)isBasicAuthCredentialStored - (BOOL)hasRequiredJetpackVersion:(NSString *)requiredJetpackVersion { return [self supportsRestApi] - && ![self isHostedAtWPcom] - && [self.jetpack.version compare:requiredJetpackVersion options:NSNumericSearch] != NSOrderedAscending; + && ![self isHostedAtWPcom]; + // FIXME: Disabled to experiment with a compilation error +// && [self.jetpack.version compare:requiredJetpackVersion options:NSNumericSearch] != NSOrderedAscending; } /// Checks the blogs installed WordPress version is more than or equal to the requiredVersion diff --git a/WordPress/WordPressData/Objective-C/CocoaLumberjackConfig.m b/WordPress/WordPressData/Objective-C/CocoaLumberjackConfig.m new file mode 100644 index 000000000000..119bca7e022e --- /dev/null +++ b/WordPress/WordPressData/Objective-C/CocoaLumberjackConfig.m @@ -0,0 +1,8 @@ +// FIXME: Having issues with CocoaLumberjack as a transitive dependency when added to Objective-C files +//@import CocoaLumberjack; + +// Without this explicitly step, the framework fails to compile with ddLogLevel symbol not found. +DDLogLevel ddLogLevel = DDLogLevelInfo; + +#define DDLogInfo(frmt, ...) NSLog((@"[INFO] " frmt), ##__VA_ARGS__) +#define DDLogError(frmt, ...) NSLog((@"[ERROR] " frmt), ##__VA_ARGS__) diff --git a/Modules/Sources/WordPressDataObjC/CoreDataService.m b/WordPress/WordPressData/Objective-C/CoreDataService.m similarity index 100% rename from Modules/Sources/WordPressDataObjC/CoreDataService.m rename to WordPress/WordPressData/Objective-C/CoreDataService.m diff --git a/WordPress/Classes/Services/LocalCoreDataService.m b/WordPress/WordPressData/Objective-C/LocalCoreDataService.m similarity index 100% rename from WordPress/Classes/Services/LocalCoreDataService.m rename to WordPress/WordPressData/Objective-C/LocalCoreDataService.m diff --git a/WordPress/Classes/Models/Media.m b/WordPress/WordPressData/Objective-C/Media.m similarity index 81% rename from WordPress/Classes/Models/Media.m rename to WordPress/WordPressData/Objective-C/Media.m index 0a300b4fdcc6..4e6f499b688b 100644 --- a/WordPress/Classes/Models/Media.m +++ b/WordPress/WordPressData/Objective-C/Media.m @@ -1,6 +1,8 @@ #import "Media.h" -@import WordPressDataObjC; -#import "WordPress-Swift.h" +// FIXME: Why is the module header not generated? +//#import "WordPressData-Swift.h" +// FIXME: Having issues with CocoaLumberjack as a transitive dependency when added to Objective-C files +//@import CocoaLumberjack; @implementation Media @@ -156,18 +158,20 @@ - (void)setAbsoluteLocalURL:(NSURL *)absoluteLocalURL - (NSURL *)absoluteURLForLocalPath:(NSString *)localPath cacheDirectory:(BOOL)cacheDirectory { - NSError *error; - NSURL *mediaDirectory = nil; - if (cacheDirectory) { - mediaDirectory = [[MediaFileManager cacheManager] directoryURLAndReturnError:&error]; - } else { - mediaDirectory = [MediaFileManager uploadsDirectoryURLAndReturnError:&error]; - } - if (error) { - DDLogInfo(@"Error resolving Media directory: %@", error); - return nil; - } - return [mediaDirectory URLByAppendingPathComponent:localPath.lastPathComponent]; + // FIXME: Disabled to experiment with a compilation error +// NSError *error; +// NSURL *mediaDirectory = nil; +// if (cacheDirectory) { +// mediaDirectory = [[MediaFileManager cacheManager] directoryURLAndReturnError:&error]; +// } else { +// mediaDirectory = [MediaFileManager uploadsDirectoryURLAndReturnError:&error]; +// } +// if (error) { +// DDLogInfo(@"Error resolving Media directory: %@", error); +// return nil; +// } +// return [mediaDirectory URLByAppendingPathComponent:localPath.lastPathComponent]; + return [[NSURL alloc] initWithString:@"https://wordpress.com"]; } #pragma mark - CoreData Helpers @@ -191,15 +195,17 @@ - (void)prepareForDeletion - (void)remove { - [self.managedObjectContext performBlockAndWait:^{ - [self.managedObjectContext deleteObject:self]; - [[ContextManager sharedInstance] saveContextAndWait:self.managedObjectContext]; - }]; + // FIXME: Disabled to experiment with a compilation error +// [self.managedObjectContext performBlockAndWait:^{ +// [self.managedObjectContext deleteObject:self]; +// [[ContextManager sharedInstance] saveContextAndWait:self.managedObjectContext]; +// }]; } - (void)save { - [[ContextManager sharedInstance] saveContext:self.managedObjectContext]; + // FIXME: Disabled to experiment with a compilation error +// [[ContextManager sharedInstance] saveContext:self.managedObjectContext]; } - (BOOL)hasRemote { diff --git a/WordPress/Classes/Models/Menu.h b/WordPress/WordPressData/Objective-C/Menu.h similarity index 100% rename from WordPress/Classes/Models/Menu.h rename to WordPress/WordPressData/Objective-C/Menu.h diff --git a/WordPress/Classes/Models/Menu.m b/WordPress/WordPressData/Objective-C/Menu.m similarity index 100% rename from WordPress/Classes/Models/Menu.m rename to WordPress/WordPressData/Objective-C/Menu.m index 6ba4fb402196..73b8a36b4d57 100644 --- a/WordPress/Classes/Models/Menu.m +++ b/WordPress/WordPressData/Objective-C/Menu.m @@ -1,7 +1,7 @@ +#import "Blog.h" #import "Menu.h" #import "MenuItem.h" #import "MenuLocation.h" -#import "Blog.h" NSInteger const MenuDefaultID = -1; diff --git a/WordPress/Classes/Models/MenuItem.h b/WordPress/WordPressData/Objective-C/MenuItem.h similarity index 100% rename from WordPress/Classes/Models/MenuItem.h rename to WordPress/WordPressData/Objective-C/MenuItem.h diff --git a/WordPress/Classes/Models/MenuItem.m b/WordPress/WordPressData/Objective-C/MenuItem.m similarity index 100% rename from WordPress/Classes/Models/MenuItem.m rename to WordPress/WordPressData/Objective-C/MenuItem.m index d90055a2e6ff..01491aec9086 100644 --- a/WordPress/Classes/Models/MenuItem.m +++ b/WordPress/WordPressData/Objective-C/MenuItem.m @@ -1,7 +1,7 @@ +#import "Blog.h" #import "MenuItem.h" #import "Menu.h" #import "PostType.h" -#import "Blog.h" NSString * const MenuItemTypePage = @"page"; NSString * const MenuItemTypeCustom = @"custom"; diff --git a/WordPress/Classes/Models/MenuLocation.h b/WordPress/WordPressData/Objective-C/MenuLocation.h similarity index 100% rename from WordPress/Classes/Models/MenuLocation.h rename to WordPress/WordPressData/Objective-C/MenuLocation.h diff --git a/WordPress/Classes/Models/MenuLocation.m b/WordPress/WordPressData/Objective-C/MenuLocation.m similarity index 100% rename from WordPress/Classes/Models/MenuLocation.m rename to WordPress/WordPressData/Objective-C/MenuLocation.m diff --git a/WordPress/Classes/Models/PostCategory.m b/WordPress/WordPressData/Objective-C/PostCategory.m similarity index 100% rename from WordPress/Classes/Models/PostCategory.m rename to WordPress/WordPressData/Objective-C/PostCategory.m diff --git a/WordPress/WordPressData/Objective-C/PostHelper.m b/WordPress/WordPressData/Objective-C/PostHelper.m new file mode 100644 index 000000000000..fc9cc568edd6 --- /dev/null +++ b/WordPress/WordPressData/Objective-C/PostHelper.m @@ -0,0 +1,258 @@ +#import "PostHelper.h" +#import "AbstractPost.h" +// FIXME: Why can't find this? +//#import "WordPressData-Swift.h" + +@import WordPressKit; +@import NSObject_SafeExpectations; + +@implementation PostHelper + ++ (void)updatePost:(AbstractPost *)post withRemotePost:(RemotePost *)remotePost inContext:(NSManagedObjectContext *)managedObjectContext { + [self updatePost:post withRemotePost:remotePost inContext:managedObjectContext overwrite:NO]; +} + ++ (void)updatePost:(AbstractPost *)post withRemotePost:(RemotePost *)remotePost inContext:(NSManagedObjectContext *)managedObjectContext overwrite:(BOOL)overwrite { + if ((post.revision != nil && !overwrite)) { + return; + } + + NSNumber *previousPostID = post.postID; + post.postID = remotePost.postID; + // Used to populate author information for self-hosted sites. + // FIXME: Disabled to experiment with a compilation error +// BlogAuthor *author = [post.blog getAuthorWithId:remotePost.authorID]; +// +// post.author = remotePost.authorDisplayName ?: author.displayName; + post.authorID = remotePost.authorID; + post.date_created_gmt = remotePost.date; + post.dateModified = remotePost.dateModified; + post.postTitle = remotePost.title; + post.permaLink = [remotePost.URL absoluteString]; + post.content = remotePost.content; + // FIXME: Disabled to experiment with a compilation error +// post.status = remotePost.status; + post.password = remotePost.password; + + if (remotePost.postThumbnailID != nil) { + // FIXME: Disabled to experiment with a compilation error +// post.featuredImage = [Media existingOrStubMediaWithMediaID: remotePost.postThumbnailID inBlog:post.blog]; + } else { + post.featuredImage = nil; + } + + post.pathForDisplayImage = remotePost.pathForDisplayImage; + if (post.pathForDisplayImage.length == 0) { + [post updatePathForDisplayImageBasedOnContent]; + } + // FIXME: Disabled to experiment with a compilation error +// post.authorAvatarURL = remotePost.authorAvatarURL ?: author.avatarURL; + post.mt_excerpt = remotePost.excerpt; + post.wp_slug = remotePost.slug; + post.suggested_slug = remotePost.suggestedSlug; + + if ([remotePost.revisions wp_isValidObject]) { + post.revisions = [remotePost.revisions copy]; + } + + if (remotePost.postID != previousPostID) { + [self updateCommentsForPost:post]; + } + + post.autosaveTitle = remotePost.autosave.title; + post.autosaveExcerpt = remotePost.autosave.excerpt; + post.autosaveContent = remotePost.autosave.content; + post.autosaveModifiedDate = remotePost.autosave.modifiedDate; + post.autosaveIdentifier = remotePost.autosave.identifier; + + // FIXME: Disabled to experiment with a compilation error +// if ([post isKindOfClass:[Page class]]) { +// Page *pagePost = (Page *)post; +// pagePost.parentID = remotePost.parentID; +// pagePost.foreignID = remotePost.foreignID; +// } else if ([post isKindOfClass:[Post class]]) { +// Post *postPost = (Post *)post; +// postPost.commentCount = remotePost.commentCount; +// postPost.likeCount = remotePost.likeCount; +// postPost.postFormat = remotePost.format; +// postPost.tags = [remotePost.tags componentsJoinedByString:@","]; +// postPost.postType = remotePost.type; +// postPost.isStickyPost = (remotePost.isStickyPost != nil) ? remotePost.isStickyPost.boolValue : NO; +// [self updatePost:postPost withRemoteCategories:remotePost.categories inContext:managedObjectContext]; +// +// NSString *publicID = nil; +// NSString *publicizeMessage = nil; +// NSString *publicizeMessageID = nil; +// if (remotePost.metadata) { +// NSDictionary *latitudeDictionary = [self dictionaryWithKey:@"geo_latitude" inMetadata:remotePost.metadata]; +// NSDictionary *longitudeDictionary = [self dictionaryWithKey:@"geo_longitude" inMetadata:remotePost.metadata]; +// NSDictionary *geoPublicDictionary = [self dictionaryWithKey:@"geo_public" inMetadata:remotePost.metadata]; +// if (latitudeDictionary && longitudeDictionary) { +// NSNumber *latitude = [latitudeDictionary numberForKey:@"value"]; +// NSNumber *longitude = [longitudeDictionary numberForKey:@"value"]; +// CLLocationCoordinate2D coord; +// coord.latitude = [latitude doubleValue]; +// coord.longitude = [longitude doubleValue]; +// publicID = [geoPublicDictionary stringForKey:@"id"]; +// } +// NSDictionary *publicizeMessageDictionary = [self dictionaryWithKey:@"_wpas_mess" inMetadata:remotePost.metadata]; +// publicizeMessage = [publicizeMessageDictionary stringForKey:@"value"]; +// publicizeMessageID = [publicizeMessageDictionary stringForKey:@"id"]; +// } +// postPost.foreignID = remotePost.foreignID; +// postPost.publicID = publicID; +// postPost.publicizeMessage = publicizeMessage; +// postPost.publicizeMessageID = publicizeMessageID; +// postPost.disabledPublicizeConnections = [self disabledPublicizeConnectionsForPost:post andMetadata:remotePost.metadata]; +// } +} + ++ (void)updatePost:(Post *)post withRemoteCategories:(NSArray *)remoteCategories inContext:(NSManagedObjectContext *)managedObjectContext { + // FIXME: Disabled to experiment with a compilation error +// NSMutableSet *categories = [post mutableSetValueForKey:@"categories"]; +// [categories removeAllObjects]; +// for (RemotePostCategory *remoteCategory in remoteCategories) { +// PostCategory *category = [PostHelper createOrUpdateCategoryForRemoteCategory:remoteCategory blog:post.blog context:managedObjectContext]; +// if (category) { +// [categories addObject:category]; +// } +// } +} + ++ (void)updateCommentsForPost:(AbstractPost *)post +{ + NSMutableSet *currentComments = [post mutableSetValueForKey:@"comments"]; + NSSet *allComments = [post.blog.comments filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"postID = %@", post.postID]]; + [currentComments unionSet:allComments]; +} + ++ (NSDictionary *)dictionaryWithKey:(NSString *)key inMetadata:(NSArray *)metadata { + NSArray *matchingEntries = [metadata filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"key = %@", key]]; + // In theory, there shouldn't be duplicated fields, but I've seen some bugs where there's more than one geo_* value + // In any case, they should be sorted by id, so `lastObject` should have the newer value + return [matchingEntries lastObject]; +} + ++ (NSArray *)remoteMetadataForPost:(Post *)post +{ + // FIXME: Disabled to experiment with a compilation error + // NSMutableArray *metadata = [NSMutableArray arrayWithCapacity:5]; +// +// /// Send UUID as a foreign ID in metadata so we have a way to deduplicate new posts +// if (post.foreignID) { +// NSMutableDictionary *uuidDictionary = [NSMutableDictionary dictionaryWithCapacity:3]; +// uuidDictionary[@"key"] = [self foreignIDKey]; +// uuidDictionary[@"value"] = [post.foreignID UUIDString]; +// [metadata addObject:uuidDictionary]; +// } +// +// if (post.publicID) { +// NSMutableDictionary *publicDictionary = [NSMutableDictionary dictionaryWithCapacity:1]; +// publicDictionary[@"id"] = [post.publicID numericValue]; +// [metadata addObject:publicDictionary]; +// } +// +// if (post.publicizeMessageID || post.publicizeMessage.length) { +// NSMutableDictionary *publicizeMessageDictionary = [NSMutableDictionary dictionaryWithCapacity:3]; +// if (post.publicizeMessageID) { +// publicizeMessageDictionary[@"id"] = post.publicizeMessageID; +// } +// publicizeMessageDictionary[@"key"] = @"_wpas_mess"; +// publicizeMessageDictionary[@"value"] = post.publicizeMessage.length ? post.publicizeMessage : @""; +// [metadata addObject:publicizeMessageDictionary]; +// } +// +// [metadata addObjectsFromArray:[PostHelper publicizeMetadataEntriesForPost:post]]; +// +// if (post.bloggingPromptID) { +// NSMutableDictionary *promptDictionary = [NSMutableDictionary dictionaryWithCapacity:3]; +// promptDictionary[@"key"] = @"_jetpack_blogging_prompt_key"; +// promptDictionary[@"value"] = post.bloggingPromptID; +// [metadata addObject:promptDictionary]; +// } +// +// return metadata; + return @[]; +} + ++ (NSArray *)mergePosts:(NSArray *)remotePosts + ofType:(NSString *)syncPostType + withStatuses:(NSArray *)statuses + byAuthor:(NSNumber *)authorID + forBlog:(Blog *)blog + purgeExisting:(BOOL)purge + inContext:(NSManagedObjectContext *)context +{ + NSMutableArray *posts = [NSMutableArray arrayWithCapacity:remotePosts.count]; + for (RemotePost *remotePost in remotePosts) { + // FIXME: Disabled to experiment with a compilation error +// AbstractPost *post = [blog lookupPostWithID:remotePost.postID inContext:context]; +// if (post == nil) { +// NSUUID *foreignID = remotePost.foreignID; +// if (foreignID != nil) { +// post = [blog lookupPostWithForeignID:foreignID inContext:context]; +// } +// } +// if (!post) { +// if ([remotePost.type isEqualToString:PostServiceTypePage]) { +// // Create a Page entity for posts with a remote type of "page" +// post = [blog createPage]; +// } else { +// // Create a Post entity for any other posts that have a remote post type of "post" or a custom post type. +// post = [blog createPost]; +// } +// } +// [PostHelper updatePost:post withRemotePost:remotePost inContext:context]; +// [posts addObject:post]; + } + + if (purge) { + // FIXME: Disabled to experiment with a compilation error +// // Set up predicate for fetching any posts that could be purged for the sync. +// NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(postID != NULL) AND (original = NULL) AND (revision = NULL) AND (blog = %@)", blog]; +// if ([statuses count] > 0) { +// NSPredicate *statusPredicate = [NSPredicate predicateWithFormat:@"status IN %@", statuses]; +// predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate, statusPredicate]]; +// } +// if (authorID) { +// NSPredicate *authorPredicate = [NSPredicate predicateWithFormat:@"authorID = %@", authorID]; +// predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate, authorPredicate]]; +// } +// +// NSFetchRequest *request; +// if ([syncPostType isEqualToString:PostServiceTypeAny]) { +// // If syncing "any" posts, set up the fetch for any AbstractPost entities (including child entities). +// request = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([AbstractPost class])]; +// } else if ([syncPostType isEqualToString:PostServiceTypePage]) { +// // If syncing "page" posts, set up the fetch for any Page entities. +// request = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([Page class])]; +// } else { +// // If not syncing "page" or "any" post, use the Post entity. +// request = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([Post class])]; +// // Include the postType attribute in the predicate. +// NSPredicate *postTypePredicate = [NSPredicate predicateWithFormat:@"postType = %@", syncPostType]; +// predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicate, postTypePredicate]]; +// } +// request.predicate = predicate; +// +// NSError *error; +// NSArray *existingPosts = [context executeFetchRequest:request error:&error]; +// if (error) { +// DDLogError(@"Error fetching existing posts for purging: %@", error); +// } else { +// NSSet *postsToKeep = [NSSet setWithArray:posts]; +// NSMutableSet *postsToDelete = [NSMutableSet setWithArray:existingPosts]; +// // Delete the posts not being updated. +// [postsToDelete minusSet:postsToKeep]; +// for (AbstractPost *post in postsToDelete) { +// DDLogInfo(@"Deleting Post: %@", post); +// [context deleteObject:post]; +// } +// } + } +// +// return posts; + return @[]; +} + +@end diff --git a/WordPress/WordPressData/Objective-C/PostService.m b/WordPress/WordPressData/Objective-C/PostService.m new file mode 100644 index 000000000000..df80d0ea1876 --- /dev/null +++ b/WordPress/WordPressData/Objective-C/PostService.m @@ -0,0 +1,144 @@ +#import "PostService.h" +#import "PostCategory.h" +#import "PostCategoryService.h" +@import WordPressData; +#import "CommentService.h" +#import "MediaService.h" +#import "Media.h" +#import "PostHelper.h" +// FIXME: Having issues with CocoaLumberjack as a transitive dependency when added to Objective-C files +//@import CocoaLumberjack; +@import WordPressKit; +@import WordPressShared; + +PostServiceType const PostServiceTypePost = @"post"; +PostServiceType const PostServiceTypePage = @"page"; +PostServiceType const PostServiceTypeAny = @"any"; +NSString * const PostServiceErrorDomain = @"PostServiceErrorDomain"; + +const NSUInteger PostServiceDefaultNumberToSync = 40; + +@interface PostService () + +@end + +@implementation PostService + +- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)context { + // FIXME: Disabled to experiment with a compilation error +// return [self initWithManagedObjectContext:context +// postServiceRemoteFactory:[[PostServiceRemoteFactory alloc] init]]; + return nil; +} + +- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)context + postServiceRemoteFactory:(PostServiceRemoteFactory *)postServiceRemoteFactory { + if (self = [super initWithManagedObjectContext:context]) { + self.postServiceRemoteFactory = postServiceRemoteFactory; + } + return self; +} + +- (void)syncPostsOfType:(PostServiceType)postType + forBlog:(Blog *)blog + success:(PostServiceSyncSuccess)success + failure:(PostServiceSyncFailure)failure +{ + [self syncPostsOfType:postType + withOptions:nil + forBlog:blog + success:success + failure:failure]; +} + +- (void)syncPostsOfType:(PostServiceType)postType + withOptions:(PostServiceSyncOptions *)options + forBlog:(Blog *)blog + success:(PostServiceSyncSuccess)success + failure:(PostServiceSyncFailure)failure +{ + [self syncPostsOfType:postType + withOptions:options + forBlog:blog + loadedPosts:[NSMutableArray new] + syncAll:(postType == PostServiceTypePage) + success:success + failure:failure]; +} + +- (void)syncPostsOfType:(PostServiceType)postType + withOptions:(PostServiceSyncOptions *)options + forBlog:(Blog *)blog + loadedPosts:(NSMutableArray *)loadedPosts + syncAll:(BOOL)syncAll + success:(PostServiceSyncSuccess)success + failure:(PostServiceSyncFailure)failure +{ + // FIXME: Disabled to experiment with a compilation error +// NSManagedObjectID *blogObjectID = blog.objectID; +// id remote = [self.postServiceRemoteFactory forBlog:blog]; +// +// if (loadedPosts.count > 0) { +// options.offset = @(loadedPosts.count); +// } +// +// NSDictionary *remoteOptions = options ? [self remoteSyncParametersDictionaryForRemote:remote withOptions:options] : nil; +// [remote getPostsOfType:postType +// options:remoteOptions +// success:^(NSArray *remotePosts) { +// [loadedPosts addObjectsFromArray:remotePosts]; +// +// if (syncAll && remotePosts.count >= options.number.integerValue) { +// [self syncPostsOfType:postType +// withOptions:options +// forBlog:blog +// loadedPosts:loadedPosts +// syncAll:syncAll +// success:success +// failure:failure]; +// } else { +// [self.managedObjectContext performBlock:^{ +// NSError *error; +// Blog *blogInContext = (Blog *)[self.managedObjectContext existingObjectWithID:blogObjectID error:&error]; +// if (!blogInContext || error) { +// DDLogError(@"Could not retrieve blog in context %@", (error ? [NSString stringWithFormat:@"with error: %@", error] : @"")); +// return; +// } +// NSArray *posts = [PostHelper mergePosts:[loadedPosts copy] +// ofType:postType +// withStatuses:options.statuses +// byAuthor:options.authorID +// forBlog:blogInContext +// purgeExisting:options.purgesLocalSync +// inContext:self.managedObjectContext]; +// +// +// [[ContextManager sharedInstance] saveContext:self.managedObjectContext withCompletionBlock:^{ +// // Call the completion block after context is saved. The callback is called on the context queue because `posts` +// // contains models that are bound to the `self.managedObjectContext` object. +// if (success) { +// [self.managedObjectContext performBlock:^{ +// success(posts); +// }]; +// } +// } onQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)]; +// }]; +// } +// } failure:^(NSError *error) { +// if (failure) { +// [self.managedObjectContext performBlock:^{ +// failure(error); +// }]; +// } +// }]; +} + +#pragma mark - Helpers + +- (NSDictionary *)remoteSyncParametersDictionaryForRemote:(nonnull id )remote + withOptions:(nonnull PostServiceSyncOptions *)options +{ + return [remote dictionaryWithRemoteOptions:options]; +} + +@end diff --git a/WordPress/Classes/Services/PostServiceOptions.m b/WordPress/WordPressData/Objective-C/PostServiceOptions.m similarity index 100% rename from WordPress/Classes/Services/PostServiceOptions.m rename to WordPress/WordPressData/Objective-C/PostServiceOptions.m diff --git a/WordPress/Classes/Models/PostTag.h b/WordPress/WordPressData/Objective-C/PostTag.h similarity index 100% rename from WordPress/Classes/Models/PostTag.h rename to WordPress/WordPressData/Objective-C/PostTag.h diff --git a/WordPress/Classes/Models/PostTag.m b/WordPress/WordPressData/Objective-C/PostTag.m similarity index 100% rename from WordPress/Classes/Models/PostTag.m rename to WordPress/WordPressData/Objective-C/PostTag.m diff --git a/WordPress/Classes/Models/PostType.h b/WordPress/WordPressData/Objective-C/PostType.h similarity index 100% rename from WordPress/Classes/Models/PostType.h rename to WordPress/WordPressData/Objective-C/PostType.h diff --git a/WordPress/Classes/Models/PostType.m b/WordPress/WordPressData/Objective-C/PostType.m similarity index 100% rename from WordPress/Classes/Models/PostType.m rename to WordPress/WordPressData/Objective-C/PostType.m diff --git a/WordPress/Classes/Models/ReaderPost.m b/WordPress/WordPressData/Objective-C/ReaderPost.m similarity index 84% rename from WordPress/Classes/Models/ReaderPost.m rename to WordPress/WordPressData/Objective-C/ReaderPost.m index 3fbdb91478a4..095842891a35 100644 --- a/WordPress/Classes/Models/ReaderPost.m +++ b/WordPress/WordPressData/Objective-C/ReaderPost.m @@ -1,9 +1,6 @@ #import "ReaderPost.h" -@import WordPressDataObjC; #import "SourcePostAttribution.h" -#import "WPAccount.h" -#import "WordPress-Swift.h" - +@import WordPressKit; @import WordPressShared; // These keys are used in the getStoredComment method @@ -131,45 +128,48 @@ + (instancetype)createOrReplaceFromRemotePost:(RemoteReaderPost *)remotePost post.canSubscribeComments = remotePost.canSubscribeComments; post.receivesCommentNotifications = remotePost.receivesCommentNotifications; - if (existing && [topic isKindOfClass:[ReaderSearchTopic class]]) { - // Failsafe. The `read/search` endpoint might return the same post on - // more than one page. If this happens preserve the *original* sortRank - // to avoid content jumping around in the UI. - } else { - post.sortRank = remotePost.sortRank; - } - - post.status = remotePost.status; + // FIXME: Disabled to experiment with a compilation error +// if (existing && [topic isKindOfClass:[ReaderSearchTopic class]]) { +// // Failsafe. The `read/search` endpoint might return the same post on +// // more than one page. If this happens preserve the *original* sortRank +// // to avoid content jumping around in the UI. +// } else { +// post.sortRank = remotePost.sortRank; +// } +// +// post.status = remotePost.status; post.summary = remotePost.summary; post.tags = remotePost.tags; post.isSharingEnabled = remotePost.isSharingEnabled; post.isLikesEnabled = remotePost.isLikesEnabled; post.isSiteBlocked = NO; - if (remotePost.crossPostMeta) { - if (!post.crossPostMeta) { - ReaderCrossPostMeta *meta = (ReaderCrossPostMeta *)[NSEntityDescription insertNewObjectForEntityForName:[ReaderCrossPostMeta classNameWithoutNamespaces] - inManagedObjectContext:managedObjectContext]; - post.crossPostMeta = meta; - } - post.crossPostMeta.siteURL = remotePost.crossPostMeta.siteURL; - post.crossPostMeta.postURL = remotePost.crossPostMeta.postURL; - post.crossPostMeta.commentURL = remotePost.crossPostMeta.commentURL; - post.crossPostMeta.siteID = remotePost.crossPostMeta.siteID; - post.crossPostMeta.postID = remotePost.crossPostMeta.postID; - } else { - post.crossPostMeta = nil; - } + // FIXME: Disabled to experiment with a compilation error +// if (remotePost.crossPostMeta) { +// if (!post.crossPostMeta) { +// ReaderCrossPostMeta *meta = (ReaderCrossPostMeta *)[NSEntityDescription insertNewObjectForEntityForName:[ReaderCrossPostMeta classNameWithoutNamespaces] +// inManagedObjectContext:managedObjectContext]; +// post.crossPostMeta = meta; +// } +// post.crossPostMeta.siteURL = remotePost.crossPostMeta.siteURL; +// post.crossPostMeta.postURL = remotePost.crossPostMeta.postURL; +// post.crossPostMeta.commentURL = remotePost.crossPostMeta.commentURL; +// post.crossPostMeta.siteID = remotePost.crossPostMeta.siteID; +// post.crossPostMeta.postID = remotePost.crossPostMeta.postID; +// } else { +// post.crossPostMeta = nil; +// } NSString *tag = remotePost.primaryTag; NSString *slug = remotePost.primaryTagSlug; - if ([topic isKindOfClass:[ReaderTagTopic class]]) { - ReaderTagTopic *tagTopic = (ReaderTagTopic *)topic; - if ([tagTopic.slug isEqualToString:remotePost.primaryTagSlug]) { - tag = remotePost.secondaryTag; - slug = remotePost.secondaryTagSlug; - } - } + // FIXME: Disabled to experiment with a compilation error +// if ([topic isKindOfClass:[ReaderTagTopic class]]) { +// ReaderTagTopic *tagTopic = (ReaderTagTopic *)topic; +// if ([tagTopic.slug isEqualToString:remotePost.primaryTagSlug]) { +// tag = remotePost.secondaryTag; +// slug = remotePost.secondaryTagSlug; +// } +// } post.primaryTag = tag; post.primaryTagSlug = slug; @@ -242,7 +242,9 @@ - (BOOL)isCrossPost - (BOOL)isP2Type { NSInteger orgID = [self.organizationID intValue]; - return orgID == SiteOrganizationTypeP2 || orgID == SiteOrganizationTypeAutomattic; + // FIXME: Disabled to experiment with a compilation error +// return orgID == SiteOrganizationTypeP2 || orgID == SiteOrganizationTypeAutomattic; + return NO; } - (NSString *)authorString @@ -415,8 +417,9 @@ - (void)didSave { // A ReaderCard can have either a post, or a list of topics, but not both. // Since this card has a post, we can confidently set `topics` to NULL. if ([self respondsToSelector:@selector(card)] && self.card.count > 0) { - self.card.allObjects[0].topics = NULL; - [[ContextManager sharedInstance] saveContext:self.managedObjectContext]; + // FIXME: Disabled to experiment with a compilation error +// self.card.allObjects[0].topics = NULL; +// [[ContextManager sharedInstance] saveContext:self.managedObjectContext]; } } diff --git a/WordPress/Classes/Models/SourcePostAttribution.m b/WordPress/WordPressData/Objective-C/SourcePostAttribution.m similarity index 100% rename from WordPress/Classes/Models/SourcePostAttribution.m rename to WordPress/WordPressData/Objective-C/SourcePostAttribution.m diff --git a/WordPress/Classes/Models/WPAccount.m b/WordPress/WordPressData/Objective-C/WPAccount.m similarity index 78% rename from WordPress/Classes/Models/WPAccount.m rename to WordPress/WordPressData/Objective-C/WPAccount.m index ccd3e520373a..ad0712098c31 100644 --- a/WordPress/Classes/Models/WPAccount.m +++ b/WordPress/WordPressData/Objective-C/WPAccount.m @@ -1,6 +1,9 @@ +// FIXME: Having issues with CocoaLumberjack as a transitive dependency when added to Objective-C files +//@import CocoaLumberjack; @import SFHFKeychainUtils; +@import WordPressKit; #import "WPAccount.h" -#import "WordPress-Swift.h" +#import @interface WPAccount () @@ -80,7 +83,9 @@ - (NSString *)authToken return self.cachedToken; } - NSString *token = [WPAccount tokenForUsername:self.username]; + // FIXME: Disabled to experiment with a compilation error +// NSString *token = [WPAccount tokenForUsername:self.username]; + NSString *token = @"TODO"; self.cachedToken = token; return token; } @@ -88,12 +93,15 @@ - (NSString *)authToken - (void)setAuthToken:(NSString *)authToken { self.cachedToken = nil; + // FIXME: Cannot access yet because in Swift layer +// NSString *serviceName = [WPAccount authKeychainServiceName]; + NSString *serviceName = @"FIXME"; if (authToken) { NSError *error = nil; [SFHFKeychainUtils storeUsername:self.username andPassword:authToken - forServiceName:[WPAccount authKeychainServiceName] + forServiceName:serviceName accessGroup:nil updateExisting:YES error:&error]; @@ -105,7 +113,7 @@ - (void)setAuthToken:(NSString *)authToken } else { NSError *error = nil; [SFHFKeychainUtils deleteItemForUsername:self.username - andServiceName:[WPAccount authKeychainServiceName] + andServiceName:serviceName accessGroup:nil error:&error]; if (error) { @@ -136,7 +144,9 @@ + (NSString *)tokenForUsername:(NSString *)username isJetpack:(BOOL)isJetpack NSError *error = nil; NSString *authToken = [SFHFKeychainUtils getPasswordForUsername:username - andServiceName:[WPAccount authKeychainServiceName] + // FIXME: Cannot access yet because in Swift layer +// andServiceName:[WPAccount authKeychainServiceName] + andServiceName:@"TODO" accessGroup:nil error:&error]; if (error) { @@ -150,8 +160,8 @@ + (void)migrateAuthKeyForUsername:(NSString *)username { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - SharedDataIssueSolver *sharedDataIssueSolver = [SharedDataIssueSolver instance]; - [sharedDataIssueSolver migrateAuthKeyFor:username]; +// SharedDataIssueSolver *sharedDataIssueSolver = [SharedDataIssueSolver instance]; +// [sharedDataIssueSolver migrateAuthKeyFor:username]; }); } diff --git a/WordPress/Classes/Models/AbstractPost.h b/WordPress/WordPressData/Objective-C/include/AbstractPost.h similarity index 99% rename from WordPress/Classes/Models/AbstractPost.h rename to WordPress/WordPressData/Objective-C/include/AbstractPost.h index 41ed30bc1b4d..53308e964d87 100644 --- a/WordPress/Classes/Models/AbstractPost.h +++ b/WordPress/WordPressData/Objective-C/include/AbstractPost.h @@ -1,6 +1,6 @@ #import #import -#import "BasePost.h" +#import NS_ASSUME_NONNULL_BEGIN diff --git a/WordPress/Classes/Models/BasePost.h b/WordPress/WordPressData/Objective-C/include/BasePost.h similarity index 94% rename from WordPress/Classes/Models/BasePost.h rename to WordPress/WordPressData/Objective-C/include/BasePost.h index 7611dea54d23..ae948b6a1344 100644 --- a/WordPress/Classes/Models/BasePost.h +++ b/WordPress/WordPressData/Objective-C/include/BasePost.h @@ -1,6 +1,7 @@ #import -#import "Blog.h" -#import "PostContentProvider.h" +#import +#import + NS_ASSUME_NONNULL_BEGIN diff --git a/WordPress/Classes/Models/Blog/Blog.h b/WordPress/WordPressData/Objective-C/include/Blog.h similarity index 96% rename from WordPress/Classes/Models/Blog/Blog.h rename to WordPress/WordPressData/Objective-C/include/Blog.h index a82a4225b10c..23c0816b68cb 100644 --- a/WordPress/Classes/Models/Blog/Blog.h +++ b/WordPress/WordPressData/Objective-C/include/Blog.h @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN @class UserSuggestion; @class SiteSuggestion; @class PageTemplateCategory; +// FIXME: Try to remove this once you get to a green build on WordPress/Jetpack @class JetpackFeaturesRemovalCoordinator; @class PublicizeInfo; @@ -122,8 +123,6 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { @interface Blog : NSManagedObject @property (nonatomic, strong, readwrite, nullable) NSNumber *blogID __deprecated_msg("Use dotComID instead"); -/// WordPress.com site ID stored as signed 32-bit integer. -@property (nonatomic, strong, readwrite, nullable) NSNumber *dotComID; @property (nonatomic, strong, readwrite, nullable) NSString *xmlrpc; @property (nonatomic, strong, readwrite, nullable) NSString *apiKey; @property (nonatomic, strong, readwrite, nonnull) NSNumber *organizationID; @@ -159,7 +158,6 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { @property (nonatomic, assign, readwrite) BOOL isHostedAtWPcom; @property (nonatomic, assign, readwrite) BOOL hasDomainCredit; @property (nonatomic, strong, readwrite, nullable) NSString *icon; -@property (nonatomic, assign, readwrite) SiteVisibility siteVisibility; @property (nonatomic, strong, readwrite, nullable) NSNumber *planID; @property (nonatomic, strong, readwrite, nullable) NSString *planTitle; @property (nonatomic, strong, readwrite, nullable) NSArray *planActiveFeatures; @@ -174,7 +172,7 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { @property (nullable, nonatomic, retain) NSSet *pageTemplateCategories; /** - * @details Maps to a BlogSettings instance, which contains a collection of the available preferences, + * @details Maps to a BlogSettings instance, which contains a collection of the available preferences, * and their values. */ @property (nonatomic, strong, readwrite, nullable) BlogSettings *settings; @@ -250,23 +248,17 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { - (NSString *)adminUrlWithPath:(NSString *)path; - (NSDictionary *) getImageResizeDimensions; - (BOOL)supportsFeaturedImages; -- (BOOL)supports:(BlogFeature)feature; -- (BOOL)supportsPublicize; - (BOOL)supportsShareButtons; - (BOOL)isStatsActive; - (BOOL)hasMappedDomain; /** * Returnst the text description for a post format code - * - * @param postFormatCode of the post format you want to display - * - * @return a string with the post format description and if no description was found the postFormatCode sent. */ - (nullable NSString *)postFormatTextFromSlug:(nullable NSString *)postFormatSlug; /** Returns a human readable description for logging - + Instead of inspecting the core data object, this returns select information, more useful for support. */ @@ -296,7 +288,7 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { /** Call this method to know if the blog is hosted at WPcom or accessed through Jetpack. - + @return YES if the blog is hosted at WPcom or if it's connected through Jetpack. NO otherwise. */ @@ -313,6 +305,13 @@ typedef NS_ENUM(NSInteger, SiteVisibility) { /// @param requiredVersion The minimum version to check for - (BOOL)hasRequiredWordPressVersion:(NSString *)requiredVersion; +#pragma mark - Exposed to Swift + +- (BOOL)supportsRestApi; +- (BOOL)supportsJetpackImageSettings; +- (BOOL)supportsJetpackSettings; +- (BOOL)jetpackSharingButtonsModuleEnabled; + @end NS_ASSUME_NONNULL_END diff --git a/Modules/Sources/WordPressDataObjC/include/CoreDataService.h b/WordPress/WordPressData/Objective-C/include/CoreDataService.h similarity index 94% rename from Modules/Sources/WordPressDataObjC/include/CoreDataService.h rename to WordPress/WordPressData/Objective-C/include/CoreDataService.h index b85ca6bbb672..a9236585dd81 100644 --- a/Modules/Sources/WordPressDataObjC/include/CoreDataService.h +++ b/WordPress/WordPressData/Objective-C/include/CoreDataService.h @@ -1,5 +1,5 @@ #import -#import "CoreDataStack.h" +#import NS_ASSUME_NONNULL_BEGIN diff --git a/Modules/Sources/WordPressDataObjC/include/CoreDataStack.h b/WordPress/WordPressData/Objective-C/include/CoreDataStack.h similarity index 100% rename from Modules/Sources/WordPressDataObjC/include/CoreDataStack.h rename to WordPress/WordPressData/Objective-C/include/CoreDataStack.h diff --git a/WordPress/Classes/Services/LocalCoreDataService.h b/WordPress/WordPressData/Objective-C/include/LocalCoreDataService.h similarity index 100% rename from WordPress/Classes/Services/LocalCoreDataService.h rename to WordPress/WordPressData/Objective-C/include/LocalCoreDataService.h diff --git a/WordPress/Classes/Models/Media.h b/WordPress/WordPressData/Objective-C/include/Media.h similarity index 98% rename from WordPress/Classes/Models/Media.h rename to WordPress/WordPressData/Objective-C/include/Media.h index 79f71ba680da..d9ee4a313047 100644 --- a/WordPress/Classes/Models/Media.h +++ b/WordPress/WordPressData/Objective-C/include/Media.h @@ -1,6 +1,6 @@ #import -#import "Blog.h" -#import "AbstractPost.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/WordPress/Classes/Models/PostCategory.h b/WordPress/WordPressData/Objective-C/include/PostCategory.h similarity index 95% rename from WordPress/Classes/Models/PostCategory.h rename to WordPress/WordPressData/Objective-C/include/PostCategory.h index 00501aef5e9c..a85aa53eac66 100644 --- a/WordPress/Classes/Models/PostCategory.h +++ b/WordPress/WordPressData/Objective-C/include/PostCategory.h @@ -1,5 +1,5 @@ #import -#import "Blog.h" +#import extern NSString * const PostCategoryEntityName; extern NSString * const PostCategoryNameKey; diff --git a/WordPress/Classes/Models/PostContentProvider.h b/WordPress/WordPressData/Objective-C/include/PostContentProvider.h similarity index 100% rename from WordPress/Classes/Models/PostContentProvider.h rename to WordPress/WordPressData/Objective-C/include/PostContentProvider.h diff --git a/WordPress/Classes/Services/PostHelper.h b/WordPress/WordPressData/Objective-C/include/PostHelper.h similarity index 95% rename from WordPress/Classes/Services/PostHelper.h rename to WordPress/WordPressData/Objective-C/include/PostHelper.h index 989e0c4a1ce7..b4b40e7e2cf4 100644 --- a/WordPress/Classes/Services/PostHelper.h +++ b/WordPress/WordPressData/Objective-C/include/PostHelper.h @@ -1,6 +1,6 @@ #import #import -#import "PostService.h" +#import @class AbstractPost, RemotePost; diff --git a/WordPress/Classes/Services/PostService.h b/WordPress/WordPressData/Objective-C/include/PostService.h similarity index 96% rename from WordPress/Classes/Services/PostService.h rename to WordPress/WordPressData/Objective-C/include/PostService.h index 3838789a822d..6cc63208bcac 100644 --- a/WordPress/Classes/Services/PostService.h +++ b/WordPress/WordPressData/Objective-C/include/PostService.h @@ -1,6 +1,6 @@ #import -#import "LocalCoreDataService.h" -#import "PostServiceOptions.h" +#import +#import @class AbstractPost; @class Blog; diff --git a/WordPress/Classes/Services/PostServiceOptions.h b/WordPress/WordPressData/Objective-C/include/PostServiceOptions.h similarity index 96% rename from WordPress/Classes/Services/PostServiceOptions.h rename to WordPress/WordPressData/Objective-C/include/PostServiceOptions.h index 6871c9abf3d9..a42173b46d6d 100644 --- a/WordPress/Classes/Services/PostServiceOptions.h +++ b/WordPress/WordPressData/Objective-C/include/PostServiceOptions.h @@ -1,4 +1,4 @@ -@import WordPressKit; +#import /** @class PostServiceSyncOptions diff --git a/WordPress/Classes/Models/ReaderPost.h b/WordPress/WordPressData/Objective-C/include/ReaderPost.h similarity index 99% rename from WordPress/Classes/Models/ReaderPost.h rename to WordPress/WordPressData/Objective-C/include/ReaderPost.h index 9df28a7e0e8c..38e7cbd80337 100644 --- a/WordPress/Classes/Models/ReaderPost.h +++ b/WordPress/WordPressData/Objective-C/include/ReaderPost.h @@ -1,6 +1,6 @@ #import #import -#import "BasePost.h" +#import typedef NS_ENUM(NSUInteger, SourceAttributionStyle) { SourceAttributionStyleNone, @@ -103,4 +103,3 @@ extern NSString * const ReaderPostStoredCommentTextKey; - (void)removeComments:(NSSet *)values; @end - diff --git a/WordPress/Classes/Models/SourcePostAttribution.h b/WordPress/WordPressData/Objective-C/include/SourcePostAttribution.h similarity index 100% rename from WordPress/Classes/Models/SourcePostAttribution.h rename to WordPress/WordPressData/Objective-C/include/SourcePostAttribution.h diff --git a/WordPress/Classes/Models/WPAccount.h b/WordPress/WordPressData/Objective-C/include/WPAccount.h similarity index 100% rename from WordPress/Classes/Models/WPAccount.h rename to WordPress/WordPressData/Objective-C/include/WPAccount.h diff --git a/WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/.xccurrentversion similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/.xccurrentversion rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/.xccurrentversion diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 10.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 100.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 100.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 100.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 100.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 101.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 101.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 101.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 101.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 102.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 102.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 102.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 102.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 103.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 103.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 103.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 103.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 104.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 104.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 104.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 104.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 105.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 105.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 105.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 105.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 106.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 106.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 106.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 106.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 107.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 107.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 107.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 107.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 108.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 108.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 108.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 108.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 109.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 109.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 109.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 109.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 11.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 110.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 110.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 110.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 110.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 111.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 111.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 111.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 111.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 112.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 112.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 112.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 112.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 113.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 113.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 113.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 113.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 114.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 114.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 114.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 114.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 115.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 115.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 115.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 115.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 116.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 116.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 116.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 116.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 117.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 117.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 117.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 117.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 118.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 118.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 118.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 118.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 119.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 119.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 119.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 119.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 12.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 120.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 120.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 120.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 120.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 121.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 121.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 121.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 121.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 122.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 122.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 122.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 122.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 123.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 123.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 123.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 123.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 124.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 124.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 124.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 124.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 125.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 125.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 125.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 125.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 126.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 126.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 126.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 126.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 127.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 127.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 127.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 127.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 128.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 128.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 128.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 128.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 129.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 129.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 129.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 129.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 13.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 13.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 13.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 13.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 130.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 130.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 130.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 130.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 131.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 131.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 131.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 131.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 132.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 132.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 132.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 132.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 133.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 133.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 133.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 133.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 134.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 134.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 134.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 134.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 135.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 135.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 135.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 135.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 136.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 136.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 136.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 136.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 137.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 137.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 137.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 137.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 138.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 138.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 138.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 138.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 139.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 139.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 139.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 139.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 14.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 14.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 14.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 14.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 140.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 140.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 140.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 140.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 141.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 141.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 141.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 141.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 142.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 142.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 142.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 142.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 143.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 143.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 143.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 143.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 144.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 144.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 144.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 144.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 145.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 145.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 145.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 145.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 146.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 146.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 146.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 146.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 147.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 147.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 147.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 147.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 148.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 148.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 148.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 148.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 149.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 149.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 149.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 149.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 15.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 15.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 15.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 15.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 150.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 150.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 150.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 150.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 151.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 151.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 151.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 151.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 152.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 152.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 152.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 152.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 153.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 153.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 153.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 153.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 154.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 154.xcdatamodel/contents similarity index 96% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 154.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 154.xcdatamodel/contents index 2267cb2313e1..c3984b9cbf2c 100644 --- a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 154.xcdatamodel/contents +++ b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 154.xcdatamodel/contents @@ -1,5 +1,5 @@ - + @@ -54,7 +54,7 @@ - + @@ -204,7 +204,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -226,7 +226,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -244,7 +244,7 @@ - + @@ -345,19 +345,19 @@ - + - + - + - + @@ -506,7 +506,7 @@ - + @@ -520,7 +520,7 @@ - + @@ -534,12 +534,12 @@ - + - + @@ -577,7 +577,7 @@ - + @@ -598,14 +598,14 @@ - + - + @@ -625,7 +625,7 @@ - + @@ -642,13 +642,13 @@ - + - + @@ -656,9 +656,9 @@ - + - + @@ -739,7 +739,7 @@ - + @@ -749,18 +749,18 @@ - - + + - + - + @@ -778,17 +778,17 @@ - + - + - + @@ -800,7 +800,7 @@ - + @@ -809,13 +809,13 @@ - + - + @@ -879,4 +879,4 @@ - \ No newline at end of file + diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 16.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 16.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 16.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 16.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 17.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 17.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 17.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 17.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 18.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 18.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 18.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 18.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 19.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 19.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 19.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 19.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 2.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 20.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 20.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 20.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 20.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 21.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 21.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 21.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 21.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 22.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 22.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 22.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 22.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 23.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 23.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 23.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 23.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 24.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 24.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 24.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 24.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 25.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 25.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 25.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 25.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 26.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 26.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 26.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 26.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 27.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 27.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 27.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 27.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 28.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 28.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 28.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 28.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 29.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 29.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 29.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 29.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 3.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 30.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 30.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 30.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 30.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 31.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 31.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 31.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 31.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 32.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 32.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 32.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 32.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 33.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 33.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 33.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 33.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 34.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 34.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 34.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 34.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 35.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 35.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 35.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 35.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 36.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 36.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 36.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 36.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 37.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 37.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 37.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 37.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 38.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 38.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 38.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 38.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 39.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 39.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 39.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 39.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 4.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 40.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 40.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 40.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 40.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 41.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 41.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 41.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 41.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 42.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 42.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 42.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 42.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 43.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 43.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 43.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 43.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 44.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 44.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 44.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 44.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 45.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 45.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 45.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 45.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 46.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 46.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 46.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 46.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 47.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 47.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 47.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 47.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 48.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 48.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 48.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 48.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 49.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 49.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 49.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 49.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 5.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 50.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 50.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 50.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 50.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 51.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 51.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 51.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 51.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 52.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 52.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 52.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 52.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 53.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 53.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 53.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 53.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 54.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 54.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 54.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 54.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 55.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 55.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 55.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 55.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 56.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 56.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 56.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 56.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 57.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 57.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 57.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 57.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 58.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 58.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 58.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 58.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 59.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 59.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 59.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 59.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 6.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 60.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 60.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 60.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 60.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 61.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 61.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 61.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 61.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 62.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 62.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 62.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 62.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 63.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 63.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 63.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 63.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 64.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 64.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 64.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 64.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 65.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 65.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 65.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 65.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 66.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 66.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 66.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 66.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 67.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 67.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 67.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 67.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 68.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 68.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 68.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 68.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 69.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 69.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 69.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 69.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 7.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 70.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 70.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 70.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 70.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 71.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 71.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 71.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 71.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 72.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 72.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 72.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 72.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 73.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 73.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 73.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 73.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 74.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 74.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 74.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 74.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 75.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 75.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 75.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 75.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 76.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 76.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 76.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 76.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 77.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 77.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 77.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 77.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 78.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 78.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 78.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 78.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 79.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 79.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 79.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 79.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 8.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 80.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 80.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 80.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 80.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 81.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 81.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 81.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 81.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 82.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 82.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 82.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 82.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 83.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 83.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 83.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 83.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 84.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 84.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 84.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 84.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 85.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 85.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 85.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 85.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 86.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 86.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 86.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 86.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 87.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 87.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 87.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 87.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 88.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 88.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 88.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 88.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 89.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 89.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 89.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 89.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 9.xcdatamodel/layout diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 90.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 90.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 90.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 90.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 91.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 91.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 91.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 91.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 92.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 92.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 92.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 92.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 93.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 93.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 93.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 93.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 94.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 94.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 94.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 94.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 95.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 95.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 95.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 95.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 96.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 96.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 96.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 96.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 97.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 97.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 97.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 97.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 98.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 98.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 98.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 98.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress 99.xcdatamodel/contents b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 99.xcdatamodel/contents similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress 99.xcdatamodel/contents rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress 99.xcdatamodel/contents diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress.xcdatamodel/elements b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress.xcdatamodel/elements similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress.xcdatamodel/elements rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress.xcdatamodel/elements diff --git a/WordPress/Classes/WordPress.xcdatamodeld/WordPress.xcdatamodel/layout b/WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress.xcdatamodel/layout similarity index 100% rename from WordPress/Classes/WordPress.xcdatamodeld/WordPress.xcdatamodel/layout rename to WordPress/WordPressData/Resources/WordPress.xcdatamodeld/WordPress.xcdatamodel/layout diff --git a/WordPress/Classes/Models/AbstractPost+Autosave.swift b/WordPress/WordPressData/Swift/AbstractPost+Autosave.swift similarity index 100% rename from WordPress/Classes/Models/AbstractPost+Autosave.swift rename to WordPress/WordPressData/Swift/AbstractPost+Autosave.swift diff --git a/WordPress/Classes/Models/AbstractPost+Blaze.swift b/WordPress/WordPressData/Swift/AbstractPost+Blaze.swift similarity index 100% rename from WordPress/Classes/Models/AbstractPost+Blaze.swift rename to WordPress/WordPressData/Swift/AbstractPost+Blaze.swift diff --git a/WordPress/Classes/Models/AbstractPost+Local.swift b/WordPress/WordPressData/Swift/AbstractPost+Local.swift similarity index 100% rename from WordPress/Classes/Models/AbstractPost+Local.swift rename to WordPress/WordPressData/Swift/AbstractPost+Local.swift diff --git a/WordPress/Classes/Models/AbstractPost+Searchable.swift b/WordPress/WordPressData/Swift/AbstractPost+Searchable.swift similarity index 100% rename from WordPress/Classes/Models/AbstractPost+Searchable.swift rename to WordPress/WordPressData/Swift/AbstractPost+Searchable.swift diff --git a/WordPress/Classes/Models/AbstractPost.swift b/WordPress/WordPressData/Swift/AbstractPost.swift similarity index 96% rename from WordPress/Classes/Models/AbstractPost.swift rename to WordPress/WordPressData/Swift/AbstractPost.swift index cccfdb1fc15a..c11c4c08f766 100644 --- a/WordPress/Classes/Models/AbstractPost.swift +++ b/WordPress/WordPressData/Swift/AbstractPost.swift @@ -1,7 +1,8 @@ import Foundation +import WordPressKit import WordPressShared -extension AbstractPost { +public extension AbstractPost { /// Returns the original post by navigating the entire list of revisions /// until it reaches the head. func original() -> AbstractPost { @@ -106,7 +107,7 @@ extension AbstractPost { /// The keyPath to access the underlying property. /// - var keyPath: String { + public var keyPath: String { switch self { case .dateCreated: return #keyPath(AbstractPost.date_created_gmt) @@ -140,7 +141,7 @@ extension AbstractPost { } } - @objc override open func featuredImageURLForDisplay() -> URL? { + @objc override func featuredImageURLForDisplay() -> URL? { return featuredImageURL } @@ -211,7 +212,9 @@ extension AbstractPost { // - warning: The use of `.original` is intentional – we want to get // the previous revision in the list. guard let previous = revision.original else { - return wpAssertionFailure("missing original") + // FIXME: Delaying wpAssert migration because of underlying dependencies + // return wpAssertionFailure("missing original") + return } let original = revision.original() previous.deleteRevision() diff --git a/WordPress/Classes/Extensions/Array+Page.swift b/WordPress/WordPressData/Swift/Array+Page.swift similarity index 100% rename from WordPress/Classes/Extensions/Array+Page.swift rename to WordPress/WordPressData/Swift/Array+Page.swift diff --git a/WordPress/Classes/Models/BasePost.swift b/WordPress/WordPressData/Swift/BasePost.swift similarity index 100% rename from WordPress/Classes/Models/BasePost.swift rename to WordPress/WordPressData/Swift/BasePost.swift diff --git a/WordPress/Classes/Models/Gutenberg/BlockEditorSettingElement+CoreDataClass.swift b/WordPress/WordPressData/Swift/BlockEditorSettingElement+CoreDataClass.swift similarity index 100% rename from WordPress/Classes/Models/Gutenberg/BlockEditorSettingElement+CoreDataClass.swift rename to WordPress/WordPressData/Swift/BlockEditorSettingElement+CoreDataClass.swift diff --git a/WordPress/Classes/Models/Gutenberg/BlockEditorSettingElement+CoreDataProperties.swift b/WordPress/WordPressData/Swift/BlockEditorSettingElement+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/Gutenberg/BlockEditorSettingElement+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/BlockEditorSettingElement+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/Gutenberg/BlockEditorSettings+CoreDataClass.swift b/WordPress/WordPressData/Swift/BlockEditorSettings+CoreDataClass.swift similarity index 100% rename from WordPress/Classes/Models/Gutenberg/BlockEditorSettings+CoreDataClass.swift rename to WordPress/WordPressData/Swift/BlockEditorSettings+CoreDataClass.swift diff --git a/WordPress/Classes/Models/Gutenberg/BlockEditorSettings+CoreDataProperties.swift b/WordPress/WordPressData/Swift/BlockEditorSettings+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/Gutenberg/BlockEditorSettings+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/BlockEditorSettings+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/Blocking/BlockedAuthor.swift b/WordPress/WordPressData/Swift/BlockedAuthor.swift similarity index 100% rename from WordPress/Classes/Models/Blocking/BlockedAuthor.swift rename to WordPress/WordPressData/Swift/BlockedAuthor.swift index 19940af1dce9..92878957cbe0 100644 --- a/WordPress/Classes/Models/Blocking/BlockedAuthor.swift +++ b/WordPress/WordPressData/Swift/BlockedAuthor.swift @@ -1,5 +1,5 @@ -import Foundation import CocoaLumberjackSwift +import Foundation @objc(BlockedAuthor) public final class BlockedAuthor: NSManagedObject { diff --git a/WordPress/Classes/Models/Blocking/BlockedSite.swift b/WordPress/WordPressData/Swift/BlockedSite.swift similarity index 100% rename from WordPress/Classes/Models/Blocking/BlockedSite.swift rename to WordPress/WordPressData/Swift/BlockedSite.swift diff --git a/WordPress/Classes/Models/Blog/Blog+BlockEditorSettings.swift b/WordPress/WordPressData/Swift/Blog+BlockEditorSettings.swift similarity index 100% rename from WordPress/Classes/Models/Blog/Blog+BlockEditorSettings.swift rename to WordPress/WordPressData/Swift/Blog+BlockEditorSettings.swift diff --git a/WordPress/Classes/Models/Blog/Blog+BlogAuthors.swift b/WordPress/WordPressData/Swift/Blog+BlogAuthors.swift similarity index 100% rename from WordPress/Classes/Models/Blog/Blog+BlogAuthors.swift rename to WordPress/WordPressData/Swift/Blog+BlogAuthors.swift diff --git a/WordPress/Classes/Models/Blog/Blog+Capabilities.swift b/WordPress/WordPressData/Swift/Blog+Capabilities.swift similarity index 97% rename from WordPress/Classes/Models/Blog/Blog+Capabilities.swift rename to WordPress/WordPressData/Swift/Blog+Capabilities.swift index 560f33cc408a..4d15df09e7db 100644 --- a/WordPress/Classes/Models/Blog/Blog+Capabilities.swift +++ b/WordPress/WordPressData/Swift/Blog+Capabilities.swift @@ -84,7 +84,7 @@ extension Blog { /// /// - Returns: Whether site management is permitted /// - @objc func supportsSiteManagementServices() -> Bool { + @objc public func supportsSiteManagementServices() -> Bool { return isHostedAtWPcom && isAdmin } } diff --git a/WordPress/Classes/Models/Blog/Blog+HomepageSettings.swift b/WordPress/WordPressData/Swift/Blog+HomepageSettings.swift similarity index 100% rename from WordPress/Classes/Models/Blog/Blog+HomepageSettings.swift rename to WordPress/WordPressData/Swift/Blog+HomepageSettings.swift diff --git a/WordPress/Classes/Models/Blog/Blog+Jetpack.swift b/WordPress/WordPressData/Swift/Blog+Jetpack.swift similarity index 100% rename from WordPress/Classes/Models/Blog/Blog+Jetpack.swift rename to WordPress/WordPressData/Swift/Blog+Jetpack.swift diff --git a/WordPress/Classes/Models/Blog/Blog+Plans.swift b/WordPress/WordPressData/Swift/Blog+Plans.swift similarity index 100% rename from WordPress/Classes/Models/Blog/Blog+Plans.swift rename to WordPress/WordPressData/Swift/Blog+Plans.swift diff --git a/WordPress/Classes/Models/Blog/Blog+Post.swift b/WordPress/WordPressData/Swift/Blog+Post.swift similarity index 100% rename from WordPress/Classes/Models/Blog/Blog+Post.swift rename to WordPress/WordPressData/Swift/Blog+Post.swift diff --git a/WordPress/Classes/Models/Blog/Blog+Quota.swift b/WordPress/WordPressData/Swift/Blog+Quota.swift similarity index 100% rename from WordPress/Classes/Models/Blog/Blog+Quota.swift rename to WordPress/WordPressData/Swift/Blog+Quota.swift diff --git a/WordPress/WordPressData/Swift/Blog.swift b/WordPress/WordPressData/Swift/Blog.swift new file mode 100644 index 000000000000..fa5fb743ce15 --- /dev/null +++ b/WordPress/WordPressData/Swift/Blog.swift @@ -0,0 +1,239 @@ +extension Blog { + + static let jetpackProfessionalYearlyPlanId = 2004 + static let jetpackProfessionalMonthlyPlanId = 2001 + + /// WordPress.com site ID stored as signed 32-bit integer + @objc + public var dotComID: NSNumber? { + get { + let key = "blogID" + willAccessValue(forKey: key) + + guard var id = primitiveValue(forKey: key) as? NSNumber else { + didAccessValue(forKey: key) + return nil + } + + if id.intValue == 0 { + if let id = jetpack?.siteID { + self.dotComID = id + } + id = 0 + } + + didAccessValue(forKey: key) + return id + } + set(value) { + let key = "blogID" + willChangeValue(forKey: key) + setPrimitiveValue(value, forKey: key) + didChangeValue(forKey: key) + } + } + + @objc + public var siteVisibility: SiteVisibility { + get { + guard let privacy = settings?.privacy?.intValue else { + return .unknown + } + + guard let visibility = SiteVisibility(rawValue: privacy) else { + return .unknown + } + + return visibility + } + set(value) { + settings?.privacy = NSNumber(value: value.rawValue) + } + } + + open override func willSave() { + super.willSave() + + // The `dotComID` getter has a speicial code to _update_ `blogID` value. + // This is a weird patch to make sure `blogID` is set to a correct value. + // + // It's important that calling `[self dotComID]` repeatedly only updates + // `Blog` instance once, which is the case at the moment. + _ = dotComID + } + + @objc + public func supports(_ feature: BlogFeature) -> Bool { + switch feature { + case .removable: + return accountIsDefaultAccount + case .visibility: + // See -[BlogListViewController fetchRequestPredicateForHideableBlogs] + // If the logic for this changes that needs to be updated as well + return accountIsDefaultAccount + case .people: + return supportsRestApi() && isListingUsersAllowed() + case .wpComRESTAPI, .commentLikes: + return supportsRestApi() + case .stats: + return supportsRestApi() && isViewingStatsAllowed() + case .stockPhotos: + // FIXME: JetpackFeaturesRemovalCoordinator not available yet +// return supportsRestApi() && JetpackFeaturesRemovalCoordinator.jetpackFeaturesEnabled() + return supportsRestApi() + case .tenor: + // FIXME: JetpackFeaturesRemovalCoordinator not available yet +// return JetpackFeaturesRemovalCoordinator.jetpackFeaturesEnabled() + fatalError() + case .sharing: + return supportsSharing + case .oAuth2Login: + return isHostedAtWPcom + case .mentions, .xposts: + return isAccessibleThroughWPCom() + case .reblog, .plans: + return isHostedAtWPcom && isAdmin + case .pluginManagement: + return supportsPluginManagement && isAdmin + case .jetpackImageSettings: + return supportsJetpackImageSettings() + case .jetpackSettings: + return supportsJetpackSettings() + case .pushNotifications: + return supportsPushNotifications + case .themeBrowsing: + return supportsRestApi() && isAdmin + case .activity: + return supportsRestApi() && isAdmin + case .customThemes: + return supportsRestApi() && isAdmin && !isHostedAtWPcom + case .premiumThemes: + guard supports(.customThemes) else { return false } + guard let planID else { return false } + + return planID.intValue == Blog.jetpackProfessionalYearlyPlanId || planID.intValue == Blog.jetpackProfessionalMonthlyPlanId + case .menus: + return supportsRestApi() && isAdmin + case .private: + return isHostedAtWPcom + case .siteManagement: + return supportsSiteManagementServices() + case .domains: + return (isHostedAtWPcom || isAtomic()) && isAdmin && !isWPForTeams() + case .noncePreviews: + return supportsRestApi() && !isHostedAtWPcom + case .mediaMetadataEditing: + return isAdmin + case .mediaAltEditing: + // See: + // - https://core.trac.wordpress.org/ticket/58582 + // - https://github.com/wordpress-mobile/WordPress-Android/issues/18514#issuecomment-1589752274 + return supportsRestApi() + case .mediaDeletion: + return isAdmin + case .homepageSettings: + return supportsRestApi() && isAdmin + case .contactInfo: + return hasRequiredWordPressVersion("5.6") + case .blockEditorSettings: + return supportsBlockEditorSettings() + case .layoutGrid: + return isHostedAtWPcom || isAtomic() + case .tiledGallery: + return isHostedAtWPcom + case .videoPress: + return isHostedAtWPcom + case .videoPressV5: + return isHostedAtWPcom && isAtomic() && hasRequiredWordPressVersion("5.8") + case .facebookEmbed: + return supportsEmbedVariation("9.0") + case .instagramEmbed: + return supportsEmbedVariation("9.0") + case .loomEmbed: + return supportsEmbedVariation("9.0") + case .smartframeEmbed: + return supportsEmbedVariation("10.2") + case .fileDownloadsStats: + return isHostedAtWPcom + case .blaze: + return canBlaze + case .pages: + return isListingPagesAllowed() + case .siteMonitoring: + return isAdmin && isAtomic() + @unknown default: + fatalError() + } + } + + @objc + public func supportsPublicize() -> Bool { + guard supports(.wpComRESTAPI) else { return false } + guard isPublishingPostsAllowed() else { return false } + + if isHostedAtWPcom { + return !((getOptionValue(OptionsKeys.publicizeDisabled) as? Bool) ?? true) + } else { + return isJetpackModuleActive(name: ModuleKeys.publicize) + } + } + + private var accountIsDefaultAccount: Bool { + account?.isDefaultWordPressComAccount ?? false + } + + private var supportsPushNotifications: Bool { + accountIsDefaultAccount + } + + private func hasRequiredJetpackVersion(_ version: String) -> Bool { + guard let jetpackVersion = jetpack?.version else { return false } + + return supportsRestApi() + && !isHostedAtWPcom + && jetpackVersion.compare(version, options: .numeric) != .orderedAscending + } + + private func supportsEmbedVariation(_ variation: String) -> Bool { + hasRequiredJetpackVersion(variation) || isHostedAtWPcom + } + + private var supportsSharing: Bool { + supportsPublicize() || supportsShareButtons() + } + + private func supportsShareButtons() -> Bool { + guard isAdmin else { return false } + guard supports(.wpComRESTAPI) else { return false } + + return isHostedAtWPcom ? true : jetpackSharingButtonsModuleEnabled() + } + + private var supportsPluginManagement: Bool { + let isTransferrable = isHostedAtWPcom && hasBusinessPlan && siteVisibility != .private + + var supports = isTransferrable || hasRequiredJetpackVersion("5.6") + + // If the site is not hosted on WP.com we can still manage plugins directly using the WP.org rest API + // Reference: https://make.wordpress.org/core/2020/07/16/new-and-modified-rest-api-endpoints-in-wordpress-5-5/ + if (supports == false) && (account == nil) { + supports = !isHostedAtWPcom && (selfHostedSiteRestApi != nil) && hasRequiredWordPressVersion("5.5") + } + + return supports + } + + private func isJetpackModuleActive(name: String) -> Bool { + let activeModules = getOptionValue(OptionsKeys.activeModules) as? [String] ?? [] + return activeModules.contains(name) + } + + private struct OptionsKeys { + static let activeModules = "active_modules" + static let publicizeDisabled = "publicize_permanently_disabled" + } + + private struct ModuleKeys { + static let publicize = "publicize" + } +} diff --git a/WordPress/Classes/Models/Blog/BlogAuthor.swift b/WordPress/WordPressData/Swift/BlogAuthor.swift similarity index 100% rename from WordPress/Classes/Models/Blog/BlogAuthor.swift rename to WordPress/WordPressData/Swift/BlogAuthor.swift diff --git a/WordPress/Classes/Utility/BlogQuery.swift b/WordPress/WordPressData/Swift/BlogQuery.swift similarity index 100% rename from WordPress/Classes/Utility/BlogQuery.swift rename to WordPress/WordPressData/Swift/BlogQuery.swift diff --git a/WordPress/Classes/Models/Blog/BlogSettings.swift b/WordPress/WordPressData/Swift/BlogSettings.swift similarity index 100% rename from WordPress/Classes/Models/Blog/BlogSettings.swift rename to WordPress/WordPressData/Swift/BlogSettings.swift diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/BloggingPromptsAttribution.swift b/WordPress/WordPressData/Swift/BlogginPromptsAttribution.swift similarity index 100% rename from WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Prompts/BloggingPromptsAttribution.swift rename to WordPress/WordPressData/Swift/BlogginPromptsAttribution.swift diff --git a/WordPress/Classes/Models/BloggingPrompt+CoreDataClass.swift b/WordPress/WordPressData/Swift/BloggingPrompt+CoreDataClass.swift similarity index 90% rename from WordPress/Classes/Models/BloggingPrompt+CoreDataClass.swift rename to WordPress/WordPressData/Swift/BloggingPrompt+CoreDataClass.swift index b107887267a9..c429008c4c22 100644 --- a/WordPress/Classes/Models/BloggingPrompt+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/BloggingPrompt+CoreDataClass.swift @@ -17,7 +17,7 @@ public class BloggingPrompt: NSManagedObject { self.displayAvatarURLs = [] } - var promptAttribution: BloggingPromptsAttribution? { + public var promptAttribution: BloggingPromptsAttribution? { BloggingPromptsAttribution(rawValue: attribution.lowercased()) } @@ -26,7 +26,7 @@ public class BloggingPrompt: NSManagedObject { /// - Parameters: /// - remotePrompt: The remote prompt model to convert /// - siteID: The ID of the site that the prompt is intended for - func configure(with remotePrompt: BloggingPromptRemoteObject, for siteID: Int32) { + public func configure(with remotePrompt: BloggingPromptRemoteObject, for siteID: Int32) { self.promptID = Int32(remotePrompt.promptID) self.siteID = siteID self.text = remotePrompt.text @@ -42,7 +42,7 @@ public class BloggingPrompt: NSManagedObject { } } - func textForDisplay() -> String { + public func textForDisplay() -> String { return text.stringByDecodingXMLCharacters().trim() } @@ -54,24 +54,24 @@ public class BloggingPrompt: NSManagedObject { /// - Parameters: /// - localDate: The date to compare against in local timezone. /// - Returns: True if the year, month, and day components of the `localDate` matches the prompt's localized date. - func inSameDay(as dateToCompare: Date) -> Bool { + public func inSameDay(as dateToCompare: Date) -> Bool { return DateFormatters.utc.string(from: date) == DateFormatters.local.string(from: dateToCompare) } /// Used for comparison on upsert – there can't be two `BloggingPrompt` objects with the same date, so we can use it as a unique identifier @objc - var dateString: String { + public var dateString: String { DateFormatters.local.string(from: date) } } // MARK: - Notification Payload -extension BloggingPrompt { +public extension BloggingPrompt { struct NotificationKeys { - static let promptID = "prompt_id" - static let siteID = "site_id" + public static let promptID = "prompt_id" + public static let siteID = "site_id" } } diff --git a/WordPress/Classes/Models/BloggingPrompt+CoreDataProperties.swift b/WordPress/WordPressData/Swift/BloggingPrompt+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/BloggingPrompt+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/BloggingPrompt+CoreDataProperties.swift diff --git a/WordPress/Classes/Services/BloggingPrompts/BloggingPromptRemoteObject.swift b/WordPress/WordPressData/Swift/BloggingPromptRemoteObject.swift similarity index 100% rename from WordPress/Classes/Services/BloggingPrompts/BloggingPromptRemoteObject.swift rename to WordPress/WordPressData/Swift/BloggingPromptRemoteObject.swift diff --git a/WordPress/Classes/Models/BloggingPromptSettings+CoreDataClass.swift b/WordPress/WordPressData/Swift/BloggingPromptSettings+CoreDataClass.swift similarity index 87% rename from WordPress/Classes/Models/BloggingPromptSettings+CoreDataClass.swift rename to WordPress/WordPressData/Swift/BloggingPromptSettings+CoreDataClass.swift index a14862d0d751..fa378726ad05 100644 --- a/WordPress/Classes/Models/BloggingPromptSettings+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/BloggingPromptSettings+CoreDataClass.swift @@ -4,7 +4,7 @@ import WordPressKit public class BloggingPromptSettings: NSManagedObject { - static func of(_ blog: Blog) throws -> BloggingPromptSettings? { + public static func of(_ blog: Blog) throws -> BloggingPromptSettings? { guard let context = blog.managedObjectContext else { return nil } // This getting site id logic is copied from the BloggingPromptsService initializer. @@ -20,14 +20,14 @@ public class BloggingPromptSettings: NSManagedObject { return try lookup(withSiteID: siteID, in: context) } - static func lookup(withSiteID siteID: NSNumber, in context: NSManagedObjectContext) throws -> BloggingPromptSettings? { + public static func lookup(withSiteID siteID: NSNumber, in context: NSManagedObjectContext) throws -> BloggingPromptSettings? { let fetchRequest = BloggingPromptSettings.fetchRequest() fetchRequest.predicate = NSPredicate(format: "\(#keyPath(BloggingPromptSettings.siteID)) = %@", siteID) fetchRequest.fetchLimit = 1 return try context.fetch(fetchRequest).first } - func reminderTimeDate() -> Date? { + public func reminderTimeDate() -> Date? { guard let reminderTime else { return nil } @@ -37,7 +37,7 @@ public class BloggingPromptSettings: NSManagedObject { } } -extension RemoteBloggingPromptsSettings { +public extension RemoteBloggingPromptsSettings { init(with model: BloggingPromptSettings) { self.init(promptCardEnabled: model.promptCardEnabled, diff --git a/WordPress/Classes/Models/BloggingPromptSettings+CoreDataProperties.swift b/WordPress/WordPressData/Swift/BloggingPromptSettings+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/BloggingPromptSettings+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/BloggingPromptSettings+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/BloggingPromptSettingsReminderDays+CoreDataClass.swift b/WordPress/WordPressData/Swift/BloggingPromptSettingsReminderDays+CoreDataClass.swift similarity index 83% rename from WordPress/Classes/Models/BloggingPromptSettingsReminderDays+CoreDataClass.swift rename to WordPress/WordPressData/Swift/BloggingPromptSettingsReminderDays+CoreDataClass.swift index 65470be74594..4b4c0936cb88 100644 --- a/WordPress/Classes/Models/BloggingPromptSettingsReminderDays+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/BloggingPromptSettingsReminderDays+CoreDataClass.swift @@ -4,7 +4,7 @@ import WordPressKit public class BloggingPromptSettingsReminderDays: NSManagedObject { - func configure(with remoteReminderDays: RemoteBloggingPromptsSettings.ReminderDays) { + public func configure(with remoteReminderDays: RemoteBloggingPromptsSettings.ReminderDays) { self.monday = remoteReminderDays.monday self.tuesday = remoteReminderDays.tuesday self.wednesday = remoteReminderDays.wednesday diff --git a/WordPress/Classes/Models/BloggingPromptSettingsReminderDays+CoreDataProperties.swift b/WordPress/WordPressData/Swift/BloggingPromptSettingsReminderDays+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/BloggingPromptSettingsReminderDays+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/BloggingPromptSettingsReminderDays+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/Comment/Comment+CoreDataClass.swift b/WordPress/WordPressData/Swift/Comment+CoreDataClass.swift similarity index 86% rename from WordPress/Classes/Models/Comment/Comment+CoreDataClass.swift rename to WordPress/WordPressData/Swift/Comment+CoreDataClass.swift index b34b4ec23fa2..6e3e53c620a1 100644 --- a/WordPress/Classes/Models/Comment/Comment+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/Comment+CoreDataClass.swift @@ -4,19 +4,19 @@ import CoreData @objc(Comment) public class Comment: NSManagedObject { - @objc static func descriptionFor(_ commentStatus: CommentStatusType) -> String { + @objc public static func descriptionFor(_ commentStatus: CommentStatusType) -> String { return commentStatus.description } - @objc func authorUrlForDisplay() -> String { + @objc public func authorUrlForDisplay() -> String { return authorURL()?.host ?? String() } - @objc func contentForEdit() -> String { + @objc public func contentForEdit() -> String { return availableContent() } - @objc func isApproved() -> Bool { + @objc public func isApproved() -> Bool { return status == CommentStatusType.approved.description } @@ -31,7 +31,7 @@ public class Comment: NSManagedObject { // This can be removed when `unifiedCommentsAndNotificationsList` is permanently enabled // as it's replaced by Comment+Interface:relativeDateSectionIdentifier. - @objc func sectionIdentifier() -> String? { + @objc public func sectionIdentifier() -> String? { guard let dateCreated else { return nil } @@ -42,7 +42,7 @@ public class Comment: NSManagedObject { return formatter.string(from: dateCreated) } - @objc func commentURL() -> URL? { + @objc public func commentURL() -> URL? { guard !link.isEmpty else { return nil } @@ -50,22 +50,22 @@ public class Comment: NSManagedObject { return URL(string: link) } - @objc func deleteWillBePermanent() -> Bool { + @objc public func deleteWillBePermanent() -> Bool { return status == Comment.descriptionFor(.spam) || status == Comment.descriptionFor(.unapproved) - } + } - func canEditAuthorData() -> Bool { + public func canEditAuthorData() -> Bool { // If the authorID is zero, the user is unregistered. Therefore, the data can be edited. return authorID == 0 } - func hasParentComment() -> Bool { + public func hasParentComment() -> Bool { return parentID > 0 } /// Convenience method to check if the current user can actually moderate. /// `canModerate` is only applicable when the site is dotcom-related (hosted or atomic). For self-hosted sites, default to true. - @objc func allowsModeration() -> Bool { + @objc public func allowsModeration() -> Bool { if let _ = post as? ReaderPost { return canModerate } @@ -76,7 +76,7 @@ public class Comment: NSManagedObject { return canModerate } - func canReply() -> Bool { + public func canReply() -> Bool { if let post = post as? ReaderPost { return post.commentsOpen } @@ -84,7 +84,7 @@ public class Comment: NSManagedObject { } // NOTE: Comment Likes could be disabled, but the API doesn't have that info yet. Let's update this once it's available. - func canLike() -> Bool { + public func canLike() -> Bool { if (post as? ReaderPost) != nil { return true } @@ -95,11 +95,11 @@ public class Comment: NSManagedObject { return !isReadOnly() && blog.supports(.commentLikes) } - @objc func isTopLevelComment() -> Bool { + @objc public func isTopLevelComment() -> Bool { return depth == 0 } - func isFromPostAuthor() -> Bool { + public func isFromPostAuthor() -> Bool { guard let postAuthorID = post?.authorID?.int32Value, postAuthorID > 0, authorID > 0 else { @@ -181,7 +181,7 @@ extension Comment: PostContentProvider { } // When CommentViewController and CommentService are converted to Swift, this can be simplified to a String enum. -@objc enum CommentStatusType: Int { +@objc public enum CommentStatusType: Int { case pending case approved case unapproved @@ -190,7 +190,7 @@ extension Comment: PostContentProvider { // We can use this status to restore comment replies that the user has written. case draft - var description: String { + public var description: String { switch self { case .pending: return "hold" @@ -205,7 +205,7 @@ extension Comment: PostContentProvider { } } - static func typeForStatus(_ status: String?) -> CommentStatusType? { + public static func typeForStatus(_ status: String?) -> CommentStatusType? { switch status { case "hold": return .pending diff --git a/WordPress/Classes/Models/Comment/Comment+CoreDataProperties.swift b/WordPress/WordPressData/Swift/Comment+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/Comment/Comment+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/Comment+CoreDataProperties.swift diff --git a/WordPress/Classes/Utility/CoreData/ContextManager+ErrorHandling.swift b/WordPress/WordPressData/Swift/ContextManager+ErrorHandling.swift similarity index 99% rename from WordPress/Classes/Utility/CoreData/ContextManager+ErrorHandling.swift rename to WordPress/WordPressData/Swift/ContextManager+ErrorHandling.swift index 9d73ee139845..398f7c4de829 100644 --- a/WordPress/Classes/Utility/CoreData/ContextManager+ErrorHandling.swift +++ b/WordPress/WordPressData/Swift/ContextManager+ErrorHandling.swift @@ -1,3 +1,4 @@ +import CocoaLumberjackSwift import CoreData // Imported from CoreData.CoreDataErrors diff --git a/WordPress/Classes/Utility/CoreData/ContextManager.swift b/WordPress/WordPressData/Swift/ContextManager.swift similarity index 95% rename from WordPress/Classes/Utility/CoreData/ContextManager.swift rename to WordPress/WordPressData/Swift/ContextManager.swift index 86e91ef88930..d76472998900 100644 --- a/WordPress/Classes/Utility/CoreData/ContextManager.swift +++ b/WordPress/WordPressData/Swift/ContextManager.swift @@ -1,6 +1,6 @@ import CoreData +import CocoaLumberjackSwift import Foundation -import WordPressData import WordPressShared /// A constant representing the current version of the data model. @@ -234,13 +234,14 @@ private extension ContextManager { fatalError("Can't create object model named \(modelName) at \(modelFileURL)") } - let startupEvent = SentryStartupEvent() + // FIXME: Import the Sentry stuff, too — But it accesses the app delegate! + // let startupEvent = SentryStartupEvent() do { try migrateDataModelsIfNecessary(storeURL: storeURL, objectModel: objectModel) } catch { DDLogError("Unable to migrate store: \(error)") - startupEvent.add(error: error as NSError) + // startupEvent.add(error: error as NSError) } let storeDescription = NSPersistentStoreDescription(url: storeURL) @@ -254,16 +255,16 @@ private extension ContextManager { } DDLogError("Error opening the database. \(error)\nDeleting the file and trying again") - startupEvent.add(error: error) + // startupEvent.add(error: error) // make a backup of the old database do { try CoreDataIterativeMigrator.backupDatabase(at: storeURL) } catch { - startupEvent.add(error: error) + // startupEvent.add(error: error) } - startupEvent.send(title: "Can't initialize Core Data stack") + // startupEvent.send(title: "Can't initialize Core Data stack") objc_exception_throw( NSException( name: NSExceptionName(rawValue: "Can't initialize Core Data stack"), @@ -282,7 +283,7 @@ extension ContextManager { /// Tests purpose only static var overrideInstance: ContextManager? - @objc class func sharedInstance() -> ContextManager { + @objc public class func sharedInstance() -> ContextManager { if let overrideInstance { return overrideInstance } @@ -290,14 +291,14 @@ extension ContextManager { return ContextManager.internalSharedInstance } - static var shared: ContextManager { + public static var shared: ContextManager { return sharedInstance() } } extension ContextManager { /// - warning: This is designed to be used only for testing purposes. - func resetEverything() { + public func resetEverything() { let container = persistentContainer.persistentStoreCoordinator assert(container.persistentStores.count == 1) guard let store = container.persistentStores.first, let storeURL = store.url else { diff --git a/WordPress/Classes/Utility/CoreData/CoreDataHelper.swift b/WordPress/WordPressData/Swift/CoreDataHelper.swift similarity index 99% rename from WordPress/Classes/Utility/CoreData/CoreDataHelper.swift rename to WordPress/WordPressData/Swift/CoreDataHelper.swift index 489faeb65f6b..390c950891fa 100644 --- a/WordPress/Classes/Utility/CoreData/CoreDataHelper.swift +++ b/WordPress/WordPressData/Swift/CoreDataHelper.swift @@ -1,10 +1,11 @@ +import CocoaLumberjackSwift import Foundation import CoreData import WordPressShared // MARK: - NSManagedObject Default entityName Helper // -extension NSManagedObject { +public extension NSManagedObject { /// Returns the Entity Name, if available, as specified in the NSEntityDescription. Otherwise, will return /// the subclass name. @@ -30,7 +31,7 @@ extension NSManagedObject { // MARK: - NSManagedObjectContext Helpers! // -extension NSManagedObjectContext { +public extension NSManagedObjectContext { /// Returns all of the entities that match with a given predicate. /// @@ -191,7 +192,7 @@ extension ContextManager.ContextManagerError: LocalizedError, CustomDebugStringC } } -extension CoreDataStack { +public extension CoreDataStack { /// Perform a query using the `mainContext` and return the result. /// /// - Warning: Do not return `NSManagedObject` instances from the closure. @@ -387,7 +388,7 @@ extension CoreDataStack { /// return account.username /// } /// ``` -extension CoreDataStack { +public extension CoreDataStack { @available(*, deprecated, message: "Returning `NSManagedObject` instances may introduce Core Data concurrency issues.") func performQuery(_ block: @escaping (NSManagedObjectContext) -> T) -> T where T: NSManagedObject { mainContext.performAndWait { [mainContext] in diff --git a/WordPress/Classes/Utility/CoreData/Migrator/CoreDataIterativeMigrator.swift b/WordPress/WordPressData/Swift/CoreDataIterativeMigrator.swift similarity index 100% rename from WordPress/Classes/Utility/CoreData/Migrator/CoreDataIterativeMigrator.swift rename to WordPress/WordPressData/Swift/CoreDataIterativeMigrator.swift diff --git a/Modules/Sources/WordPressData/CoreDataStackSwift.swift b/WordPress/WordPressData/Swift/CoreDataStackSwift.swift similarity index 98% rename from Modules/Sources/WordPressData/CoreDataStackSwift.swift rename to WordPress/WordPressData/Swift/CoreDataStackSwift.swift index 2ace910b6d86..8f51d75c8415 100644 --- a/Modules/Sources/WordPressData/CoreDataStackSwift.swift +++ b/WordPress/WordPressData/Swift/CoreDataStackSwift.swift @@ -1,5 +1,4 @@ import CoreData -import WordPressDataObjC public protocol CoreDataStackSwift: CoreDataStack { diff --git a/WordPress/Classes/Models/Revisions/DiffAbstractValue.swift b/WordPress/WordPressData/Swift/DiffAbstractValue.swift similarity index 69% rename from WordPress/Classes/Models/Revisions/DiffAbstractValue.swift rename to WordPress/WordPressData/Swift/DiffAbstractValue.swift index dd050cca04d8..758546fff75d 100644 --- a/WordPress/Classes/Models/Revisions/DiffAbstractValue.swift +++ b/WordPress/WordPressData/Swift/DiffAbstractValue.swift @@ -1,15 +1,15 @@ import Foundation import CoreData -class DiffAbstractValue: NSManagedObject { - enum Operation: String { +public class DiffAbstractValue: NSManagedObject { + public enum Operation: String { case add case copy case del case unknown } - enum DiffType: String { + public enum DiffType: String { case title case content case unknown @@ -18,10 +18,10 @@ class DiffAbstractValue: NSManagedObject { @NSManaged private var diffOperation: String @NSManaged private var diffType: String - @NSManaged var index: Int - @NSManaged var value: String? + @NSManaged public var index: Int + @NSManaged public var value: String? - var operation: Operation { + public var operation: Operation { get { return Operation(rawValue: diffOperation) ?? .unknown } @@ -30,7 +30,7 @@ class DiffAbstractValue: NSManagedObject { } } - var type: DiffType { + public var type: DiffType { get { return DiffType(rawValue: diffType) ?? .unknown } diff --git a/WordPress/Classes/Models/Revisions/DiffContentValue.swift b/WordPress/WordPressData/Swift/DiffContentValue.swift similarity index 62% rename from WordPress/Classes/Models/Revisions/DiffContentValue.swift rename to WordPress/WordPressData/Swift/DiffContentValue.swift index c34ccce341b6..46d8615224e0 100644 --- a/WordPress/Classes/Models/Revisions/DiffContentValue.swift +++ b/WordPress/WordPressData/Swift/DiffContentValue.swift @@ -1,6 +1,6 @@ import Foundation import CoreData -class DiffContentValue: DiffAbstractValue { +public class DiffContentValue: DiffAbstractValue { @NSManaged var revisionDiff: RevisionDiff? } diff --git a/WordPress/Classes/Models/Revisions/DiffTitleValue.swift b/WordPress/WordPressData/Swift/DiffTitleValue.swift similarity index 63% rename from WordPress/Classes/Models/Revisions/DiffTitleValue.swift rename to WordPress/WordPressData/Swift/DiffTitleValue.swift index 032284ed0fdc..e411957b7196 100644 --- a/WordPress/Classes/Models/Revisions/DiffTitleValue.swift +++ b/WordPress/WordPressData/Swift/DiffTitleValue.swift @@ -1,6 +1,6 @@ import Foundation import CoreData -class DiffTitleValue: DiffAbstractValue { +public class DiffTitleValue: DiffAbstractValue { @NSManaged var revisionDiff: RevisionDiff? } diff --git a/WordPress/Classes/Models/Domain.swift b/WordPress/WordPressData/Swift/Domain.swift similarity index 71% rename from WordPress/Classes/Models/Domain.swift rename to WordPress/WordPressData/Swift/Domain.swift index d7376470e9ad..3b1b5a648aee 100644 --- a/WordPress/Classes/Models/Domain.swift +++ b/WordPress/WordPressData/Swift/Domain.swift @@ -4,7 +4,7 @@ import WordPressKit public typealias Domain = RemoteDomain -extension Domain { +public extension Domain { init(managedDomain: ManagedDomain) { self.init(domainName: managedDomain.domainName, isPrimaryDomain: managedDomain.isPrimary, @@ -17,16 +17,16 @@ extension Domain { } } -class ManagedDomain: NSManagedObject { +public class ManagedDomain: NSManagedObject { // MARK: - NSManagedObject - override class func entityName() -> String { + public override class func entityName() -> String { return "Domain" } - struct Attributes { - static let domainName = "domainName" + public struct Attributes { + public static let domainName = "domainName" static let isPrimary = "isPrimary" static let domainType = "domainType" static let autoRenewing = "autoRenewing" @@ -36,21 +36,21 @@ class ManagedDomain: NSManagedObject { static let expiryDate = "expiryDate" } - struct Relationships { - static let blog = "blog" + public struct Relationships { + public static let blog = "blog" } - @NSManaged var domainName: String - @NSManaged var isPrimary: Bool - @NSManaged var domainType: DomainType - @NSManaged var blog: Blog - @NSManaged var autoRenewing: Bool - @NSManaged var autoRenewalDate: String - @NSManaged var expirySoon: Bool - @NSManaged var expired: Bool - @NSManaged var expiryDate: String + @NSManaged public var domainName: String + @NSManaged public var isPrimary: Bool + @NSManaged public var domainType: DomainType + @NSManaged public var blog: Blog + @NSManaged public var autoRenewing: Bool + @NSManaged public var autoRenewalDate: String + @NSManaged public var expirySoon: Bool + @NSManaged public var expired: Bool + @NSManaged public var expiryDate: String - func updateWith(_ domain: Domain, blog: Blog) { + public func updateWith(_ domain: Domain, blog: Blog) { self.domainName = domain.domainName self.isPrimary = domain.isPrimaryDomain self.domainType = domain.domainType diff --git a/WordPress/Classes/Models/GravatarProfile.swift b/WordPress/WordPressData/Swift/GravatarProfile.swift similarity index 100% rename from WordPress/Classes/Models/GravatarProfile.swift rename to WordPress/WordPressData/Swift/GravatarProfile.swift diff --git a/WordPress/Classes/Models/InviteLinks+CoreDataClass.swift b/WordPress/WordPressData/Swift/InviteLinks+CoreDataClass.swift similarity index 100% rename from WordPress/Classes/Models/InviteLinks+CoreDataClass.swift rename to WordPress/WordPressData/Swift/InviteLinks+CoreDataClass.swift diff --git a/WordPress/Classes/Models/InviteLinks+CoreDataProperties.swift b/WordPress/WordPressData/Swift/InviteLinks+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/InviteLinks+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/InviteLinks+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/JetpackState.swift b/WordPress/WordPressData/Swift/JetpackState.swift similarity index 100% rename from WordPress/Classes/Models/JetpackState.swift rename to WordPress/WordPressData/Swift/JetpackState.swift diff --git a/WordPress/Classes/Models/Notifications/Likes/LikeUser+CoreDataClass.swift b/WordPress/WordPressData/Swift/LikeUser+CoreDataClass.swift similarity index 100% rename from WordPress/Classes/Models/Notifications/Likes/LikeUser+CoreDataClass.swift rename to WordPress/WordPressData/Swift/LikeUser+CoreDataClass.swift diff --git a/WordPress/Classes/Models/Notifications/Likes/LikeUser+CoreDataProperties.swift b/WordPress/WordPressData/Swift/LikeUser+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/Notifications/Likes/LikeUser+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/LikeUser+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/Notifications/Likes/LikeUserPreferredBlog+CoreDataClass.swift b/WordPress/WordPressData/Swift/LikeUserPreferredBlog+CoreDataClass.swift similarity index 100% rename from WordPress/Classes/Models/Notifications/Likes/LikeUserPreferredBlog+CoreDataClass.swift rename to WordPress/WordPressData/Swift/LikeUserPreferredBlog+CoreDataClass.swift diff --git a/WordPress/Classes/Models/Notifications/Likes/LikeUserPreferredBlog+CoreDataProperties.swift b/WordPress/WordPressData/Swift/LikeUserPreferredBlog+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/Notifications/Likes/LikeUserPreferredBlog+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/LikeUserPreferredBlog+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/Account Settings/ManagedAccountSettings+CoreDataProperties.swift b/WordPress/WordPressData/Swift/ManagedAccountSettings+CoreDataProperties.swift similarity index 94% rename from WordPress/Classes/Models/Account Settings/ManagedAccountSettings+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/ManagedAccountSettings+CoreDataProperties.swift index 228db45f3a5a..b80bef8866ef 100644 --- a/WordPress/Classes/Models/Account Settings/ManagedAccountSettings+CoreDataProperties.swift +++ b/WordPress/WordPressData/Swift/ManagedAccountSettings+CoreDataProperties.swift @@ -3,7 +3,7 @@ import CoreData // MARK: - Encapsulates all of the ManagedAccountSettings Core Data properties. // -extension ManagedAccountSettings { +public extension ManagedAccountSettings { @NSManaged var firstName: String @NSManaged var lastName: String @NSManaged var displayName: String diff --git a/WordPress/Classes/Models/Account Settings/ManagedAccountSettings.swift b/WordPress/WordPressData/Swift/ManagedAccountSettings.swift similarity index 93% rename from WordPress/Classes/Models/Account Settings/ManagedAccountSettings.swift rename to WordPress/WordPressData/Swift/ManagedAccountSettings.swift index dbfb29fcd84a..ab73ad334d27 100644 --- a/WordPress/Classes/Models/Account Settings/ManagedAccountSettings.swift +++ b/WordPress/WordPressData/Swift/ManagedAccountSettings.swift @@ -4,15 +4,15 @@ import WordPressKit // MARK: - Reflects the user's Account Settings, as stored in Core Data. // -class ManagedAccountSettings: NSManagedObject { +public class ManagedAccountSettings: NSManagedObject { // MARK: - NSManagedObject - override class func entityName() -> String { + public override class func entityName() -> String { return "AccountSettings" } - func updateWith(_ accountSettings: AccountSettings) { + public func updateWith(_ accountSettings: AccountSettings) { firstName = accountSettings.firstName lastName = accountSettings.lastName displayName = accountSettings.displayName @@ -38,7 +38,7 @@ class ManagedAccountSettings: NSManagedObject { /// /// - Returns: the change object needed to revert this change /// - func applyChange(_ change: AccountSettingsChange) -> AccountSettingsChange { + public func applyChange(_ change: AccountSettingsChange) -> AccountSettingsChange { let reverse = reverseChange(change) switch change { @@ -95,7 +95,7 @@ class ManagedAccountSettings: NSManagedObject { } } -extension AccountSettings { +public extension AccountSettings { init(managed: ManagedAccountSettings) { self.init(firstName: managed.firstName.stringByDecodingXMLCharacters(), lastName: managed.lastName.stringByDecodingXMLCharacters(), diff --git a/WordPress/Classes/Models/People Management/ManagedPerson+CoreDataProperties.swift b/WordPress/WordPressData/Swift/ManagedPerson+CoreDataProperties.swift similarity index 94% rename from WordPress/Classes/Models/People Management/ManagedPerson+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/ManagedPerson+CoreDataProperties.swift index deb380773a75..24a1a26b673e 100644 --- a/WordPress/Classes/Models/People Management/ManagedPerson+CoreDataProperties.swift +++ b/WordPress/WordPressData/Swift/ManagedPerson+CoreDataProperties.swift @@ -3,7 +3,7 @@ import CoreData // MARK: - Encapsulates all of the ManagedPerson Core Data properties. // -extension ManagedPerson { +public extension ManagedPerson { @NSManaged var avatarURL: String? @NSManaged var displayName: String @NSManaged var firstName: String? diff --git a/WordPress/Classes/Models/People Management/ManagedPerson.swift b/WordPress/WordPressData/Swift/ManagedPerson.swift similarity index 93% rename from WordPress/Classes/Models/People Management/ManagedPerson.swift rename to WordPress/WordPressData/Swift/ManagedPerson.swift index 745ae1b6c9cb..afb65923d844 100644 --- a/WordPress/Classes/Models/People Management/ManagedPerson.swift +++ b/WordPress/WordPressData/Swift/ManagedPerson.swift @@ -1,16 +1,15 @@ import Foundation import CoreData import WordPressKit -import WordPressUI import Gravatar public typealias Person = RemotePerson // MARK: - Reflects a Person, stored in Core Data // -class ManagedPerson: NSManagedObject { +public class ManagedPerson: NSManagedObject { - func updateWith(_ person: T) { + public func updateWith(_ person: T) { let canonicalAvatarURL = person.avatarURL.flatMap { AvatarURL(url: $0)?.canonicalURL } avatarURL = canonicalAvatarURL?.absoluteString @@ -26,7 +25,7 @@ class ManagedPerson: NSManagedObject { kind = Int16(type(of: person).kind.rawValue) } - func toUnmanaged() -> Person { + public func toUnmanaged() -> Person { switch Int(kind) { case PersonKind.user.rawValue: return User(managedPerson: self) @@ -42,7 +41,7 @@ class ManagedPerson: NSManagedObject { // MARK: - Extensions // -extension Person { +public extension Person { init(managedPerson: ManagedPerson) { self.init(ID: Int(managedPerson.userID), username: managedPerson.username, @@ -57,7 +56,7 @@ extension Person { } } -extension User { +public extension User { init(managedPerson: ManagedPerson) { self.init(ID: Int(managedPerson.userID), username: managedPerson.username, @@ -72,7 +71,7 @@ extension User { } } -extension Follower { +public extension Follower { init(managedPerson: ManagedPerson) { self.init(ID: Int(managedPerson.userID), username: managedPerson.username, @@ -87,7 +86,7 @@ extension Follower { } } -extension Viewer { +public extension Viewer { init(managedPerson: ManagedPerson) { self.init(ID: Int(managedPerson.userID), username: managedPerson.username, @@ -102,7 +101,7 @@ extension Viewer { } } -extension EmailFollower { +public extension EmailFollower { init(managedPerson: ManagedPerson) { self.init(ID: Int(managedPerson.userID), username: managedPerson.username, diff --git a/WordPress/Classes/Models/Media.swift b/WordPress/WordPressData/Swift/Media.swift similarity index 99% rename from WordPress/Classes/Models/Media.swift rename to WordPress/WordPressData/Swift/Media.swift index 3797e068ff09..1ef9b5bd2d6b 100644 --- a/WordPress/Classes/Models/Media.swift +++ b/WordPress/WordPressData/Swift/Media.swift @@ -1,7 +1,7 @@ import Foundation import UniformTypeIdentifiers -extension Media { +public extension Media { // MARK: - AutoUpload Failure Count static let maxAutoUploadFailureCount = 3 diff --git a/WordPress/Classes/Utility/Media/MediaFileManager.swift b/WordPress/WordPressData/Swift/MediaFileManager.swift similarity index 93% rename from WordPress/Classes/Utility/Media/MediaFileManager.swift rename to WordPress/WordPressData/Swift/MediaFileManager.swift index a2c607f7d144..6c21f176f15c 100644 --- a/WordPress/Classes/Utility/Media/MediaFileManager.swift +++ b/WordPress/WordPressData/Swift/MediaFileManager.swift @@ -1,9 +1,10 @@ +import CocoaLumberjackSwift import Foundation import WordPressShared /// Type of the local Media directory URL in implementation. /// -enum MediaDirectory { +public enum MediaDirectory { /// Default, system Documents directory, for persisting media files for upload. case uploads /// System Caches directory, for creating discardable media files, such as thumbnails. @@ -12,11 +13,11 @@ enum MediaDirectory { case temporary(id: UUID) /// Use a new ID for every test scenario to make sure all tests are isolated. - static var temporary: MediaDirectory { .temporary(id: UUID()) } + public static var temporary: MediaDirectory { .temporary(id: UUID()) } /// Returns the directory URL for the directory type. /// - var url: URL { + public var url: URL { let fileManager = FileManager.default // Get a parent directory, based on the type. let parentDirectory: URL @@ -34,7 +35,8 @@ enum MediaDirectory { /// Encapsulates Media functions relative to the local Media directory. /// -class MediaFileManager: NSObject { +@objc +public class MediaFileManager: NSObject { fileprivate static let mediaDirectoryName = "Media" @@ -64,7 +66,7 @@ class MediaFileManager: NSObject { /// We shouldn't change this default directory lightly as older versions of the app may rely on Media files being in /// the documents directory for upload. /// - init(directory: MediaDirectory = .uploads) { + public init(directory: MediaDirectory = .uploads) { self.directory = directory } @@ -90,7 +92,7 @@ class MediaFileManager: NSObject { /// - Note: if a file already exists with the same name, the file name is appended with a number /// and incremented until a unique filename is found. /// - @objc func makeLocalMediaURL(withFilename filename: String, fileExtension: String?, incremented: Bool = true) throws -> URL { + @objc public func makeLocalMediaURL(withFilename filename: String, fileExtension: String?, incremented: Bool = true) throws -> URL { let baseURL = try directoryURL() var url: URL if let fileExtension { @@ -107,7 +109,7 @@ class MediaFileManager: NSObject { /// Objc friendly signature without specifying the `incremented` parameter. /// - @objc func makeLocalMediaURL(withFilename filename: String, fileExtension: String?) throws -> URL { + @objc public func makeLocalMediaURL(withFilename filename: String, fileExtension: String?) throws -> URL { return try makeLocalMediaURL(withFilename: filename, fileExtension: fileExtension, incremented: true) } @@ -188,13 +190,13 @@ class MediaFileManager: NSObject { /// Helper method for clearing unused Media upload files. /// - @objc class func clearUnusedMediaUploadFiles(onCompletion: (() -> Void)?, onError: ((Error) -> Void)?) { + @objc public class func clearUnusedMediaUploadFiles(onCompletion: (() -> Void)?, onError: ((Error) -> Void)?) { MediaFileManager.default.clearUnusedFilesFromDirectory(onCompletion: onCompletion, onError: onError) } /// Helper method for calculating the size of the Media directories. /// - class func calculateSizeOfMediaDirectories(onCompletion: @escaping (Int64?) -> Void) { + public class func calculateSizeOfMediaDirectories(onCompletion: @escaping (Int64?) -> Void) { let cacheManager = MediaFileManager(directory: .cache) cacheManager.calculateSizeOfDirectory { (cacheSize) in let defaultManager = MediaFileManager.default @@ -206,7 +208,7 @@ class MediaFileManager: NSObject { /// Helper method for clearing the Media cache directory. /// - @objc class func clearAllMediaCacheFiles(onCompletion: (() -> Void)?, onError: ((Error) -> Void)?) { + @objc public class func clearAllMediaCacheFiles(onCompletion: (() -> Void)?, onError: ((Error) -> Void)?) { let cacheManager = MediaFileManager(directory: .cache) cacheManager.clearFilesFromDirectory(onCompletion: { MediaFileManager.clearUnusedMediaUploadFiles(onCompletion: onCompletion, onError: onError) diff --git a/WordPress/Classes/Utility/CoreData/NSManagedObject+Lookup.swift b/WordPress/WordPressData/Swift/NSManagedObject+Lookup.swift similarity index 94% rename from WordPress/Classes/Utility/CoreData/NSManagedObject+Lookup.swift rename to WordPress/WordPressData/Swift/NSManagedObject+Lookup.swift index d28c9610bca7..4427f2083961 100644 --- a/WordPress/Classes/Utility/CoreData/NSManagedObject+Lookup.swift +++ b/WordPress/WordPressData/Swift/NSManagedObject+Lookup.swift @@ -1,6 +1,6 @@ import CoreData -extension NSManagedObject { +public extension NSManagedObject { /// Lookup an object by its NSManagedObjectID /// diff --git a/WordPress/Classes/Extensions/NSManagedObject.swift b/WordPress/WordPressData/Swift/NSManagedObject.swift similarity index 93% rename from WordPress/Classes/Extensions/NSManagedObject.swift rename to WordPress/WordPressData/Swift/NSManagedObject.swift index ba2ecc15585b..c938719b9530 100644 --- a/WordPress/Classes/Extensions/NSManagedObject.swift +++ b/WordPress/WordPressData/Swift/NSManagedObject.swift @@ -1,6 +1,6 @@ import CoreData -extension NSManagedObject { +public extension NSManagedObject { func setRawValue(_ value: ValueType?, forKey key: String) { willChangeValue(forKey: key) setPrimitiveValue(value?.rawValue, forKey: key) diff --git a/WordPress/Classes/Models/Notifications/Notification.swift b/WordPress/WordPressData/Swift/Notification.swift similarity index 96% rename from WordPress/Classes/Models/Notifications/Notification.swift rename to WordPress/WordPressData/Swift/Notification.swift index 7bc1bf57231e..04597af86cde 100644 --- a/WordPress/Classes/Models/Notifications/Notification.swift +++ b/WordPress/WordPressData/Swift/Notification.swift @@ -150,7 +150,7 @@ public class Notification: NSManagedObject { private class NotificationCachedAttributesObserver: NSObject { override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) { - guard let keyPath, let notification = object as? Notification, Notification.cachedAttributes.contains(keyPath) else { + guard let keyPath, let notification = object as? WordPressData.Notification, WordPressData.Notification.cachedAttributes.contains(keyPath) else { return } diff --git a/WordPress/Classes/Services/NullBlogPropertySanitizer.swift b/WordPress/WordPressData/Swift/NullBlogPropertySanitizer.swift similarity index 97% rename from WordPress/Classes/Services/NullBlogPropertySanitizer.swift rename to WordPress/WordPressData/Swift/NullBlogPropertySanitizer.swift index 46a4a64a7419..c8082fa51a1e 100644 --- a/WordPress/Classes/Services/NullBlogPropertySanitizer.swift +++ b/WordPress/WordPressData/Swift/NullBlogPropertySanitizer.swift @@ -1,3 +1,4 @@ +import CoreData import Foundation import WordPressShared @@ -33,7 +34,7 @@ import WordPressShared store.set(currentBuildVersion(), forKey: Self.lastSanitizationVersionNumber) - let entityNamesWithRequiredBlogProperties = [ + let entityNamesWithRequiredBlogProperties: [String] = [ Post.entityName(), Page.entityName(), Media.entityName(), diff --git a/WordPress/Classes/Models/Page+CoreDataProperties.swift b/WordPress/WordPressData/Swift/Page+CoreDataProperties.swift similarity index 54% rename from WordPress/Classes/Models/Page+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/Page+CoreDataProperties.swift index 0267dcb2bda2..ed69e22c3f16 100644 --- a/WordPress/Classes/Models/Page+CoreDataProperties.swift +++ b/WordPress/WordPressData/Swift/Page+CoreDataProperties.swift @@ -3,6 +3,5 @@ import CoreData extension Page { - @NSManaged var parentID: NSNumber? - + @NSManaged public var parentID: NSNumber? } diff --git a/WordPress/Classes/Models/Page.swift b/WordPress/WordPressData/Swift/Page.swift similarity index 100% rename from WordPress/Classes/Models/Page.swift rename to WordPress/WordPressData/Swift/Page.swift diff --git a/WordPress/Classes/Models/Gutenberg/PageTemplateCategory+CoreDataClass.swift b/WordPress/WordPressData/Swift/PageTemplateCategory+CoreDataClass.swift similarity index 100% rename from WordPress/Classes/Models/Gutenberg/PageTemplateCategory+CoreDataClass.swift rename to WordPress/WordPressData/Swift/PageTemplateCategory+CoreDataClass.swift diff --git a/WordPress/Classes/Models/Gutenberg/PageTemplateCategory+CoreDataProperties.swift b/WordPress/WordPressData/Swift/PageTemplateCategory+CoreDataProperties.swift similarity index 97% rename from WordPress/Classes/Models/Gutenberg/PageTemplateCategory+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/PageTemplateCategory+CoreDataProperties.swift index 959f97a6a1f7..0f55ce8f8077 100644 --- a/WordPress/Classes/Models/Gutenberg/PageTemplateCategory+CoreDataProperties.swift +++ b/WordPress/WordPressData/Swift/PageTemplateCategory+CoreDataProperties.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit extension PageTemplateCategory { @@ -43,7 +44,7 @@ extension PageTemplateCategory { } -extension PageTemplateCategory { +public extension PageTemplateCategory { convenience init(context: NSManagedObjectContext, category: RemoteLayoutCategory, ordinal: Int) { self.init(context: context) diff --git a/WordPress/Classes/Models/Gutenberg/PageTemplateLayout+CoreDataClass.swift b/WordPress/WordPressData/Swift/PageTemplateLayout+CoreDataClass.swift similarity index 100% rename from WordPress/Classes/Models/Gutenberg/PageTemplateLayout+CoreDataClass.swift rename to WordPress/WordPressData/Swift/PageTemplateLayout+CoreDataClass.swift diff --git a/WordPress/Classes/Models/Gutenberg/PageTemplateLayout+CoreDataProperties.swift b/WordPress/WordPressData/Swift/PageTemplateLayout+CoreDataProperties.swift similarity index 98% rename from WordPress/Classes/Models/Gutenberg/PageTemplateLayout+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/PageTemplateLayout+CoreDataProperties.swift index 201af71fd63b..a83ef82727f2 100644 --- a/WordPress/Classes/Models/Gutenberg/PageTemplateLayout+CoreDataProperties.swift +++ b/WordPress/WordPressData/Swift/PageTemplateLayout+CoreDataProperties.swift @@ -34,7 +34,7 @@ extension PageTemplateLayout { @NSManaged public func removeFromCategories(_ values: Set) } -extension PageTemplateLayout { +public extension PageTemplateLayout { convenience init(context: NSManagedObjectContext, layout: RemoteLayout) { self.init(context: context) diff --git a/WordPress/Classes/Models/Plan.swift b/WordPress/WordPressData/Swift/Plan.swift similarity index 100% rename from WordPress/Classes/Models/Plan.swift rename to WordPress/WordPressData/Swift/Plan.swift diff --git a/WordPress/Classes/Models/PlanFeature.swift b/WordPress/WordPressData/Swift/PlanFeature.swift similarity index 100% rename from WordPress/Classes/Models/PlanFeature.swift rename to WordPress/WordPressData/Swift/PlanFeature.swift diff --git a/WordPress/Classes/Models/PlanGroup.swift b/WordPress/WordPressData/Swift/PlanGroup.swift similarity index 100% rename from WordPress/Classes/Models/PlanGroup.swift rename to WordPress/WordPressData/Swift/PlanGroup.swift diff --git a/WordPress/Classes/Models/Post+CoreDataProperties.swift b/WordPress/WordPressData/Swift/Post+CoreDataProperties.swift similarity index 97% rename from WordPress/Classes/Models/Post+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/Post+CoreDataProperties.swift index 99d6ffa0f8de..dbc45eb2d365 100644 --- a/WordPress/Classes/Models/Post+CoreDataProperties.swift +++ b/WordPress/WordPressData/Swift/Post+CoreDataProperties.swift @@ -1,7 +1,7 @@ import Foundation import CoreData -extension Post { +public extension Post { @NSManaged var commentCount: NSNumber? @NSManaged var disabledPublicizeConnections: [NSNumber: [String: String]]? diff --git a/WordPress/Classes/Models/Post.swift b/WordPress/WordPressData/Swift/Post.swift similarity index 100% rename from WordPress/Classes/Models/Post.swift rename to WordPress/WordPressData/Swift/Post.swift diff --git a/WordPress/Classes/Models/PostCategory+Creation.swift b/WordPress/WordPressData/Swift/PostCategory+Creation.swift similarity index 93% rename from WordPress/Classes/Models/PostCategory+Creation.swift rename to WordPress/WordPressData/Swift/PostCategory+Creation.swift index fe073ec26caa..af6cca55fad8 100644 --- a/WordPress/Classes/Models/PostCategory+Creation.swift +++ b/WordPress/WordPressData/Swift/PostCategory+Creation.swift @@ -1,6 +1,6 @@ -import Foundation +import CoreData -extension PostCategory { +public extension PostCategory { static func create(withBlogID id: NSManagedObjectID, in context: NSManagedObjectContext) throws -> PostCategory { let object = try context.existingObject(with: id) diff --git a/WordPress/Classes/Models/PostCategory+Lookup.swift b/WordPress/WordPressData/Swift/PostCategory+Lookup.swift similarity index 96% rename from WordPress/Classes/Models/PostCategory+Lookup.swift rename to WordPress/WordPressData/Swift/PostCategory+Lookup.swift index 98b1db9ce9c4..3defe773a969 100644 --- a/WordPress/Classes/Models/PostCategory+Lookup.swift +++ b/WordPress/WordPressData/Swift/PostCategory+Lookup.swift @@ -1,6 +1,6 @@ import Foundation -extension PostCategory { +public extension PostCategory { static func lookup(withBlogID id: NSManagedObjectID, categoryID: NSNumber, in context: NSManagedObjectContext) throws -> PostCategory? { try lookup(withBlogID: id, predicate: NSPredicate(format: "categoryID == %@", categoryID), in: context) @@ -28,7 +28,7 @@ extension PostCategory { // MARK: - Objective-C API -extension PostCategory { +public extension PostCategory { @objc(lookupWithBlogObjectID:categoryID:inContext:) static func objc_lookup(withBlogID id: NSManagedObjectID, categoryID: NSNumber, in context: NSManagedObjectContext) -> PostCategory? { diff --git a/WordPress/Classes/Services/PostHelper+Metadata.swift b/WordPress/WordPressData/Swift/PostHelper+Metadata.swift similarity index 97% rename from WordPress/Classes/Services/PostHelper+Metadata.swift rename to WordPress/WordPressData/Swift/PostHelper+Metadata.swift index b30e6e6a9125..6285a7ffcf01 100644 --- a/WordPress/Classes/Services/PostHelper+Metadata.swift +++ b/WordPress/WordPressData/Swift/PostHelper+Metadata.swift @@ -1,7 +1,7 @@ import Foundation import WordPressShared -extension PostHelper { +public extension PostHelper { @objc static let foreignIDKey = "wp_jp_foreign_id" static func mapDictionaryToMetadataItems(_ dictionary: [String: Any]) -> RemotePostMetadataItem? { diff --git a/WordPress/Classes/Services/PostServiceRemoteFactory.swift b/WordPress/WordPressData/Swift/PostServiceRemoteFactory.swift similarity index 86% rename from WordPress/Classes/Services/PostServiceRemoteFactory.swift rename to WordPress/WordPressData/Swift/PostServiceRemoteFactory.swift index 50b86879cd6e..b1ec4e316298 100644 --- a/WordPress/Classes/Services/PostServiceRemoteFactory.swift +++ b/WordPress/WordPressData/Swift/PostServiceRemoteFactory.swift @@ -2,8 +2,8 @@ import Foundation import WordPressKit import WordPressShared -@objc class PostServiceRemoteFactory: NSObject { - @objc func forBlog(_ blog: Blog) -> PostServiceRemote? { +@objc public class PostServiceRemoteFactory: NSObject { + @objc public func forBlog(_ blog: Blog) -> PostServiceRemote? { if blog.supports(.wpComRESTAPI), let api = blog.wordPressComRestApi(), let dotComID = blog.dotComID { @@ -19,7 +19,7 @@ import WordPressShared return nil } - @objc func restRemoteFor(siteID: NSNumber, context: NSManagedObjectContext) -> PostServiceRemoteREST? { + @objc public func restRemoteFor(siteID: NSNumber, context: NSManagedObjectContext) -> PostServiceRemoteREST? { guard let api = apiForRESTRequest(using: context) else { return nil } diff --git a/WordPress/Classes/Models/PostVisibility.swift b/WordPress/WordPressData/Swift/PostVisibility.swift similarity index 100% rename from WordPress/Classes/Models/PostVisibility.swift rename to WordPress/WordPressData/Swift/PostVisibility.swift diff --git a/WordPress/Classes/Models/PublicizeConnection.swift b/WordPress/WordPressData/Swift/PublicizeConnection.swift similarity index 100% rename from WordPress/Classes/Models/PublicizeConnection.swift rename to WordPress/WordPressData/Swift/PublicizeConnection.swift diff --git a/WordPress/Classes/Models/PublicizeInfo+CoreDataClass.swift b/WordPress/WordPressData/Swift/PublicizeInfo+CoreDataClass.swift similarity index 87% rename from WordPress/Classes/Models/PublicizeInfo+CoreDataClass.swift rename to WordPress/WordPressData/Swift/PublicizeInfo+CoreDataClass.swift index 2cb7b29f3a48..de23ebc1efbd 100644 --- a/WordPress/Classes/Models/PublicizeInfo+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/PublicizeInfo+CoreDataClass.swift @@ -10,7 +10,7 @@ import WordPressKit /// @objc public class PublicizeInfo: NSManagedObject { - var sharingLimit: SharingLimit { + public var sharingLimit: SharingLimit { SharingLimit(remaining: Int(sharesRemaining), limit: Int(shareLimit)) } @@ -22,7 +22,7 @@ import WordPressKit return NSEntityDescription.insertNewObject(forEntityName: Self.classNameWithoutNamespaces(), into: context) as? PublicizeInfo } - func configure(with remote: RemotePublicizeInfo) { + public func configure(with remote: RemotePublicizeInfo) { self.shareLimit = Int64(remote.shareLimit) self.toBePublicizedCount = Int64(remote.toBePublicizedCount) self.sharedPostsCount = Int64(remote.sharedPostsCount) @@ -30,11 +30,11 @@ import WordPressKit } /// A value-type representation for Publicize auto-sharing usage. - struct SharingLimit { + public struct SharingLimit { /// The remaining shares available for use. - let remaining: Int + public let remaining: Int /// Maximum number of shares allowed for the site. - let limit: Int + public let limit: Int } } diff --git a/WordPress/Classes/Models/PublicizeInfo+CoreDataProperties.swift b/WordPress/WordPressData/Swift/PublicizeInfo+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/PublicizeInfo+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/PublicizeInfo+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/PublicizeService.swift b/WordPress/WordPressData/Swift/PublicizeService.swift similarity index 73% rename from WordPress/Classes/Models/PublicizeService.swift rename to WordPress/WordPressData/Swift/PublicizeService.swift index 2ea33e69a725..a103e0bcc993 100644 --- a/WordPress/Classes/Models/PublicizeService.swift +++ b/WordPress/WordPressData/Swift/PublicizeService.swift @@ -3,10 +3,10 @@ import CoreData import WordPressShared open class PublicizeService: NSManagedObject { - @objc static let googlePlusServiceID = "google_plus" - @objc static let facebookServiceID = "facebook" - @objc static let defaultStatus = "ok" - @objc static let unsupportedStatus = "unsupported" + @objc public static let googlePlusServiceID = "google_plus" + @objc public static let facebookServiceID = "facebook" + @objc public static let defaultStatus = "ok" + @objc public static let unsupportedStatus = "unsupported" @NSManaged open var connectURL: String @NSManaged open var detail: String @@ -28,7 +28,7 @@ open class PublicizeService: NSManagedObject { // MARK: - Convenience Methods -extension PublicizeService { +public extension PublicizeService { /// A convenient value-type representation for the destination sharing service. enum ServiceName: String { @@ -41,13 +41,8 @@ extension PublicizeService { case threads case unknown - /// Returns the local image for the icon representing the social network. - var localIconImage: UIImage { - WPStyleGuide.socialIcon(for: rawValue as NSString) - } - /// A string describing the service in a human-readable format. - var description: String { + public var description: String { rawValue.split(separator: "-").joined(separator: " ").localizedCapitalized } } diff --git a/WordPress/Classes/Models/QuickStartTourState.swift b/WordPress/WordPressData/Swift/QuickStartTourState.swift similarity index 77% rename from WordPress/Classes/Models/QuickStartTourState.swift rename to WordPress/WordPressData/Swift/QuickStartTourState.swift index 5cb6594bcd59..67a3b03fc12f 100644 --- a/WordPress/Classes/Models/QuickStartTourState.swift +++ b/WordPress/WordPressData/Swift/QuickStartTourState.swift @@ -1,5 +1,6 @@ import CoreData +// FIXME: Remove from model once transition completed and a new build using it has been shipped @available(*, deprecated, message: "No longer used") @objc(QuickStartTourState) open class QuickStartTourState: NSManagedObject { diff --git a/WordPress/Classes/Models/ReaderAbstractTopic+Lookup.swift b/WordPress/WordPressData/Swift/ReaderAbstractTopic+Lookup.swift similarity index 98% rename from WordPress/Classes/Models/ReaderAbstractTopic+Lookup.swift rename to WordPress/WordPressData/Swift/ReaderAbstractTopic+Lookup.swift index e973d1cb8d65..02aea5a061e0 100644 --- a/WordPress/Classes/Models/ReaderAbstractTopic+Lookup.swift +++ b/WordPress/WordPressData/Swift/ReaderAbstractTopic+Lookup.swift @@ -1,6 +1,7 @@ +import CoreData import Foundation -extension ReaderAbstractTopic { +public extension ReaderAbstractTopic { /// Fetch all `ReaderAbstractTopics` currently in Core Data. /// diff --git a/WordPress/Classes/Models/ReaderAbstractTopic.swift b/WordPress/WordPressData/Swift/ReaderAbstractTopic.swift similarity index 100% rename from WordPress/Classes/Models/ReaderAbstractTopic.swift rename to WordPress/WordPressData/Swift/ReaderAbstractTopic.swift diff --git a/WordPress/Classes/Models/ReaderCard+CoreDataClass.swift b/WordPress/WordPressData/Swift/ReaderCard+CoreDataClass.swift similarity index 81% rename from WordPress/Classes/Models/ReaderCard+CoreDataClass.swift rename to WordPress/WordPressData/Swift/ReaderCard+CoreDataClass.swift index 2fbb033d0fa8..4b1ff384d630 100644 --- a/WordPress/Classes/Models/ReaderCard+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/ReaderCard+CoreDataClass.swift @@ -1,15 +1,16 @@ import Foundation import CoreData +import WordPressKit public class ReaderCard: NSManagedObject { - enum CardType { + public enum CardType { case post case topics case sites case unknown } - var type: CardType { + public var type: CardType { if post != nil { return .post } @@ -25,7 +26,7 @@ public class ReaderCard: NSManagedObject { return .unknown } - var isRecommendationCard: Bool { + public var isRecommendationCard: Bool { switch type { case .topics, .sites: return true @@ -34,15 +35,15 @@ public class ReaderCard: NSManagedObject { } } - var topicsArray: [ReaderTagTopic] { + public var topicsArray: [ReaderTagTopic] { topics?.array as? [ReaderTagTopic] ?? [] } - var sitesArray: [ReaderSiteTopic] { + public var sitesArray: [ReaderSiteTopic] { sites?.array as? [ReaderSiteTopic] ?? [] } - convenience init?(context: NSManagedObjectContext, from remoteCard: RemoteReaderCard) { + public convenience init?(context: NSManagedObjectContext, from remoteCard: RemoteReaderCard) { guard remoteCard.type != .unknown else { return nil } diff --git a/WordPress/Classes/Models/ReaderCard+CoreDataProperties.swift b/WordPress/WordPressData/Swift/ReaderCard+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/ReaderCard+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/ReaderCard+CoreDataProperties.swift diff --git a/WordPress/Classes/Models/ReaderCrossPostMeta.swift b/WordPress/WordPressData/Swift/ReaderCrossPostMeta.swift similarity index 100% rename from WordPress/Classes/Models/ReaderCrossPostMeta.swift rename to WordPress/WordPressData/Swift/ReaderCrossPostMeta.swift diff --git a/WordPress/Classes/Models/ReaderSearchSuggestion.swift b/WordPress/WordPressData/Swift/ReaderSearchSuggestion.swift similarity index 70% rename from WordPress/Classes/Models/ReaderSearchSuggestion.swift rename to WordPress/WordPressData/Swift/ReaderSearchSuggestion.swift index 2c315f4b192b..80a1ef09896f 100644 --- a/WordPress/Classes/Models/ReaderSearchSuggestion.swift +++ b/WordPress/WordPressData/Swift/ReaderSearchSuggestion.swift @@ -1,6 +1,7 @@ import Foundation import CoreData +// FIXME: Remove from model once transition completed and a new build using it has been shipped @available(*, deprecated, message: "No longer used") @objc open class ReaderSearchSuggestion: NSManagedObject { @NSManaged open var date: Date? diff --git a/WordPress/Classes/Models/ReaderSearchTopic.swift b/WordPress/WordPressData/Swift/ReaderSearchTopic.swift similarity index 100% rename from WordPress/Classes/Models/ReaderSearchTopic.swift rename to WordPress/WordPressData/Swift/ReaderSearchTopic.swift diff --git a/WordPress/Classes/Models/ReaderSiteInfoSubscriptions.swift b/WordPress/WordPressData/Swift/ReaderSiteInfoSubscriptions.swift similarity index 98% rename from WordPress/Classes/Models/ReaderSiteInfoSubscriptions.swift rename to WordPress/WordPressData/Swift/ReaderSiteInfoSubscriptions.swift index d05f12ae2d6b..041206cf8642 100644 --- a/WordPress/Classes/Models/ReaderSiteInfoSubscriptions.swift +++ b/WordPress/WordPressData/Swift/ReaderSiteInfoSubscriptions.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit @objc public class ReaderSiteInfoSubscriptionPost: NSManagedObject { @NSManaged open var siteTopic: ReaderSiteTopic diff --git a/WordPress/Classes/Models/ReaderSiteTopic+Lookup.swift b/WordPress/WordPressData/Swift/ReaderSiteTopic+Lookup.swift similarity index 97% rename from WordPress/Classes/Models/ReaderSiteTopic+Lookup.swift rename to WordPress/WordPressData/Swift/ReaderSiteTopic+Lookup.swift index 9dd4cd510ff5..a82aaeccbd0f 100644 --- a/WordPress/Classes/Models/ReaderSiteTopic+Lookup.swift +++ b/WordPress/WordPressData/Swift/ReaderSiteTopic+Lookup.swift @@ -1,6 +1,8 @@ +import CocoaLumberjackSwift +import CoreData import Foundation -extension ReaderSiteTopic { +public extension ReaderSiteTopic { /// Find a site topic by its site id /// diff --git a/WordPress/Classes/Models/ReaderSiteTopic.swift b/WordPress/WordPressData/Swift/ReaderSiteTopic.swift similarity index 95% rename from WordPress/Classes/Models/ReaderSiteTopic.swift rename to WordPress/WordPressData/Swift/ReaderSiteTopic.swift index 6eb669162292..dd0a3b0591be 100644 --- a/WordPress/Classes/Models/ReaderSiteTopic.swift +++ b/WordPress/WordPressData/Swift/ReaderSiteTopic.swift @@ -1,4 +1,6 @@ +import CoreData import Foundation +import WordPressKit @objc open class ReaderSiteTopic: ReaderAbstractTopic { // Relations @@ -32,11 +34,11 @@ import Foundation } } - var organizationType: SiteOrganizationType { + public var organizationType: SiteOrganizationType { SiteOrganizationType(rawValue: organizationID) ?? .none } - var isP2Type: Bool { + public var isP2Type: Bool { return organizationType == .p2 || organizationType == .automattic } @@ -48,7 +50,7 @@ import Foundation return postSubscription?.sendPosts ?? false } - var canManageNotifications: Bool { + public var canManageNotifications: Bool { !isExternal } diff --git a/WordPress/Classes/Models/ReaderTagTopic.swift b/WordPress/WordPressData/Swift/ReaderTagTopic.swift similarity index 78% rename from WordPress/Classes/Models/ReaderTagTopic.swift rename to WordPress/WordPressData/Swift/ReaderTagTopic.swift index 7bb43246d362..52960e16e693 100644 --- a/WordPress/Classes/Models/ReaderTagTopic.swift +++ b/WordPress/WordPressData/Swift/ReaderTagTopic.swift @@ -1,4 +1,6 @@ +import CoreData import Foundation +import WordPressKit @objc open class ReaderTagTopic: ReaderAbstractTopic { @NSManaged open var isRecommended: Bool @@ -13,19 +15,19 @@ import Foundation // MARK: - Computed Properties /// The `slug` property is URL encoded. Use this property for display instead. - var slugForDisplay: String? { + public var slugForDisplay: String? { return slug.removingPercentEncoding } // MARK: - Logged Out Helpers /// The tagID used if an interest was added locally and not sync'd with the server - class var loggedOutTagID: NSNumber { + public class var loggedOutTagID: NSNumber { return NSNotFound as NSNumber } /// Creates a new ReaderTagTopic object from a RemoteReaderInterest - convenience init(remoteInterest: RemoteReaderInterest, context: NSManagedObjectContext, isFollowing: Bool = false) { + convenience public init(remoteInterest: RemoteReaderInterest, context: NSManagedObjectContext, isFollowing: Bool = false) { self.init(context: context) title = remoteInterest.title @@ -38,7 +40,7 @@ import Foundation /// Returns an existing ReaderTagTopic or creates a new one based on remote interest /// If an existing topic is returned, the title will be updated with the remote interest - class func createOrUpdateIfNeeded(from remoteInterest: RemoteReaderInterest, context: NSManagedObjectContext) -> ReaderTagTopic { + public class func createOrUpdateIfNeeded(from remoteInterest: RemoteReaderInterest, context: NSManagedObjectContext) -> ReaderTagTopic { let fetchRequest = NSFetchRequest(entityName: self.classNameWithoutNamespaces()) fetchRequest.predicate = NSPredicate(format: "slug = %@", remoteInterest.slug) let topics = try? context.fetch(fetchRequest) as? [ReaderTagTopic] @@ -52,17 +54,17 @@ import Foundation return topic } - var formattedTitle: String { + public var formattedTitle: String { title.split(separator: "-").map(\.capitalized).joined(separator: " ") } /// Convenience method to update the tag's `following` state and also updates `showInMenu`. - @objc func toggleFollowing(_ isFollowing: Bool) { + @objc public func toggleFollowing(_ isFollowing: Bool) { following = isFollowing showInMenu = (following || isRecommended) } } -extension ReaderTagTopic { +public extension ReaderTagTopic { static let dailyPromptTag = "dailyprompt" } diff --git a/WordPress/Classes/Services/PostRepository+Helpers.swift b/WordPress/WordPressData/Swift/RemotePostParameters+Utils.swift similarity index 96% rename from WordPress/Classes/Services/PostRepository+Helpers.swift rename to WordPress/WordPressData/Swift/RemotePostParameters+Utils.swift index 5ef1698d3781..41d926415dcb 100644 --- a/WordPress/Classes/Services/PostRepository+Helpers.swift +++ b/WordPress/WordPressData/Swift/RemotePostParameters+Utils.swift @@ -1,10 +1,9 @@ -import Foundation import WordPressKit import WordPressShared extension RemotePostCreateParameters { /// Initializes the parameters required to create the given post. - init(post: AbstractPost) { + public init(post: AbstractPost) { self.init( type: post is Post ? "post" : "page", status: (post.status ?? .draft).rawValue @@ -53,7 +52,8 @@ private func makeTags(from tags: String) -> [String] { .filter { !$0.isEmpty } } -extension RemotePostUpdateParameters { +public extension RemotePostUpdateParameters { + var isEmpty: Bool { self == RemotePostUpdateParameters() } diff --git a/WordPress/WordPressData/Swift/Revision.swift b/WordPress/WordPressData/Swift/Revision.swift new file mode 100644 index 000000000000..9b4d80151feb --- /dev/null +++ b/WordPress/WordPressData/Swift/Revision.swift @@ -0,0 +1,35 @@ +import Foundation +import CoreData + +public class Revision: NSManagedObject { + @NSManaged public var siteId: NSNumber + @NSManaged public var revisionId: NSNumber + @NSManaged public var postId: NSNumber + + @NSManaged public var postAuthorId: NSNumber? + + @NSManaged public var postTitle: String? + @NSManaged public var postContent: String? + @NSManaged public var postExcerpt: String? + + @NSManaged public var postDateGmt: String? + @NSManaged public var postModifiedGmt: String? + + @NSManaged public var diff: RevisionDiff? + + private lazy var revisionFormatter: DateFormatter = { + let formatter = DateFormatter() + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.dateFormat = "yyyy-MM-dd HH:mm:ssZ" + formatter.timeZone = TimeZone(secondsFromGMT: 0) + return formatter + }() + + public var revisionDate: Date { + return revisionFormatter.date(from: postDateGmt ?? "") ?? Date() + } + + @objc public var revisionDateForSection: String { + return revisionDate.longUTCStringWithoutTime() + } +} diff --git a/WordPress/Classes/Models/Revisions/RevisionDiff+CoreData.swift b/WordPress/WordPressData/Swift/RevisionDiff+CoreData.swift similarity index 98% rename from WordPress/Classes/Models/Revisions/RevisionDiff+CoreData.swift rename to WordPress/WordPressData/Swift/RevisionDiff+CoreData.swift index db552b788805..1a88cd286409 100644 --- a/WordPress/Classes/Models/Revisions/RevisionDiff+CoreData.swift +++ b/WordPress/WordPressData/Swift/RevisionDiff+CoreData.swift @@ -32,7 +32,7 @@ extension RevisionDiff { @NSManaged public func removeFromTitleDiffs(_ values: NSSet) } -extension RevisionDiff { +public extension RevisionDiff { func remove(_ type: T.Type) -> RevisionDiff { guard let set = (type is DiffContentValue.Type ? contentDiffs : titleDiffs) else { return self diff --git a/WordPress/WordPressData/Swift/RevisionDiff.swift b/WordPress/WordPressData/Swift/RevisionDiff.swift new file mode 100644 index 000000000000..fa30a9c2e6d1 --- /dev/null +++ b/WordPress/WordPressData/Swift/RevisionDiff.swift @@ -0,0 +1,15 @@ +import Foundation +import CoreData + +public class RevisionDiff: NSManagedObject { + @NSManaged public var fromRevisionId: NSNumber + @NSManaged public var toRevisionId: NSNumber + + @NSManaged public var totalAdditions: NSNumber + @NSManaged public var totalDeletions: NSNumber + + @NSManaged public var contentDiffs: NSSet? + @NSManaged public var titleDiffs: NSSet? + + @NSManaged public var revision: Revision? +} diff --git a/WordPress/Classes/Models/Role.swift b/WordPress/WordPressData/Swift/Role.swift similarity index 94% rename from WordPress/Classes/Models/Role.swift rename to WordPress/WordPressData/Swift/Role.swift index c414a1b5c7f2..dbf1017f225b 100644 --- a/WordPress/Classes/Models/Role.swift +++ b/WordPress/WordPressData/Swift/Role.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit public class Role: NSManagedObject { @NSManaged public var name: String! @@ -8,7 +9,7 @@ public class Role: NSManagedObject { @NSManaged public var order: NSNumber! } -extension Role { +public extension Role { func toUnmanaged() -> RemoteRole { return RemoteRole(slug: slug, name: name) } diff --git a/WordPress/Classes/Jetpack/Utility/SharedDataIssueSolver.swift b/WordPress/WordPressData/Swift/SharedDataIssueSolver.swift similarity index 96% rename from WordPress/Classes/Jetpack/Utility/SharedDataIssueSolver.swift rename to WordPress/WordPressData/Swift/SharedDataIssueSolver.swift index 2c70828a6714..30cbc8672093 100644 --- a/WordPress/Classes/Jetpack/Utility/SharedDataIssueSolver.swift +++ b/WordPress/WordPressData/Swift/SharedDataIssueSolver.swift @@ -2,7 +2,7 @@ import WordPressShared import BuildSettingsKit @objcMembers -final class SharedDataIssueSolver: NSObject { +public final class SharedDataIssueSolver: NSObject { private let contextManager: CoreDataStack private let keychainUtils: KeychainUtils @@ -10,7 +10,7 @@ final class SharedDataIssueSolver: NSObject { private let localFileStore: LocalFileStore private let appGroupName: String - init(contextManager: CoreDataStack = ContextManager.shared, + public init(contextManager: CoreDataStack = ContextManager.shared, keychainUtils: KeychainUtils = KeychainUtils(), sharedDefaults: UserPersistentRepository? = UserDefaults(suiteName: BuildSettings.current.appGroupName), localFileStore: LocalFileStore = FileManager.default, @@ -28,20 +28,20 @@ final class SharedDataIssueSolver: NSObject { return SharedDataIssueSolver() } - func migrateAuthKey() { + public func migrateAuthKey(isJetpack: Bool) { guard let account = try? WPAccount.lookupDefaultWordPressComAccount(in: contextManager.mainContext), let username = account.username else { return } - migrateAuthKey(for: username) + migrateAuthKey(for: username, isJetpack: isJetpack) } /// Resolve shared data issue by splitting the keys used to store authentication token and supporting data. /// To be safe, the method only "migrates" the data when the user is logged in, and there's a good chance that /// both apps are logged in with the same account. /// - func migrateAuthKey(for username: String) { - guard AppConfiguration.isJetpack, + public func migrateAuthKey(for username: String, isJetpack: Bool) { + guard isJetpack, let token = try? keychainUtils.getPassword(for: username, serviceName: WPAccountConstants.authToken.rawValue) else { return } @@ -60,7 +60,7 @@ final class SharedDataIssueSolver: NSObject { updateExisting: true) } - func migrateExtensionsData() { + public func migrateExtensionsData() { copyTodayWidgetDataToJetpack() copyShareExtensionDataToJetpack() } diff --git a/WordPress/Classes/Models/SharingButton+Lookup.swift b/WordPress/WordPressData/Swift/SharingButton+Lookup.swift similarity index 97% rename from WordPress/Classes/Models/SharingButton+Lookup.swift rename to WordPress/WordPressData/Swift/SharingButton+Lookup.swift index df75928bd2b0..c729ecc6cee4 100644 --- a/WordPress/Classes/Models/SharingButton+Lookup.swift +++ b/WordPress/WordPressData/Swift/SharingButton+Lookup.swift @@ -1,4 +1,4 @@ -extension SharingButton { +public extension SharingButton { /// Returns an array of all cached `SharingButtons` objects. /// diff --git a/WordPress/Classes/Models/SharingButton.swift b/WordPress/WordPressData/Swift/SharingButton.swift similarity index 79% rename from WordPress/Classes/Models/SharingButton.swift rename to WordPress/WordPressData/Swift/SharingButton.swift index f7bc7ba7af4e..1b58efae2a11 100644 --- a/WordPress/Classes/Models/SharingButton.swift +++ b/WordPress/WordPressData/Swift/SharingButton.swift @@ -2,8 +2,8 @@ import Foundation import CoreData @objc open class SharingButton: NSManagedObject { - @objc static let visible = "visible" - @objc static let hidden = "hidden" + @objc public static let visible = "visible" + @objc public static let hidden = "hidden" // Relations @NSManaged open var blog: Blog @@ -17,7 +17,7 @@ import CoreData @NSManaged open var visibility: String? @NSManaged open var order: NSNumber - @objc var visible: Bool { + @objc public var visible: Bool { return visibility == SharingButton.visible } } diff --git a/WordPress/Classes/Models/SiteInfo.swift b/WordPress/WordPressData/Swift/SiteInfo.swift similarity index 100% rename from WordPress/Classes/Models/SiteInfo.swift rename to WordPress/WordPressData/Swift/SiteInfo.swift diff --git a/WordPress/WordPressData/Swift/SiteInformation.swift b/WordPress/WordPressData/Swift/SiteInformation.swift new file mode 100644 index 000000000000..112a01b48801 --- /dev/null +++ b/WordPress/WordPressData/Swift/SiteInformation.swift @@ -0,0 +1,20 @@ +public struct SiteInformation { + public let title: String + public let tagLine: String? + + /// if title is `nil`, then the corresponding `SiteInformation` value is `nil`. + public init?(title: String?, tagLine: String?) { + guard let title else { + return nil + } + self.title = title + self.tagLine = tagLine + } +} + +extension SiteInformation: Equatable { + public static func ==(lhs: SiteInformation, rhs: SiteInformation) -> Bool { + return lhs.title == rhs.title && + lhs.tagLine == rhs.tagLine + } +} diff --git a/WordPress/Classes/ViewRelated/Reader/Controllers/SiteOrganizationType.swift b/WordPress/WordPressData/Swift/SiteOrganizationType.swift similarity index 76% rename from WordPress/Classes/ViewRelated/Reader/Controllers/SiteOrganizationType.swift rename to WordPress/WordPressData/Swift/SiteOrganizationType.swift index b40e84c6eed1..36f2d4dd3c4d 100644 --- a/WordPress/Classes/ViewRelated/Reader/Controllers/SiteOrganizationType.swift +++ b/WordPress/WordPressData/Swift/SiteOrganizationType.swift @@ -1,4 +1,4 @@ -@objc enum SiteOrganizationType: Int { +@objc public enum SiteOrganizationType: Int { // site does not belong to an organization case none // site is an A8C P2 diff --git a/WordPress/Classes/Models/SiteSuggestion+CoreDataClass.swift b/WordPress/WordPressData/Swift/SiteSuggestion+CoreDataClass.swift similarity index 96% rename from WordPress/Classes/Models/SiteSuggestion+CoreDataClass.swift rename to WordPress/WordPressData/Swift/SiteSuggestion+CoreDataClass.swift index fd7487bb82e1..36a89d9a9304 100644 --- a/WordPress/Classes/Models/SiteSuggestion+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/SiteSuggestion+CoreDataClass.swift @@ -1,7 +1,7 @@ import Foundation import CoreData -extension CodingUserInfoKey { +public extension CodingUserInfoKey { static let managedObjectContext = CodingUserInfoKey(rawValue: "managedObjectContext")! } diff --git a/WordPress/Classes/Models/SiteSuggestion+CoreDataProperties.swift b/WordPress/WordPressData/Swift/SiteSuggestion+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/SiteSuggestion+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/SiteSuggestion+CoreDataProperties.swift diff --git a/WordPress/Classes/Utility/Spotlight/Utils/SearchIdentifierGenerator.swift b/WordPress/WordPressData/Swift/Spotlight/SearchIdentifierGenerator.swift similarity index 70% rename from WordPress/Classes/Utility/Spotlight/Utils/SearchIdentifierGenerator.swift rename to WordPress/WordPressData/Swift/Spotlight/SearchIdentifierGenerator.swift index ce5ea9c16d0c..021ecc09917d 100644 --- a/WordPress/Classes/Utility/Spotlight/Utils/SearchIdentifierGenerator.swift +++ b/WordPress/WordPressData/Swift/Spotlight/SearchIdentifierGenerator.swift @@ -1,13 +1,13 @@ import Foundation -struct SearchIdentifierGenerator { +public struct SearchIdentifierGenerator { internal static let separator = "|~~~|" internal static func composeUniqueIdentifier(itemType: SearchItemType, domain: String, identifier: String) -> String { return "\(itemType.stringValue())\(separator)\(domain)\(separator)\(identifier)" } - internal static func decomposeFromUniqueIdentifier(_ combined: String) -> (itemType: SearchItemType, domain: String, identifier: String) { + public static func decomposeFromUniqueIdentifier(_ combined: String) -> (itemType: SearchItemType, domain: String, identifier: String) { let components = combined.components(separatedBy: separator) return (SearchItemType(index: components[0]), components[1], components[2]) diff --git a/WordPress/Classes/Utility/Spotlight/Protocols/SearchableActivityConvertable.swift b/WordPress/WordPressData/Swift/Spotlight/SearchableActivityConvertable.swift similarity index 94% rename from WordPress/Classes/Utility/Spotlight/Protocols/SearchableActivityConvertable.swift rename to WordPress/WordPressData/Swift/Spotlight/SearchableActivityConvertable.swift index fe54a4314d8f..7f7132f7bc02 100644 --- a/WordPress/Classes/Utility/Spotlight/Protocols/SearchableActivityConvertable.swift +++ b/WordPress/WordPressData/Swift/Spotlight/SearchableActivityConvertable.swift @@ -6,7 +6,7 @@ import UniformTypeIdentifiers /// Custom NSUSerActivity types for the WPiOS. Primarily used for navigation points. /// -enum WPActivityType: String { +public enum WPActivityType: String { case siteList = "org.wordpress.mysites" case siteDetails = "org.wordpress.mysites.details" case reader = "org.wordpress.reader" @@ -42,11 +42,11 @@ extension WPActivityType { /// NSUserActivity userInfo keys /// -enum WPActivityUserInfoKeys: String { +public enum WPActivityUserInfoKeys: String { case siteId = "siteid" } -@objc protocol SearchableActivityConvertable { +@objc public protocol SearchableActivityConvertable { /// Type name used to uniquly indentify this activity. /// @objc var activityType: String {get} @@ -75,8 +75,8 @@ enum WPActivityUserInfoKeys: String { @objc optional var activityDescription: String? {get} } -extension SearchableActivityConvertable where Self: UIViewController { - internal func registerUserActivity() { +public extension SearchableActivityConvertable where Self: UIViewController { + func registerUserActivity() { let activity = NSUserActivity(activityType: activityType) activity.title = activityTitle diff --git a/WordPress/Classes/Utility/Spotlight/Protocols/SearchableItemConvertable.swift b/WordPress/WordPressData/Swift/Spotlight/SearchableItemConvertable.swift similarity index 94% rename from WordPress/Classes/Utility/Spotlight/Protocols/SearchableItemConvertable.swift rename to WordPress/WordPressData/Swift/Spotlight/SearchableItemConvertable.swift index 66f145dc9d54..f126285e6c55 100644 --- a/WordPress/Classes/Utility/Spotlight/Protocols/SearchableItemConvertable.swift +++ b/WordPress/WordPressData/Swift/Spotlight/SearchableItemConvertable.swift @@ -32,7 +32,7 @@ import UniformTypeIdentifiers // MARK: - SearchableItemConvertable -@objc protocol SearchableItemConvertable { +@objc public protocol SearchableItemConvertable { /// Identifies the item type this is /// var searchItemType: SearchItemType {get} @@ -74,15 +74,15 @@ import UniformTypeIdentifiers @objc optional var searchExpirationDate: Date? {get} } -extension SearchableItemConvertable { - internal var uniqueIdentifier: String? { +public extension SearchableItemConvertable { + var uniqueIdentifier: String? { guard let searchDomain, let searchIdentifier else { return nil } return SearchIdentifierGenerator.composeUniqueIdentifier(itemType: searchItemType, domain: searchDomain, identifier: searchIdentifier) } - internal func indexableItem() -> CSSearchableItem? { + func indexableItem() -> CSSearchableItem? { guard isSearchable == true, let uniqueIdentifier, let searchTitle, diff --git a/WordPress/Classes/Models/Suggestion.swift b/WordPress/WordPressData/Swift/Suggestion.swift similarity index 100% rename from WordPress/Classes/Models/Suggestion.swift rename to WordPress/WordPressData/Swift/Suggestion.swift diff --git a/WordPress/Classes/Utility/CoreData/TaggedManagedObjectID.swift b/WordPress/WordPressData/Swift/TaggedManagedObjectID.swift similarity index 75% rename from WordPress/Classes/Utility/CoreData/TaggedManagedObjectID.swift rename to WordPress/WordPressData/Swift/TaggedManagedObjectID.swift index ce6502ba3a36..570333b74d54 100644 --- a/WordPress/Classes/Utility/CoreData/TaggedManagedObjectID.swift +++ b/WordPress/WordPressData/Swift/TaggedManagedObjectID.swift @@ -1,3 +1,4 @@ +import CoreData import Foundation import WordPressShared @@ -27,11 +28,11 @@ import WordPressShared /// we can't perform the validation described in `init(objectID:)`. /// /// - SeeAlso: swift-tagged: https://github.com/pointfreeco/swift-tagged -struct TaggedManagedObjectID: Hashable { - let objectID: NSManagedObjectID +public struct TaggedManagedObjectID: Hashable { + public let objectID: NSManagedObjectID /// Create an `TaggedManagedObjectID` instance of the given object. - init(_ object: Model) { + public init(_ object: Model) { var objectID = object.objectID if objectID.isTemporaryID { @@ -39,16 +40,6 @@ struct TaggedManagedObjectID: Hashable { do { try context.obtainPermanentIDs(for: [object]) } catch { - // It should be okay to let the app crash when `obtainPermanentIDs` fails. Because, we crash the app - // intentionally when `save()` fails (see the `ContextManager.internalSave` function). Also, if the - // `obtainPermanentIDs` call fails (which may mean SQLite failing to update the database file), - // then the save call followed (because we typically save newly added model objects) probably is going - // to fail too. Finally, there aren't many save crashes on Sentry and `obtainPermanentIDs` should be - // less likely to throw errors than `NSManagedObjectContext.save` function. - // - // However, just to be safe, we'll log and monitor this error (if it ever happens) for a few releases. - // We can decide later if we'd like to change the assertion to a fatal error. - WordPressAppDelegate.crashLogging?.logError(error) assertionFailure("Failed to obtain permanent id for \(objectID). Error: \(error)") } objectID = object.objectID @@ -69,7 +60,7 @@ struct TaggedManagedObjectID: Hashable { } } -extension NSManagedObjectContext { +public extension NSManagedObjectContext { /// Find the object associated with this object id in the given `context`. /// diff --git a/WordPress/Classes/Models/ThemeIdHelper.swift b/WordPress/WordPressData/Swift/ThemeIdHelper.swift similarity index 66% rename from WordPress/Classes/Models/ThemeIdHelper.swift rename to WordPress/WordPressData/Swift/ThemeIdHelper.swift index bb78e041c85d..bf7c74291ee9 100644 --- a/WordPress/Classes/Models/ThemeIdHelper.swift +++ b/WordPress/WordPressData/Swift/ThemeIdHelper.swift @@ -2,14 +2,15 @@ import Foundation /// Helper class for adding and removing the '-wpcom' suffix from themeIds /// -class ThemeIdHelper: NSObject { +@objc +public class ThemeIdHelper: NSObject { private static let WPComThemesIDSuffix = "-wpcom" - @objc static func themeIdWithWPComSuffix(_ themeId: String) -> String { + @objc public static func themeIdWithWPComSuffix(_ themeId: String) -> String { return themeId.appending(WPComThemesIDSuffix) } - @objc static func themeIdWithWPComSuffixRemoved(_ themeId: String, forBlog blog: Blog) -> String { + @objc public static func themeIdWithWPComSuffixRemoved(_ themeId: String, forBlog blog: Blog) -> String { if blog.supports(.customThemes) && themeIdHasWPComSuffix(themeId) { // When a WP.com theme is used on a JP site, its themeId is modified to themeId-wpcom, // we need to remove this to be able to match it on the theme list @@ -19,7 +20,7 @@ class ThemeIdHelper: NSObject { return themeId } - @objc static func themeIdHasWPComSuffix(_ themeId: String) -> Bool { + @objc public static func themeIdHasWPComSuffix(_ themeId: String) -> Bool { return themeId.hasSuffix(WPComThemesIDSuffix) } } diff --git a/WordPress/Classes/Models/UserProfile.swift b/WordPress/WordPressData/Swift/UserProfile.swift similarity index 100% rename from WordPress/Classes/Models/UserProfile.swift rename to WordPress/WordPressData/Swift/UserProfile.swift diff --git a/WordPress/Classes/Models/UserSettings.swift b/WordPress/WordPressData/Swift/UserSettings.swift similarity index 77% rename from WordPress/Classes/Models/UserSettings.swift rename to WordPress/WordPressData/Swift/UserSettings.swift index 348a77247c0d..50a079cb28d2 100644 --- a/WordPress/Classes/Models/UserSettings.swift +++ b/WordPress/WordPressData/Swift/UserSettings.swift @@ -1,7 +1,7 @@ import Foundation import WordPressShared -struct UserSettings { +public struct UserSettings { /// Stores all `UserSettings` keys. /// /// The additional level of indirection allows these keys to be retrieved from tests. @@ -10,20 +10,20 @@ struct UserSettings { /// /// Any change to these keys is a breaking change without some kind of migration. /// It's probably best never to change them. - enum Keys: String, CaseIterable { + public enum Keys: String, CaseIterable { case crashLoggingOptOutKey = "crashlytics_opt_out" case forceCrashLoggingKey = "force-crash-logging" case defaultDotComUUIDKey = "AccountDefaultDotcomUUID" } @UserDefault(Keys.crashLoggingOptOutKey.rawValue, defaultValue: false) - static var userHasOptedOutOfCrashLogging: Bool + public static var userHasOptedOutOfCrashLogging: Bool @UserDefault(Keys.forceCrashLoggingKey.rawValue, defaultValue: false) - static var userHasForcedCrashLoggingEnabled: Bool + public static var userHasForcedCrashLoggingEnabled: Bool @NullableUserDefault(Keys.defaultDotComUUIDKey.rawValue) - static var defaultDotComUUID: String? + public static var defaultDotComUUID: String? /// Reset all UserSettings back to their defaults static func reset() { @@ -33,22 +33,23 @@ struct UserSettings { /// Objective-C Wrapper for UserSettings @objc(UserSettings) -class ObjcCUserSettings: NSObject { +// FIXME: public access-level required only for the unit tests, which means that this is unused in prod. Let's migrate those tests soon! +public class ObjcCUserSettings: NSObject { @objc - static var defaultDotComUUID: String? { + public static var defaultDotComUUID: String? { get { UserSettings.defaultDotComUUID } set { UserSettings.defaultDotComUUID = newValue } } @objc - static func reset() { + public static func reset() { UserSettings.reset() } } /// A property wrapper for UserDefaults access @propertyWrapper -struct UserDefault { +public struct UserDefault { let key: String let defaultValue: T @@ -57,7 +58,7 @@ struct UserDefault { self.defaultValue = defaultValue } - var wrappedValue: T { + public var wrappedValue: T { get { return UserPersistentStoreFactory.instance().object(forKey: key) as? T ?? defaultValue } @@ -69,14 +70,14 @@ struct UserDefault { /// A property wrapper for optional UserDefaults that return `nil` by default @propertyWrapper -struct NullableUserDefault { +public struct NullableUserDefault { let key: String init(_ key: String) { self.key = key } - var wrappedValue: T? { + public var wrappedValue: T? { get { return UserPersistentStoreFactory.instance().object(forKey: key) as? T } diff --git a/WordPress/Classes/Models/UserSuggestion+Comparable.swift b/WordPress/WordPressData/Swift/UserSuggestion+Comparable.swift similarity index 100% rename from WordPress/Classes/Models/UserSuggestion+Comparable.swift rename to WordPress/WordPressData/Swift/UserSuggestion+Comparable.swift diff --git a/WordPress/Classes/Models/UserSuggestion+CoreDataClass.swift b/WordPress/WordPressData/Swift/UserSuggestion+CoreDataClass.swift similarity index 91% rename from WordPress/Classes/Models/UserSuggestion+CoreDataClass.swift rename to WordPress/WordPressData/Swift/UserSuggestion+CoreDataClass.swift index 3baceacd9cea..7470e8f6ea1f 100644 --- a/WordPress/Classes/Models/UserSuggestion+CoreDataClass.swift +++ b/WordPress/WordPressData/Swift/UserSuggestion+CoreDataClass.swift @@ -4,7 +4,7 @@ import CoreData @objc(UserSuggestion) public class UserSuggestion: NSManagedObject { - convenience init?(dictionary: [String: Any], context: NSManagedObjectContext) { + public convenience init?(dictionary: [String: Any], context: NSManagedObjectContext) { let userLoginValue = dictionary["user_login"] as? String let displayNameValue = dictionary["display_name"] as? String diff --git a/WordPress/Classes/Models/UserSuggestion+CoreDataProperties.swift b/WordPress/WordPressData/Swift/UserSuggestion+CoreDataProperties.swift similarity index 100% rename from WordPress/Classes/Models/UserSuggestion+CoreDataProperties.swift rename to WordPress/WordPressData/Swift/UserSuggestion+CoreDataProperties.swift diff --git a/WordPress/WordPressData/Swift/WPAccount+Keychain.swift b/WordPress/WordPressData/Swift/WPAccount+Keychain.swift new file mode 100644 index 000000000000..15e7eb962b17 --- /dev/null +++ b/WordPress/WordPressData/Swift/WPAccount+Keychain.swift @@ -0,0 +1,8 @@ +import BuildSettingsKit + +public extension WPAccount { + + @objc class var authKeychainServiceName: String { + BuildSettings.current.authKeychainServiceName + } +} diff --git a/WordPress/Classes/Models/WPAccount+Lookup.swift b/WordPress/WordPressData/Swift/WPAccount+Lookup.swift similarity index 94% rename from WordPress/Classes/Models/WPAccount+Lookup.swift rename to WordPress/WordPressData/Swift/WPAccount+Lookup.swift index 468899f2aa97..f64cf6832acd 100644 --- a/WordPress/Classes/Models/WPAccount+Lookup.swift +++ b/WordPress/WordPressData/Swift/WPAccount+Lookup.swift @@ -15,13 +15,6 @@ public extension WPAccount { return self.uuid == uuid } - // This is here in an extension that belongs to the apps target so we can decouple WPAccount from AppConfiguration. - // Decoupling allows moving the type to WordPressData, see https://github.com/wordpress-mobile/WordPress-iOS/issues/24165. - @objc - static func tokenForUsername(_ username: String) -> String? { - token(forUsername: username, isJetpack: AppConfiguration.isJetpack) - } - /// Does this `WPAccount` object have any associated blogs? /// @objc diff --git a/WordPress/WordPressData/Swift/WPAccount+RestApi.swift b/WordPress/WordPressData/Swift/WPAccount+RestApi.swift new file mode 100644 index 000000000000..7eba15c82e5a --- /dev/null +++ b/WordPress/WordPressData/Swift/WPAccount+RestApi.swift @@ -0,0 +1,12 @@ +import CoreData +import WordPressKit + +public extension WPAccount { + + /// A `WordPressRestComApi` object if a default account exists in the giveng `NSManagedObjectContext` and is a WordPress.com account. + /// Otherwise, it returns `nil` + static func defaultWordPressComAccountRestAPI(in context: NSManagedObjectContext) throws -> WordPressComRestApi? { + let account = try WPAccount.lookupDefaultWordPressComAccount(in: context) + return account?._private_wordPressComRestApi + } +} diff --git a/WordPress/WordPressData/WordPressData.h b/WordPress/WordPressData/WordPressData.h new file mode 100644 index 000000000000..e78a103f5a56 --- /dev/null +++ b/WordPress/WordPressData/WordPressData.h @@ -0,0 +1,21 @@ +#import + +FOUNDATION_EXPORT double WordPressDataVersionNumber; +FOUNDATION_EXPORT const unsigned char WordPressDataVersionString[]; + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +// Should be private/project but currently can't be found at compilation otherwise +#import +#import +#import +#import diff --git a/WordPress/WordPressData/WordPressDataPrefix.pch b/WordPress/WordPressData/WordPressDataPrefix.pch new file mode 100644 index 000000000000..508e5f92a856 --- /dev/null +++ b/WordPress/WordPressData/WordPressDataPrefix.pch @@ -0,0 +1,6 @@ +// CocoaLumberjack Default Logging Level +#ifndef COCOA_LUMBERJACK +#define COCOA_LUMBERJACK +@import CocoaLumberjack; +extern DDLogLevel ddLogLevel; +#endif diff --git a/WordPress/WordPressDataTests/WordPressDataTests.swift b/WordPress/WordPressDataTests/WordPressDataTests.swift new file mode 100644 index 000000000000..4bed1051d858 --- /dev/null +++ b/WordPress/WordPressDataTests/WordPressDataTests.swift @@ -0,0 +1,9 @@ +import XCTest +@testable import WordPressData + +final class WordPressDataTests: XCTestCase { + + func testDummy() { + XCTAssert(true) + } +} diff --git a/WordPress/WordPressDataTests/WordPressDataUnitTests.xctestplan b/WordPress/WordPressDataTests/WordPressDataUnitTests.xctestplan new file mode 100644 index 000000000000..2cdcffff6318 --- /dev/null +++ b/WordPress/WordPressDataTests/WordPressDataUnitTests.xctestplan @@ -0,0 +1,24 @@ +{ + "configurations" : [ + { + "id" : "49ADC4AB-D8FB-4D29-9357-5609A4C5A761", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:WordPress.xcodeproj", + "identifier" : "3F2AA3E92D81457F002A4E94", + "name" : "WordPressDataTests" + } + } + ], + "version" : 1 +} diff --git a/WordPress/WordPressTest/BlogBuilder.swift b/WordPress/WordPressTest/BlogBuilder.swift index 1b7c1e5d45e9..a98b233ca19e 100644 --- a/WordPress/WordPressTest/BlogBuilder.swift +++ b/WordPress/WordPressTest/BlogBuilder.swift @@ -80,7 +80,7 @@ final class BlogBuilder { func with(siteName: String) -> Self { if blog.settings == nil { - blog.settings = NSEntityDescription.insertNewObject(forEntityName: BlogSettings.entityName(), into: context) as! BlogSettings + blog.settings = BlogSettings.newSettings(in: context) } blog.settings?.name = siteName return self diff --git a/WordPress/WordPressTest/BlogListViewModelTests.swift b/WordPress/WordPressTest/BlogListViewModelTests.swift index cdcd3842e080..cd8251963571 100644 --- a/WordPress/WordPressTest/BlogListViewModelTests.swift +++ b/WordPress/WordPressTest/BlogListViewModelTests.swift @@ -1,3 +1,4 @@ +import WordPressData import WordPressShared import XCTest @testable import WordPress diff --git a/WordPress/WordPressTest/BlogServiceTest.m b/WordPress/WordPressTest/BlogServiceTest.m index ddaa752e53d1..4c1a1098a947 100644 --- a/WordPress/WordPressTest/BlogServiceTest.m +++ b/WordPress/WordPressTest/BlogServiceTest.m @@ -1,9 +1,7 @@ #import #import "AccountService.h" #import "BlogService.h" -@import WordPressDataObjC; -#import "Blog.h" -#import "WPAccount.h" +@import WordPressData; #import "WordPressTest-Swift.h" @import OCMock; diff --git a/WordPress/WordPressTest/BlogTitleTests.swift b/WordPress/WordPressTest/BlogTitleTests.swift index 067cfbbe787d..2819f233eb17 100644 --- a/WordPress/WordPressTest/BlogTitleTests.swift +++ b/WordPress/WordPressTest/BlogTitleTests.swift @@ -15,7 +15,7 @@ class BlogTitleTests: CoreDataTestCase { // Given a blog // When blogName is a string let blogName = "my blog name" - blog.settings = newSettings() + blog.settings = BlogSettings.newSettings(in: mainContext) blog.settings?.name = blogName // Then blogTitle is blogName @@ -25,7 +25,7 @@ class BlogTitleTests: CoreDataTestCase { func testBlogSettingsNameIsNil() throws { // Given a blog // When blogName is nil - blog.settings = newSettings() + blog.settings = BlogSettings.newSettings(in: mainContext) blog.settings?.name = nil // Then blogTitle is blogDisplayURL @@ -38,14 +38,6 @@ class BlogTitleTests: CoreDataTestCase { // Then blogTitle is blogDisplayURL XCTAssertEqual(blog.title, Constants.blogDisplayURL) } - - // MARK: - Private Helpers - fileprivate func newSettings() -> BlogSettings { - let name = BlogSettings.classNameWithoutNamespaces() - let entity = NSEntityDescription.insertNewObject(forEntityName: name, into: mainContext) - - return entity as! BlogSettings - } } private extension BlogTitleTests { diff --git a/WordPress/WordPressTest/BloggingPromptsServiceTests.swift b/WordPress/WordPressTest/BloggingPromptsServiceTests.swift index bd2a9881d51b..4e003e7ed344 100644 --- a/WordPress/WordPressTest/BloggingPromptsServiceTests.swift +++ b/WordPress/WordPressTest/BloggingPromptsServiceTests.swift @@ -1,8 +1,8 @@ import XCTest import OHHTTPStubs import OHHTTPStubsSwift - @testable import WordPress +@testable import WordPressData final class BloggingPromptsServiceTests: CoreDataTestCase { private let siteID = 1 diff --git a/WordPress/WordPressTest/ContentMigrationCoordinatorTests.swift b/WordPress/WordPressTest/ContentMigrationCoordinatorTests.swift index f80e4a678123..3f701cdfdd9a 100644 --- a/WordPress/WordPressTest/ContentMigrationCoordinatorTests.swift +++ b/WordPress/WordPressTest/ContentMigrationCoordinatorTests.swift @@ -1,6 +1,7 @@ import XCTest @testable import WordPress +@testable import WordPressData final class ContentMigrationCoordinatorTests: CoreDataTestCase { @@ -266,7 +267,10 @@ private extension ContentMigrationCoordinatorTests { completion?(.failure(exportErrorToReturn)) } - func importData(completion: ((Result) -> Void)? = nil) { + func importData( + isJetpack: Bool, + completion: ((Result) -> Void)? = nil + ) { importCalled = true guard let importErrorToReturn else { completion?(.success(())) diff --git a/WordPress/WordPressTest/ContextManager+Helpers.swift b/WordPress/WordPressTest/ContextManager+Helpers.swift index f9d375d27097..6288cac149bb 100644 --- a/WordPress/WordPressTest/ContextManager+Helpers.swift +++ b/WordPress/WordPressTest/ContextManager+Helpers.swift @@ -1,6 +1,6 @@ import XCTest -@testable import WordPress +@testable import WordPressData extension ContextManager { diff --git a/WordPress/WordPressTest/Dashboard/DashboardPostsSyncManagerTests.swift b/WordPress/WordPressTest/Dashboard/DashboardPostsSyncManagerTests.swift index 219d8f310653..6cc706468009 100644 --- a/WordPress/WordPressTest/Dashboard/DashboardPostsSyncManagerTests.swift +++ b/WordPress/WordPressTest/Dashboard/DashboardPostsSyncManagerTests.swift @@ -1,4 +1,5 @@ import XCTest +import WordPressData @testable import WordPress class DashboardPostsSyncManagerTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/FormattableCommentContentTests.swift b/WordPress/WordPressTest/FormattableCommentContentTests.swift index 2db3de691299..d3f21dba48a9 100644 --- a/WordPress/WordPressTest/FormattableCommentContentTests.swift +++ b/WordPress/WordPressTest/FormattableCommentContentTests.swift @@ -135,7 +135,7 @@ final class FormattableCommentContentTests: CoreDataTestCase { return try JSONObject(fromFileNamed: "notifications-comment-content.json") } - private func loadLikeNotification() throws -> WordPress.Notification { + private func loadLikeNotification() throws -> WordPressData.Notification { return try utility.loadLikeNotification() } diff --git a/WordPress/WordPressTest/FormattableUserContentTests.swift b/WordPress/WordPressTest/FormattableUserContentTests.swift index 3531010ae386..1efb1f10fb6b 100644 --- a/WordPress/WordPressTest/FormattableUserContentTests.swift +++ b/WordPress/WordPressTest/FormattableUserContentTests.swift @@ -133,7 +133,7 @@ final class FormattableUserContentTests: CoreDataTestCase { return try JSONObject(fromFileNamed: "notifications-user-content.json") } - private func loadLikeNotification() throws -> WordPress.Notification { + private func loadLikeNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-like.json", insertInto: contextManager.mainContext) } diff --git a/WordPress/WordPressTest/MediaRepositoryTests.swift b/WordPress/WordPressTest/MediaRepositoryTests.swift index 3b7d68d6d93a..c62aeef716c1 100644 --- a/WordPress/WordPressTest/MediaRepositoryTests.swift +++ b/WordPress/WordPressTest/MediaRepositoryTests.swift @@ -1,3 +1,4 @@ +import WordPressData import XCTest @testable import WordPress diff --git a/WordPress/WordPressTest/MediaServiceUpdateTests.m b/WordPress/WordPressTest/MediaServiceUpdateTests.m index 7e0993bfae1e..1f7c9c55db03 100644 --- a/WordPress/WordPressTest/MediaServiceUpdateTests.m +++ b/WordPress/WordPressTest/MediaServiceUpdateTests.m @@ -1,5 +1,5 @@ #import -#import "Blog.h" +@import WordPressData; #import "WordPressTest-Swift.h" @import WordPressKit; diff --git a/WordPress/WordPressTest/MenusServiceTests.m b/WordPress/WordPressTest/MenusServiceTests.m index 61d4d7bbfdfb..ae186fe15445 100644 --- a/WordPress/WordPressTest/MenusServiceTests.m +++ b/WordPress/WordPressTest/MenusServiceTests.m @@ -1,9 +1,9 @@ #import #import "MenusService.h" -#import "Blog.h" #import "Menu.h" #import "MenuLocation.h" #import "MenuItem.h" +@import WordPressData; #import "WordPressTest-Swift.h" @import OCMock; diff --git a/WordPress/WordPressTest/NotificationSyncMediatorTests.swift b/WordPress/WordPressTest/NotificationSyncMediatorTests.swift index da0ec4c07f45..344bfc608f95 100644 --- a/WordPress/WordPressTest/NotificationSyncMediatorTests.swift +++ b/WordPress/WordPressTest/NotificationSyncMediatorTests.swift @@ -131,7 +131,7 @@ class NotificationSyncMediatorTests: CoreDataTestCase { // Inject Dummy Note let path = "notifications-like.json" - let note = try WordPress.Notification.fixture(fromFile: path, insertInto: mainContext) + let note = try WordPressData.Notification.fixture(fromFile: path, insertInto: mainContext) XCTAssertNotNil(note) XCTAssertFalse(note.read) @@ -163,9 +163,9 @@ class NotificationSyncMediatorTests: CoreDataTestCase { let path1 = "notifications-like.json" let path2 = "notifications-new-follower.json" let path3 = "notifications-unapproved-comment.json" - let note1 = try WordPress.Notification.fixture(fromFile: path1, insertInto: mainContext) - let note2 = try WordPress.Notification.fixture(fromFile: path2, insertInto: mainContext) - let note3 = try WordPress.Notification.fixture(fromFile: path3, insertInto: mainContext) + let note1 = try WordPressData.Notification.fixture(fromFile: path1, insertInto: mainContext) + let note2 = try WordPressData.Notification.fixture(fromFile: path2, insertInto: mainContext) + let note3 = try WordPressData.Notification.fixture(fromFile: path3, insertInto: mainContext) XCTAssertFalse(note1.read) XCTAssertFalse(note3.read) @@ -201,9 +201,9 @@ class NotificationSyncMediatorTests: CoreDataTestCase { let path1 = "notifications-like.json" let path2 = "notifications-new-follower.json" let path3 = "notifications-unapproved-comment.json" - let note1 = try WordPress.Notification.fixture(fromFile: path1, insertInto: mainContext) - let note2 = try WordPress.Notification.fixture(fromFile: path2, insertInto: mainContext) - let note3 = try WordPress.Notification.fixture(fromFile: path3, insertInto: mainContext) + let note1 = try WordPressData.Notification.fixture(fromFile: path1, insertInto: mainContext) + let note2 = try WordPressData.Notification.fixture(fromFile: path2, insertInto: mainContext) + let note3 = try WordPressData.Notification.fixture(fromFile: path3, insertInto: mainContext) XCTAssertFalse(note1.read) XCTAssertFalse(note3.read) diff --git a/WordPress/WordPressTest/NotificationTests.swift b/WordPress/WordPressTest/NotificationTests.swift index 4739bc79ef61..3b1922d27294 100644 --- a/WordPress/WordPressTest/NotificationTests.swift +++ b/WordPress/WordPressTest/NotificationTests.swift @@ -236,7 +236,7 @@ class NotificationTests: CoreDataTestCase { let _ = try utility.loadCommentNotification() contextManager.saveContextAndWait(mainContext) - let fetchRequest = NSFetchRequest(entityName: WordPress.Notification.entityName()) + let fetchRequest = NSFetchRequest(entityName: WordPressData.Notification.entityName()) fetchRequest.predicate = NSPredicate(format: "notificationId == %@", commentNotificationId) let note = try XCTUnwrap(mainContext.fetch(fetchRequest).first) @@ -265,23 +265,23 @@ class NotificationTests: CoreDataTestCase { // MARK: - Helpers - func loadBadgeNotification() throws -> WordPress.Notification { + func loadBadgeNotification() throws -> WordPressData.Notification { return try utility.loadBadgeNotification() } - func loadLikeNotification() throws -> WordPress.Notification { + func loadLikeNotification() throws -> WordPressData.Notification { return try utility.loadLikeNotification() } - func loadLikeMultipleAvatarNotification() throws -> WordPress.Notification { + func loadLikeMultipleAvatarNotification() throws -> WordPressData.Notification { return try utility.loadLikeMultipleAvatarNotification() } - func loadFollowerNotification() throws -> WordPress.Notification { + func loadFollowerNotification() throws -> WordPressData.Notification { return try utility.loadFollowerNotification() } - func loadCommentNotification() throws -> WordPress.Notification { + func loadCommentNotification() throws -> WordPressData.Notification { return try utility.loadCommentNotification() } } diff --git a/WordPress/WordPressTest/NotificationTextContentTests.swift b/WordPress/WordPressTest/NotificationTextContentTests.swift index e2d99ffaebfb..450e6cdf0a63 100644 --- a/WordPress/WordPressTest/NotificationTextContentTests.swift +++ b/WordPress/WordPressTest/NotificationTextContentTests.swift @@ -95,7 +95,7 @@ final class NotificationTextContentTests: CoreDataTestCase { return try JSONObject(fromFileNamed: "notifications-button-text-content.json") } - private func loadLikeNotification() throws -> WordPress.Notification { + private func loadLikeNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-like.json", insertInto: contextManager.mainContext) } diff --git a/WordPress/WordPressTest/NotificationUtility.swift b/WordPress/WordPressTest/NotificationUtility.swift index 512a49a5d312..0ef581210e40 100644 --- a/WordPress/WordPressTest/NotificationUtility.swift +++ b/WordPress/WordPressTest/NotificationUtility.swift @@ -18,38 +18,38 @@ class NotificationUtility { return Notification.classNameWithoutNamespaces() } - func loadBadgeNotification() throws -> WordPress.Notification { + func loadBadgeNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-badge.json", insertInto: context) } - func loadLikeNotification() throws -> WordPress.Notification { + func loadLikeNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-like.json", insertInto: context) } - func loadLikeMultipleAvatarNotification() throws -> WordPress.Notification { + func loadLikeMultipleAvatarNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-like-multiple-avatar.json", insertInto: context) } - func loadFollowerNotification() throws -> WordPress.Notification { + func loadFollowerNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-new-follower.json", insertInto: context) } - func loadCommentNotification() throws -> WordPress.Notification { + func loadCommentNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-replied-comment.json", insertInto: context) } - func loadUnapprovedCommentNotification() throws -> WordPress.Notification { + func loadUnapprovedCommentNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-unapproved-comment.json", insertInto: context) } - func loadPingbackNotification() throws -> WordPress.Notification { + func loadPingbackNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-pingback.json", insertInto: context) } func mockCommentContent() throws -> FormattableCommentContent { let dictionary = try JSONObject(fromFileNamed: "notifications-replied-comment.json") let body = dictionary["body"] - let blocks = NotificationContentFactory.content(from: body as! [[String: AnyObject]], actionsParser: NotificationActionParser(), parent: WordPress.Notification(context: context)) + let blocks = NotificationContentFactory.content(from: body as! [[String: AnyObject]], actionsParser: NotificationActionParser(), parent: WordPressData.Notification(context: context)) return blocks.filter { $0.kind == .comment }.first! as! FormattableCommentContent } diff --git a/WordPress/WordPressTest/NotificationsContentFactoryTests.swift b/WordPress/WordPressTest/NotificationsContentFactoryTests.swift index a1e2c91c991e..398d3bf9667f 100644 --- a/WordPress/WordPressTest/NotificationsContentFactoryTests.swift +++ b/WordPress/WordPressTest/NotificationsContentFactoryTests.swift @@ -1,4 +1,5 @@ import XCTest +import WordPressData @testable import WordPress @testable import FormattableContentKit @@ -35,7 +36,7 @@ final class NotificationsContentFactoryTests: CoreDataTestCase { return try JSONObject(fromFileNamed: "notifications-user-content.json") } - func loadLikeNotification() throws -> WordPress.Notification { + func loadLikeNotification() throws -> WordPressData.Notification { return try .fixture(fromFile: "notifications-like.json", insertInto: contextManager.mainContext) } } diff --git a/WordPress/WordPressTest/PostCategoryServiceTests.m b/WordPress/WordPressTest/PostCategoryServiceTests.m index c2eb3b563dbd..e7391a277eae 100644 --- a/WordPress/WordPressTest/PostCategoryServiceTests.m +++ b/WordPress/WordPressTest/PostCategoryServiceTests.m @@ -1,7 +1,7 @@ #import -#import "Blog.h" #import "PostCategory.h" #import "PostCategoryService.h" +@import WordPressData; #import "WordPressTest-Swift.h" @import WordPressKit; diff --git a/WordPress/WordPressTest/PostRepositoryPostsListTests.swift b/WordPress/WordPressTest/PostRepositoryPostsListTests.swift index 5f72efac09db..e92600afc0a3 100644 --- a/WordPress/WordPressTest/PostRepositoryPostsListTests.swift +++ b/WordPress/WordPressTest/PostRepositoryPostsListTests.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import XCTest import OHHTTPStubs import OHHTTPStubsSwift diff --git a/WordPress/WordPressTest/PostRepositoryTests.swift b/WordPress/WordPressTest/PostRepositoryTests.swift index 681924dadc38..6445c06d28ba 100644 --- a/WordPress/WordPressTest/PostRepositoryTests.swift +++ b/WordPress/WordPressTest/PostRepositoryTests.swift @@ -1,3 +1,4 @@ +@preconcurrency @testable import WordPressData import XCTest @testable import WordPress @@ -221,14 +222,14 @@ class PostRepositoryTests: CoreDataTestCase { // These mock classes are copied from PostServiceWPComTests. We can't simply remove the `private` in the original class // definition, because Xcode would complian about 'WordPress' module not found. -private class PostServiceRemoteFactoryMock: PostServiceRemoteFactory { +public class PostServiceRemoteFactoryMock: PostServiceRemoteFactory { var remoteToReturn: PostServiceRemote? - override func forBlog(_ blog: Blog) -> PostServiceRemote? { + public override func forBlog(_ blog: Blog) -> PostServiceRemote? { return remoteToReturn } - override func restRemoteFor(siteID: NSNumber, context: NSManagedObjectContext) -> PostServiceRemoteREST? { + public override func restRemoteFor(siteID: NSNumber, context: NSManagedObjectContext) -> PostServiceRemoteREST? { return remoteToReturn as? PostServiceRemoteREST } } diff --git a/WordPress/WordPressTest/PostTagServiceTests.m b/WordPress/WordPressTest/PostTagServiceTests.m index 557d75288dc3..b9996f27bf78 100644 --- a/WordPress/WordPressTest/PostTagServiceTests.m +++ b/WordPress/WordPressTest/PostTagServiceTests.m @@ -1,7 +1,7 @@ #import -#import "Blog.h" #import "PostTag.h" #import "PostTagService.h" +@import WordPressData; #import "WordPressTest-Swift.h" @import WordPressKit; diff --git a/WordPress/WordPressTest/PostsListAPIStub.swift b/WordPress/WordPressTest/PostsListAPIStub.swift index e13ddf510508..1df4944e81f0 100644 --- a/WordPress/WordPressTest/PostsListAPIStub.swift +++ b/WordPress/WordPressTest/PostsListAPIStub.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import XCTest import OHHTTPStubs import OHHTTPStubsSwift diff --git a/WordPress/WordPressTest/ReaderPostBackupTests.swift b/WordPress/WordPressTest/ReaderPostBackupTests.swift index d9c2ed159fec..dd4e0df5a5c8 100644 --- a/WordPress/WordPressTest/ReaderPostBackupTests.swift +++ b/WordPress/WordPressTest/ReaderPostBackupTests.swift @@ -2,6 +2,7 @@ import XCTest import Nimble @testable import WordPress +@testable import WordPressData final class ReaderPostBackupTests: XCTestCase { private let storeURL = URL.Helpers.temporaryFile(named: "ReaderPostBackup.sqlite") diff --git a/WordPress/WordPressTest/ReaderPostServiceTest.m b/WordPress/WordPressTest/ReaderPostServiceTest.m index ac0ebb07b964..b8077fe22b99 100644 --- a/WordPress/WordPressTest/ReaderPostServiceTest.m +++ b/WordPress/WordPressTest/ReaderPostServiceTest.m @@ -1,8 +1,7 @@ -@import WordPressDataObjC; +@import WordPressData; #import -#import "WPAccount.h" #import "ReaderTopicService.h" #import "ReaderPost.h" #import "ReaderPostService.h" diff --git a/WordPress/WordPressTest/ThemeServiceTests.m b/WordPress/WordPressTest/ThemeServiceTests.m index 449653b6baf8..dbdc48a22c95 100644 --- a/WordPress/WordPressTest/ThemeServiceTests.m +++ b/WordPress/WordPressTest/ThemeServiceTests.m @@ -1,8 +1,7 @@ #import -#import "Blog.h" #import "Theme.h" #import "ThemeService.h" -#import "WPAccount.h" +@import WordPressData; #import "WordPressTest-Swift.h" @import WordPressKit; diff --git a/WordPress/WordPressTest/ViewRelated/Post/Controllers/PublishSettingsControllerTests.swift b/WordPress/WordPressTest/ViewRelated/Post/Controllers/PublishSettingsControllerTests.swift index 2e41bdf66cae..0fde16fb44e0 100644 --- a/WordPress/WordPressTest/ViewRelated/Post/Controllers/PublishSettingsControllerTests.swift +++ b/WordPress/WordPressTest/ViewRelated/Post/Controllers/PublishSettingsControllerTests.swift @@ -72,14 +72,3 @@ class PublishSettingsViewControllerTests: CoreDataTestCase { } } } - -extension PublishSettingsViewControllerTests { - // MARK: - Private Helpers - fileprivate func newSettings() -> BlogSettings { - let context = contextManager.mainContext - let name = BlogSettings.classNameWithoutNamespaces() - let entity = NSEntityDescription.insertNewObject(forEntityName: name, into: context) - - return entity as! BlogSettings - } -} diff --git a/WordPress/WordPressTest/AbstractPostTest.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/AbstractPostTest.swift similarity index 99% rename from WordPress/WordPressTest/AbstractPostTest.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/AbstractPostTest.swift index 787f609ab12d..48034e42e107 100644 --- a/WordPress/WordPressTest/AbstractPostTest.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/AbstractPostTest.swift @@ -1,6 +1,6 @@ import XCTest import WordPressKit -@testable import WordPress +@testable import WordPressData class AbstractPostTest: CoreDataTestCase { diff --git a/WordPress/WordPressTest/BasePostTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/BasePostTests.swift similarity index 98% rename from WordPress/WordPressTest/BasePostTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/BasePostTests.swift index 5e38a40c7d88..2611c26e1e78 100644 --- a/WordPress/WordPressTest/BasePostTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/BasePostTests.swift @@ -1,7 +1,7 @@ import XCTest import Nimble -@testable import WordPress +@testable import WordPressData class BasePostTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/Blog+ObjcTests.m b/WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+ObjcTests.m similarity index 95% rename from WordPress/WordPressTest/Blog+ObjcTests.m rename to WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+ObjcTests.m index 950133aa6bc7..1f34cb1c9382 100644 --- a/WordPress/WordPressTest/Blog+ObjcTests.m +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+ObjcTests.m @@ -1,5 +1,6 @@ #import #import "WordPressTest-Swift.h" +@import WordPressData; @interface Blog_ObjcTests : XCTestCase @property (strong, nonatomic) id contextManager; diff --git a/WordPress/WordPressTest/Blog+PublicizeTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+PublicizeTests.swift similarity index 96% rename from WordPress/WordPressTest/Blog+PublicizeTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+PublicizeTests.swift index 287f88b52d78..89d6d998cf2b 100644 --- a/WordPress/WordPressTest/Blog+PublicizeTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+PublicizeTests.swift @@ -1,7 +1,7 @@ import Foundation import XCTest - -@testable import WordPress +@testable import WordPress // FIXME: BLog+JetpackSocial +@testable import WordPressData final class Blog_PublicizeTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/Blog+RestAPITests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+RestAPITests.swift similarity index 96% rename from WordPress/WordPressTest/Blog+RestAPITests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+RestAPITests.swift index 8a0778cbb5a1..d647571f198e 100644 --- a/WordPress/WordPressTest/Blog+RestAPITests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/Blog+RestAPITests.swift @@ -1,6 +1,7 @@ import XCTest import WordPressAPI -@testable import WordPress +@testable import WordPress // FIXME: The logic tested here is in Blog+SelfHosted +@testable import WordPressData final class Blog_RestAPITests: CoreDataTestCase { let loginDetails = WpApiApplicationPasswordDetails( diff --git a/WordPress/WordPressTest/BlogQueryTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogQueryTests.swift similarity index 97% rename from WordPress/WordPressTest/BlogQueryTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/BlogQueryTests.swift index 560059d6bbd0..088556381eeb 100644 --- a/WordPress/WordPressTest/BlogQueryTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogQueryTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import WordPress +@testable import WordPressData class BlogQueryTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/BlogSettingsDiscussionTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogSettingsDiscussionTests.swift similarity index 73% rename from WordPress/WordPressTest/BlogSettingsDiscussionTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/BlogSettingsDiscussionTests.swift index a429f598fcf8..ae9cb35f5279 100644 --- a/WordPress/WordPressTest/BlogSettingsDiscussionTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogSettingsDiscussionTests.swift @@ -1,32 +1,32 @@ import Foundation import XCTest - -@testable import WordPress +@testable import WordPress // FIXME: BlogSettings+Discussion is not in WordPressData yet +@testable import WordPressData class BlogSettingsDiscussionTests: CoreDataTestCase { func testCommentsAutoapprovalDisabledEnablesManualModerationFlag() { - let settings = newSettings() + let settings = BlogSettings.newSettings(in: mainContext) settings.commentsAutoapproval = .disabled XCTAssertTrue(settings.commentsRequireManualModeration) XCTAssertFalse(settings.commentsFromKnownUsersAllowlisted) } func testCommentsAutoapprovalFromKnownUsersEnablesAllowlistedFlag() { - let settings = newSettings() + let settings = BlogSettings.newSettings(in: mainContext) settings.commentsAutoapproval = .fromKnownUsers XCTAssertFalse(settings.commentsRequireManualModeration) XCTAssertTrue(settings.commentsFromKnownUsersAllowlisted) } func testCommentsAutoapprovalEverythingDisablesManualModerationAndAllowlistedFlags() { - let settings = newSettings() + let settings = BlogSettings.newSettings(in: mainContext) settings.commentsAutoapproval = .everything XCTAssertFalse(settings.commentsRequireManualModeration) XCTAssertFalse(settings.commentsFromKnownUsersAllowlisted) } func testCommentsSortingSetsTheCorrectCommentSortOrderIntegerValue() { - let settings = newSettings() + let settings = BlogSettings.newSettings(in: mainContext) settings.commentsSorting = .ascending XCTAssertTrue(settings.commentsSortOrder?.intValue == Sorting.ascending.rawValue) @@ -36,7 +36,7 @@ class BlogSettingsDiscussionTests: CoreDataTestCase { } func testCommentsSortOrderAscendingSetsTheCorrectCommentSortOrderIntegerValue() { - let settings = newSettings() + let settings = BlogSettings.newSettings(in: mainContext) settings.commentsSortOrderAscending = true XCTAssertTrue(settings.commentsSortOrder?.intValue == Sorting.ascending.rawValue) @@ -46,14 +46,14 @@ class BlogSettingsDiscussionTests: CoreDataTestCase { } func testCommentsThreadingDisablesSetsThreadingEnabledFalse() { - let settings = newSettings() + let settings = BlogSettings.newSettings(in: mainContext) settings.commentsThreading = .disabled XCTAssertFalse(settings.commentsThreadingEnabled) } func testCommentsThreadingEnabledSetsThreadingEnabledTrueAndTheRightDepthValue() { - let settings = newSettings() + let settings = BlogSettings.newSettings(in: mainContext) settings.commentsThreading = .enabled(depth: 10) XCTAssertTrue(settings.commentsThreadingEnabled) @@ -66,11 +66,15 @@ class BlogSettingsDiscussionTests: CoreDataTestCase { // MARK: - Typealiases typealias Sorting = BlogSettings.CommentsSorting +} + +extension BlogSettings { - // MARK: - Private Helpers - fileprivate func newSettings() -> BlogSettings { - let name = BlogSettings.classNameWithoutNamespaces() - let entity = NSEntityDescription.insertNewObject(forEntityName: name, into: mainContext) + static func newSettings(in context: NSManagedObjectContext) -> BlogSettings { + // FIXME: Restore computed name once WordPressData migration completed +// let name = BlogSettings.classNameWithoutNamespaces() + let name = "WordPressData.BlogSettings" + let entity = NSEntityDescription.insertNewObject(forEntityName: name, into: context) return entity as! BlogSettings } diff --git a/WordPress/WordPressTest/BlogTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogTests.swift similarity index 98% rename from WordPress/WordPressTest/BlogTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/BlogTests.swift index 413c0002527e..9294c327c292 100644 --- a/WordPress/WordPressTest/BlogTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogTests.swift @@ -1,6 +1,6 @@ import CoreData import XCTest -@testable import WordPress +@testable import WordPressData final class BlogTests: CoreDataTestCase { @@ -271,6 +271,27 @@ final class BlogTests: CoreDataTestCase { XCTAssertFalse(result, "Domains should not be supported when the site is P2 site") } + func testDotComIdShouldBeJetpackSiteID() throws { + let blog = BlogBuilder(mainContext, dotComID: nil) + .set(blogOption: "jetpack_client_id", value: "123") + .build() + XCTAssertEqual(blog.jetpack?.siteID?.int64Value, 123) + + try XCTAssertNil(Blog.lookup(withID: 123, in: mainContext)) + try mainContext.save() + + try XCTAssertNotNil(Blog.lookup(withID: 123, in: mainContext)) + + contextManager.performAndSave { context in + try? XCTAssertNotNil(Blog.lookup(withID: 123, in: context)) + } + } +} + +// TODO: This logic lives in the WordPress/Jetpack target still +@testable import WordPress + +extension BlogTests { // Blog URL Parsing Tests func testBlogUrlShouldBeParseableForBlogWithSimpleUrl() throws { let blog = BlogBuilder(mainContext) @@ -289,20 +310,4 @@ final class BlogTests: CoreDataTestCase { XCTAssertEqual(try blog.wordPressClientParsedUrl().url(), "http://example.com/") } - - func testDotComIdShouldBeJetpackSiteID() throws { - let blog = BlogBuilder(mainContext, dotComID: nil) - .set(blogOption: "jetpack_client_id", value: "123") - .build() - XCTAssertEqual(blog.jetpack?.siteID?.int64Value, 123) - - try XCTAssertNil(Blog.lookup(withID: 123, in: mainContext)) - try mainContext.save() - - try XCTAssertNotNil(Blog.lookup(withID: 123, in: mainContext)) - - contextManager.performAndSave { context in - try? XCTAssertNotNil(Blog.lookup(withID: 123, in: context)) - } - } } diff --git a/WordPress/WordPressTest/BlogTimeZoneTests.m b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogTimeZoneTests.m similarity index 98% rename from WordPress/WordPressTest/BlogTimeZoneTests.m rename to WordPress/WordPressTest/WordPressData-Staging-Folder/BlogTimeZoneTests.m index 78fcd38f59a9..fdbc6c16d202 100644 --- a/WordPress/WordPressTest/BlogTimeZoneTests.m +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/BlogTimeZoneTests.m @@ -1,7 +1,6 @@ #import #import "AccountService.h" -#import "Blog.h" -#import "WPAccount.h" +@import WordPressData; #import "WordPressTest-Swift.h" @interface BlogTimeZoneTests : XCTestCase diff --git a/WordPress/WordPressTest/ContextManagerTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/ContextManagerTests.swift similarity index 99% rename from WordPress/WordPressTest/ContextManagerTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/ContextManagerTests.swift index 46f9c111d4ee..6f908b04ed80 100644 --- a/WordPress/WordPressTest/ContextManagerTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/ContextManagerTests.swift @@ -3,7 +3,7 @@ import Nimble import XCTest import WordPressShared -@testable import WordPress +@testable import WordPressData class ContextManagerTests: XCTestCase { let storeURL = URL.Helpers.temporaryFile(named: "ContextManagerTests.sqlite") diff --git a/WordPress/WordPressTest/CoreDataHelperTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataHelperTests.swift similarity index 100% rename from WordPress/WordPressTest/CoreDataHelperTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataHelperTests.swift diff --git a/WordPress/WordPressTest/CoreDataMigrationTests.m b/WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataMigrationTests.m similarity index 99% rename from WordPress/WordPressTest/CoreDataMigrationTests.m rename to WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataMigrationTests.m index 1b48f87eea4f..fb5927ec197c 100644 --- a/WordPress/WordPressTest/CoreDataMigrationTests.m +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataMigrationTests.m @@ -1,8 +1,7 @@ #import #import #import -#import "Blog.h" -#import "AbstractPost.h" +@import WordPressData; @interface CoreDataMigrationTests : XCTestCase diff --git a/WordPress/WordPressTest/CoreDataTestCase.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataTestCase.swift similarity index 96% rename from WordPress/WordPressTest/CoreDataTestCase.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataTestCase.swift index 9fb8e71f8393..19cf2cda7727 100644 --- a/WordPress/WordPressTest/CoreDataTestCase.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/CoreDataTestCase.swift @@ -1,5 +1,5 @@ import XCTest -import WordPress +import WordPressData /// A `XCTestCase` subclass which manages a mock implementation of `CoreDataStack`. Inherit /// from this class to use the `CoreDataStack` mock instance in your test case. diff --git a/WordPress/WordPressTest/MediaFileManagerTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/MediaFileManagerTests.swift similarity index 99% rename from WordPress/WordPressTest/MediaFileManagerTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/MediaFileManagerTests.swift index 30fd4fe8235d..cc62faf5eea5 100644 --- a/WordPress/WordPressTest/MediaFileManagerTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/MediaFileManagerTests.swift @@ -2,6 +2,7 @@ import XCTest import OHHTTPStubs import OHHTTPStubsSwift @testable import WordPress +@testable import WordPressData class MediaFileManagerTests: XCTestCase { diff --git a/WordPress/WordPressTest/MediaImageServiceTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/MediaImageServiceTests.swift similarity index 99% rename from WordPress/WordPressTest/MediaImageServiceTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/MediaImageServiceTests.swift index 7fbe89e78ae5..e4e7aef2e1ee 100644 --- a/WordPress/WordPressTest/MediaImageServiceTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/MediaImageServiceTests.swift @@ -3,6 +3,7 @@ import OHHTTPStubs import OHHTTPStubsSwift import AsyncImageKit @testable import WordPress +@testable import WordPressData class MediaImageServiceTests: CoreDataTestCase { var mediaFileManager: MediaFileManager! diff --git a/WordPress/WordPressTest/MediaTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/MediaTests.swift similarity index 99% rename from WordPress/WordPressTest/MediaTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/MediaTests.swift index 20af2b5c5d04..3b3b225ce65c 100644 --- a/WordPress/WordPressTest/MediaTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/MediaTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import WordPress +@testable import WordPressData class MediaTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/Menus/MenuItemTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/MenuItemTests.swift similarity index 100% rename from WordPress/WordPressTest/Menus/MenuItemTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/MenuItemTests.swift diff --git a/WordPress/WordPressTest/FormattableCommentRangeTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/NotificationCommentRangeTests.swift similarity index 100% rename from WordPress/WordPressTest/FormattableCommentRangeTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/NotificationCommentRangeTests.swift diff --git a/WordPress/WordPressTest/NotificationContentRangeTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/NotificationContentRangeTests.swift similarity index 100% rename from WordPress/WordPressTest/NotificationContentRangeTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/NotificationContentRangeTests.swift diff --git a/WordPress/WordPressTest/NullBlogPropertySanitizerTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/NullBlogPropertySanitizerTests.swift similarity index 98% rename from WordPress/WordPressTest/NullBlogPropertySanitizerTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/NullBlogPropertySanitizerTests.swift index 8c742da2cd86..e4068937094e 100644 --- a/WordPress/WordPressTest/NullBlogPropertySanitizerTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/NullBlogPropertySanitizerTests.swift @@ -2,7 +2,7 @@ import WordPressShared import XCTest import Nimble -@testable import WordPress +@testable import WordPressData class NullBlogPropertySanitizerTests: CoreDataTestCase { private var keyValueDatabase: StubKeyValueDatabase! diff --git a/WordPress/WordPressTest/WordPressData-Staging-Folder/NullMockUserDefaults.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/NullMockUserDefaults.swift new file mode 100644 index 000000000000..a6576d834c94 --- /dev/null +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/NullMockUserDefaults.swift @@ -0,0 +1,12 @@ +import WordPressShared + +/// A no-op mock implementation of the KeyValueDatabase protocol +class NullMockUserDefaults: KeyValueDatabase { + func object(forKey defaultName: String) -> Any? { + return nil + } + + func set(_ value: Any?, forKey defaultName: String) {} + + func removeObject(forKey defaultName: String) {} +} diff --git a/WordPress/WordPressTest/Post+JetpackSocialTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/Post+JetpackSocialTests.swift similarity index 99% rename from WordPress/WordPressTest/Post+JetpackSocialTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/Post+JetpackSocialTests.swift index d77ad59f423f..c6079daa231f 100644 --- a/WordPress/WordPressTest/Post+JetpackSocialTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/Post+JetpackSocialTests.swift @@ -1,6 +1,6 @@ import XCTest -@testable import WordPress +@testable import WordPressData class Post_JetpackSocialTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/PostBuilder.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/PostBuilder.swift similarity index 99% rename from WordPress/WordPressTest/PostBuilder.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/PostBuilder.swift index b262fb421d24..b3718c1cd288 100644 --- a/WordPress/WordPressTest/PostBuilder.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/PostBuilder.swift @@ -1,6 +1,6 @@ import Foundation -@testable import WordPress +@testable import WordPressData /// Builds a Post /// diff --git a/WordPress/WordPressTest/PostTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/PostTests.swift similarity index 99% rename from WordPress/WordPressTest/PostTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/PostTests.swift index 5361e6dde4cd..acd44f8f41a0 100644 --- a/WordPress/WordPressTest/PostTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/PostTests.swift @@ -1,7 +1,7 @@ import Foundation import XCTest -@testable import WordPress +@testable import WordPressData class PostTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/ReaderCardTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/ReaderCardTests.swift similarity index 98% rename from WordPress/WordPressTest/ReaderCardTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/ReaderCardTests.swift index bd72fe5572df..6fea1e854c09 100644 --- a/WordPress/WordPressTest/ReaderCardTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/ReaderCardTests.swift @@ -1,7 +1,7 @@ import XCTest import Nimble -@testable import WordPress +@testable import WordPressData class ReaderCardTests: CoreDataTestCase { /// Create a Card of the type post from a RemoteReaderCard diff --git a/WordPress/WordPressTest/ReaderPostTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/ReaderPostTests.swift similarity index 92% rename from WordPress/WordPressTest/ReaderPostTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/ReaderPostTests.swift index b3b1351451db..4b93a74a27ec 100644 --- a/WordPress/WordPressTest/ReaderPostTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/ReaderPostTests.swift @@ -1,7 +1,7 @@ import UIKit import XCTest - -@testable import WordPress +@testable import WordPress // FIXME: ReaderPost+Swift +@testable import WordPressData final class ReaderPostTests: CoreDataTestCase { func testSiteIconURL() throws { diff --git a/WordPress/WordPressTest/SharedDataIssueSolverTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/SharedDataIssueSolverTests.swift similarity index 99% rename from WordPress/WordPressTest/SharedDataIssueSolverTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/SharedDataIssueSolverTests.swift index d287aadad5e3..488cd59511f3 100644 --- a/WordPress/WordPressTest/SharedDataIssueSolverTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/SharedDataIssueSolverTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import WordPress +@testable import WordPressData @testable import WordPressShared class SharedDataIssueSolverTests: XCTestCase { diff --git a/WordPress/WordPressTest/TaggedManagedObjectIDTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/TaggedManagedObjectIDTests.swift similarity index 99% rename from WordPress/WordPressTest/TaggedManagedObjectIDTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/TaggedManagedObjectIDTests.swift index 7d2167c96581..e431abd59b81 100644 --- a/WordPress/WordPressTest/TaggedManagedObjectIDTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/TaggedManagedObjectIDTests.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressData import XCTest @testable import WordPress diff --git a/WordPress/WordPressTest/UserSettingsTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/UserSettingsTests.swift similarity index 98% rename from WordPress/WordPressTest/UserSettingsTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/UserSettingsTests.swift index 7c0260b8c401..f8b3f37a4d85 100644 --- a/WordPress/WordPressTest/UserSettingsTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/UserSettingsTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import WordPress +@testable import WordPressData class UserSettingsTests: XCTestCase { diff --git a/WordPress/WordPressTest/UserSettingsTestsObjc.m b/WordPress/WordPressTest/WordPressData-Staging-Folder/UserSettingsTestsObjc.m similarity index 93% rename from WordPress/WordPressTest/UserSettingsTestsObjc.m rename to WordPress/WordPressTest/WordPressData-Staging-Folder/UserSettingsTestsObjc.m index 4bffd0bc5867..5db12c874373 100644 --- a/WordPress/WordPressTest/UserSettingsTestsObjc.m +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/UserSettingsTestsObjc.m @@ -1,4 +1,5 @@ #import +@import WordPressData; // FIXME: Easy port to Swift @interface UserSettingsTestsObjc : XCTestCase diff --git a/WordPress/WordPressTest/WPAccount+Fixture.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+Fixture.swift similarity index 97% rename from WordPress/WordPressTest/WPAccount+Fixture.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+Fixture.swift index c56b8c08df0e..b3bb6d0a882e 100644 --- a/WordPress/WordPressTest/WPAccount+Fixture.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+Fixture.swift @@ -1,3 +1,5 @@ +import WordPressData + /// Centralized utility to generate preconfigured WPAccount instances extension WPAccount { diff --git a/WordPress/WordPressTest/WPAccount+LookupTests.swift b/WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+LookupTests.swift similarity index 99% rename from WordPress/WordPressTest/WPAccount+LookupTests.swift rename to WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+LookupTests.swift index 8578a6a5f9e8..13ac107898eb 100644 --- a/WordPress/WordPressTest/WPAccount+LookupTests.swift +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+LookupTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import WordPress +@testable import WordPressData class WPAccountLookupTests: CoreDataTestCase { diff --git a/WordPress/WordPressTest/WPAccount+ObjCLookupTests.m b/WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+ObjCLookupTests.m similarity index 99% rename from WordPress/WordPressTest/WPAccount+ObjCLookupTests.m rename to WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+ObjCLookupTests.m index b0bf828b6066..082a3a60412f 100644 --- a/WordPress/WordPressTest/WPAccount+ObjCLookupTests.m +++ b/WordPress/WordPressTest/WordPressData-Staging-Folder/WPAccount+ObjCLookupTests.m @@ -1,5 +1,6 @@ #import #import "WordPressTest-Swift.h" +@import WordPressData; @interface WPAccount_ObjCLookupTests : XCTestCase diff --git a/WordPress/WordPressTest/WordPressUnitTests.xctestplan b/WordPress/WordPressTest/WordPressUnitTests.xctestplan index 5fbff54d114f..0e2ac92b0191 100644 --- a/WordPress/WordPressTest/WordPressUnitTests.xctestplan +++ b/WordPress/WordPressTest/WordPressUnitTests.xctestplan @@ -34,43 +34,43 @@ { "target" : { "containerPath" : "container:..\/Modules", - "identifier" : "AsyncImageKitTests", - "name" : "AsyncImageKitTests" + "identifier" : "WordPressSharedObjCTests", + "name" : "WordPressSharedObjCTests" } }, { "target" : { - "containerPath" : "container:WordPress.xcodeproj", - "identifier" : "4AD953BA2C21451700D0EEFA", - "name" : "WordPressAuthenticatorTests" + "containerPath" : "container:..\/Modules", + "identifier" : "WordPressSharedTests", + "name" : "WordPressSharedTests" } }, { "target" : { "containerPath" : "container:WordPress.xcodeproj", - "identifier" : "E16AB92914D978240047A2E5", - "name" : "WordPressTest" + "identifier" : "4AD953BA2C21451700D0EEFA", + "name" : "WordPressAuthenticatorTests" } }, { "target" : { "containerPath" : "container:..\/Modules", - "identifier" : "WordPressCoreTests", - "name" : "WordPressCoreTests" + "identifier" : "WordPressFluxTests", + "name" : "WordPressFluxTests" } }, { "target" : { "containerPath" : "container:..\/Modules", - "identifier" : "WordPressUIUnitTests", - "name" : "WordPressUIUnitTests" + "identifier" : "AsyncImageKitTests", + "name" : "AsyncImageKitTests" } }, { "target" : { - "containerPath" : "container:..\/Modules", - "identifier" : "WordPressSharedTests", - "name" : "WordPressSharedTests" + "containerPath" : "container:WordPress.xcodeproj", + "identifier" : "3F2AA3E92D81457F002A4E94", + "name" : "WordPressDataTests" } }, { @@ -80,18 +80,25 @@ "name" : "JetpackStatsWidgetsCoreTests" } }, + { + "target" : { + "containerPath" : "container:WordPress.xcodeproj", + "identifier" : "E16AB92914D978240047A2E5", + "name" : "WordPressTest" + } + }, { "target" : { "containerPath" : "container:..\/Modules", - "identifier" : "WordPressFluxTests", - "name" : "WordPressFluxTests" + "identifier" : "WordPressUIUnitTests", + "name" : "WordPressUIUnitTests" } }, { "target" : { "containerPath" : "container:..\/Modules", - "identifier" : "WordPressSharedObjCTests", - "name" : "WordPressSharedObjCTests" + "identifier" : "WordPressCoreTests", + "name" : "WordPressCoreTests" } } ],