Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPressKit as a binary framework #23418

Merged
merged 5 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 11 additions & 17 deletions Modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let package = Package(
.package(url: "https://github.com/wordpress-mobile/MediaEditor-iOS", branch: "task/spm-support"),
.package(url: "https://github.com/wordpress-mobile/NSObject-SafeExpectations", from: "0.0.6"),
.package(url: "https://github.com/wordpress-mobile/NSURL-IDN", branch: "trunk"),
.package(url: "https://github.com/wordpress-mobile/wpxmlrpc", from: "0.10.0"),
.package(url: "https://github.com/wordpress-mobile/WordPressKit-iOS", branch: "wpios-edition"),
.package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"),
],
targets: XcodeSupport.targets + [
Expand Down Expand Up @@ -86,8 +86,6 @@ enum XcodeSupport {
static let products: [Product] = [
.library(name: "XcodeTarget_App", targets: ["XcodeTarget_App"]),
.library(name: "XcodeTarget_WordPressTests", targets: ["XcodeTarget_WordPressTests"]),
.library(name: "XcodeTarget_WordPressKit", targets: ["XcodeTarget_WordPressKit"]),
.library(name: "XcodeTarget_WordPressKitTests", targets: ["XcodeTarget_WordPressKitTests"]),
.library(name: "XcodeTarget_WordPressAuthentificator", targets: ["XcodeTarget_WordPressAuthentificator"]),
.library(name: "XcodeTarget_WordPressAuthentificatorTests", targets: ["XcodeTarget_WordPressAuthentificatorTests"]),
.library(name: "XcodeTarget_ShareExtension", targets: ["XcodeTarget_ShareExtension"]),
Expand All @@ -99,18 +97,14 @@ enum XcodeSupport {
]

static let targets: [Target] = {
let wordPressKitDependencies: [Target.Dependency] = [
"WordPressShared",
.product(name: "NSObject-SafeExpectations", package: "NSObject-SafeExpectations"),
.product(name: "wpxmlrpc", package: "wpxmlrpc"),
]

let wordPresAuthentificatorDependencies: [Target.Dependency] = [
"WordPressShared",
"WordPressUI",
.product(name: "NSURL+IDN", package: "NSURL-IDN"),
.product(name: "Gridicons", package: "Gridicons-iOS"),
.product(name: "NSURL+IDN", package: "NSURL-IDN"),
.product(name: "SVProgressHUD", package: "SVProgressHUD"),
] + wordPressKitDependencies
.product(name: "WordPressKit", package: "WordPressKit-iOS"),
]

let shareAndDraftExtensionsDependencies: [Target.Dependency] = [
"WordPressShared",
Expand Down Expand Up @@ -157,7 +151,7 @@ enum XcodeSupport {
.product(name: "SVProgressHUD", package: "SVProgressHUD"),
.product(name: "SwiftSoup", package: "SwiftSoup"),
.product(name: "UIDeviceIdentifier", package: "UIDeviceIdentifier"),
.product(name: "wpxmlrpc", package: "wpxmlrpc"),
.product(name: "WordPressKit", package: "WordPressKit-iOS"),
.product(name: "ZendeskSupportSDK", package: "support_sdk_ios"),
.product(name: "ZIPFoundation", package: "ZIPFoundation"),
]),
Expand All @@ -166,17 +160,17 @@ enum XcodeSupport {
.product(name: "Nimble", package: "Nimble"),
.product(name: "BuildkiteTestCollector", package: "test-collector-swift"),
]),
.xcodeTarget("XcodeTarget_WordPressKit", dependencies: wordPressKitDependencies),
.xcodeTarget("XcodeTarget_WordPressKitTests", dependencies: wordPressKitDependencies + testDependencies),
.xcodeTarget("XcodeTarget_WordPressAuthentificator", dependencies: wordPresAuthentificatorDependencies),
.xcodeTarget("XcodeTarget_WordPressAuthentificatorTests", dependencies: wordPresAuthentificatorDependencies + testDependencies),
.xcodeTarget("XcodeTarget_ShareExtension", dependencies: shareAndDraftExtensionsDependencies),
.xcodeTarget("XcodeTarget_DraftActionExtension", dependencies: shareAndDraftExtensionsDependencies),
.xcodeTarget("XcodeTarget_NotificationServiceExtension", dependencies: wordPressKitDependencies + [
"WordPressUI"
.xcodeTarget("XcodeTarget_NotificationServiceExtension", dependencies: [
"WordPressUI",
"WordPressShared",
]),
.xcodeTarget("XcodeTarget_StatsWidget", dependencies: wordPressKitDependencies + [
.xcodeTarget("XcodeTarget_StatsWidget", dependencies: [
"JetpackStatsWidgetsCore",
"WordPressShared",
.product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"),
]),
.xcodeTarget("XcodeTarget_Intents", dependencies: [
Expand Down
8 changes: 4 additions & 4 deletions WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,12 @@
}
},
{
"identity" : "wpxmlrpc",
"identity" : "wordpresskit-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/wordpress-mobile/wpxmlrpc",
"location" : "https://github.com/wordpress-mobile/WordPressKit-iOS",
"state" : {
"revision" : "bfc413d336bdeaab89e62dc483380baa99b2257e",
"version" : "0.10.0"
"branch" : "wpios-edition",
"revision" : "0583ccc9f1f6b748bab6a9242bbf585351d18caa"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion WordPress/Classes/Models/BasePost.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "BasePost.h"
#import "Media.h"
#import "NSMutableDictionary+Helpers.h"
#import "CoreDataStack.h"

@import WordPressShared;

@implementation BasePost
Expand Down
1 change: 0 additions & 1 deletion WordPress/Classes/Services/MediaService.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#import "Blog.h"
#import <MobileCoreServices/MobileCoreServices.h>
#import "WordPress-Swift.h"
#import "WPXMLRPCDecoder.h"

@import WordPressKit;
@import WordPressUI;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import CocoaLumberjack
import AutomatticTracks
import WordPressShared
import WordPressKit

class WordPressLibraryLogger: NSObject, TracksLoggingDelegate, WordPressLoggingDelegate {
class WordPressLibraryLogger: NSObject, TracksLoggingDelegate, WordPressLoggingDelegate, WordPressKitLoggingDelegate {

func logError(_ str: String) {
DDLogError(str)
Expand Down
1 change: 1 addition & 0 deletions WordPress/Classes/Utility/PushNotificationsManager.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Foundation
import WordPressShared
import NSObject_SafeExpectations
import UserNotifications
import CocoaLumberjack

Expand Down
4 changes: 2 additions & 2 deletions WordPress/Classes/Utility/WPError.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#import "WordPress-Swift.h"

@import WordPressShared;
@import wpxmlrpc;
@import WordPressKit;

NSInteger const SupportButtonIndex = 0;

Expand Down Expand Up @@ -48,7 +48,7 @@ + (void)showXMLRPCErrorAlert:(NSError *)error
{
NSString *cleanedErrorMsg = [error localizedDescription];

if ([error.domain isEqualToString:WPXMLRPCFaultErrorDomain] && error.code == 401) {
if ([error.domain isEqualToString:WordPressOrgXMLRPCApi.errorDomain] && error.code == 401) {
cleanedErrorMsg = NSLocalizedString(@"Sorry, you cannot access this feature. Please check your User Role on this site.", @"");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

@import WordPressKit;
@import WordPressShared;
@import wpxmlrpc;
@import NSURL_IDN;

NS_ENUM(NSInteger, SiteSettingsAccount) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import CoreData
import Gridicons
import CocoaLumberjack
import WordPressShared
import wpxmlrpc
import WordPressFlux
import WordPressUI
import WordPressKit
import Combine

class AbstractPostListViewController: UIViewController,
Expand Down Expand Up @@ -618,8 +618,8 @@ class AbstractPostListViewController: UIViewController,
}

@objc func handleSyncFailure(_ error: NSError) {
if error.domain == WPXMLRPCFaultErrorDomain
&& error.code == type(of: self).httpErrorCodeForbidden {
if error.domain == WordPressOrgXMLRPCApi.errorDomain &&
error.code == type(of: self).httpErrorCodeForbidden {
WordPressAppDelegate.shared?.showPasswordInvalidPrompt(for: blog)
return
}
Expand Down
Loading
Loading