Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 8be531d

Browse files
authored
Package WordPressKit as XCFramework for WordPress iOS consumption (#816)
2 parents 40a984d + d2eb3e9 commit 8be531d

File tree

155 files changed

+3219
-760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+3219
-760
lines changed

.buildkite/create-xcframeworks.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ROOT="./.build/xcframeworks"
2+
3+
rm -rf $ROOT
4+
5+
for SDK in iphoneos iphonesimulator
6+
do
7+
xcodebuild archive \
8+
-workspace WordPressKit.xcworkspace \
9+
-scheme WordPressKit \
10+
-archivePath "$ROOT/WordPressKit-$SDK.xcarchive" \
11+
-sdk $SDK \
12+
SKIP_INSTALL=NO \
13+
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
14+
DEBUG_INFORMATION_FORMAT=DWARF
15+
done
16+
17+
xcodebuild -create-xcframework \
18+
-framework "$ROOT/WordPressKit-iphoneos.xcarchive/Products/Library/Frameworks/WordPressKit.framework" \
19+
-framework "$ROOT/WordPressKit-iphonesimulator.xcarchive/Products/Library/Frameworks/WordPressKit.framework" \
20+
-output "$ROOT/WordPressKit.xcframework"
21+
22+
cd $ROOT
23+
zip -r -X WordPressKit.zip *.xcframework
24+
rm -rf *.xcframework
25+
26+
swift package compute-checksum WordPressKit.zip
27+
cd -

.buildkite/pipeline.yml

Lines changed: 10 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
2+
---
3+
4+
agents:
5+
queue: mac
6+
7+
env:
8+
IMAGE_ID: xcode-15.3-v3
9+
110
# Nodes with values to reuse in the pipeline.
211
common_params:
312
plugins: &common_plugins
4-
- automattic/a8c-ci-toolkit#3.1.0
5-
# Common environment values to use with the `env` key.
6-
env: &common_env
7-
# -v3 contains a workaround for a Simulator boot issue
8-
# See paaHJt-6gL-p2#comment-8712
9-
IMAGE_ID: xcode-15.3-v3
13+
- automattic/a8c-ci-toolkit#3.5.1
1014

1115
# This is the default pipeline – it will build and test the app
1216
steps:
@@ -21,17 +25,6 @@ steps:
2125
- fastlane/test_output/report.html
2226
- fastlane/test_output/report.junit
2327
- .build/derived-data/Logs/**/*.xcactivitylog
24-
env: *common_env
25-
plugins: *common_plugins
26-
27-
#################
28-
# Validate Podspec
29-
#################
30-
- label: "🔬 Validate Podspec"
31-
key: "validate"
32-
command: |
33-
validate_podspec --patch-cocoapods
34-
env: *common_env
3528
plugins: *common_plugins
3629

3730
#################
@@ -46,26 +39,3 @@ steps:
4639
context: SwiftLint
4740
agents:
4841
queue: linter
49-
50-
- label: "🧹 Lint"
51-
key: "lint"
52-
command: |
53-
lint_pod
54-
env: *common_env
55-
plugins: *common_plugins
56-
57-
#################
58-
# Publish the Podspec (if we're building a tag)
59-
#################
60-
- label: "⬆️ Publish Podspec"
61-
key: "publish"
62-
command: .buildkite/publish-pod.sh
63-
env: *common_env
64-
plugins: *common_plugins
65-
depends_on:
66-
- "test"
67-
- "validate"
68-
- "lint"
69-
if: build.tag != null
70-
agents:
71-
queue: "mac"

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ playground.xcworkspace
4343
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
4444
# Packages/
4545
# Package.pins
46-
# Package.resolved
46+
4747
# *.xcodeproj
4848
#
4949
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
5050
# hence it is not needed unless you have added a package configuration file to your project
51-
# .swiftpm
52-
51+
.swiftpm
52+
Package.resolved
5353
.build/
5454

5555
# CocoaPods

Package.resolved

Lines changed: 0 additions & 122 deletions
This file was deleted.

Package.swift

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,18 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 5.10
22

33
import PackageDescription
44

55
let package = Package(
66
name: "WordPressKit",
7-
platforms: [.iOS(.v13)],
7+
platforms: [.iOS(.v15)],
88
products: [
9-
.library(name: "APIInterface", targets: ["APIInterface"]),
10-
.library(name: "CoreAPI", targets: ["CoreAPI"]),
11-
],
12-
dependencies: [
13-
// .package(url: "https://github.com/wordpress-mobile/WordPress-iOS-Shared.git", from: "2.3.1"),
14-
// See https://github.com/wordpress-mobile/WordPress-iOS-Shared/pull/354
15-
.package(url: "https://github.com/wordpress-mobile/WordPress-iOS-Shared.git", branch: "mokagio/swiftlint-read-as-dependency"),
16-
.package(url: "https://github.com/wordpress-mobile/wpxmlrpc", from: "0.10.0"),
17-
// Test dependencies
18-
.package(url: "https://github.com/AliSoftware/OHHTTPStubs", from: "9.1.0"),
19-
.package(url: "https://github.com/Alamofire/Alamofire", from: "5.8.1"),
9+
.library(name: "WordPressKit", targets: ["WordPressKit"]),
2010
],
2111
targets: [
22-
.target(name: "APIInterface"),
23-
.target(
24-
name: "CoreAPI",
25-
dependencies: [
26-
.target(name: "APIInterface"),
27-
.product(
28-
name: "WordPressShared",
29-
package: "WordPress-iOS-Shared",
30-
// Constrain to iOS only to avoid having to explicitly set a macOS version because of this library's requirements.
31-
condition: .when(platforms: [.iOS])
32-
),
33-
"wpxmlrpc"
34-
]
35-
),
36-
.testTarget(
37-
name: "CoreAPITests",
38-
dependencies: [
39-
.target(name: "CoreAPI"),
40-
.product(name: "OHHTTPStubs", package: "OHHTTPStubs"),
41-
.product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs"),
42-
"Alamofire",
43-
],
44-
path: "Tests/CoreAPITests",
45-
resources: [
46-
.process("Stubs") // Relative to path
47-
]
12+
.binaryTarget(
13+
name: "WordPressKit",
14+
url: "https://github.com/user-attachments/files/20825728/WordPressKit.zip",
15+
checksum: "097a2e55e4ec66b4d8c37bc49181df33c4b62ea9d130fac4de057a0867b68a69"
4816
),
4917
]
5018
)

Podfile

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,14 @@ use_frameworks!
88
APP_IOS_DEPLOYMENT_TARGET = Gem::Version.new('13.0')
99

1010
platform :ios, APP_IOS_DEPLOYMENT_TARGET
11+
workspace './WordPressKit.xcworkspace'
1112

1213
def swiftlint_version
1314
require 'yaml'
1415

1516
YAML.load_file('.swiftlint.yml')['swiftlint_version']
1617
end
1718

18-
def wordpresskit_pods
19-
pod 'WordPressShared', '~> 2.0.0-beta.2'
20-
pod 'NSObject-SafeExpectations', '~> 0.0.4'
21-
pod 'wpxmlrpc', '~> 0.10.0'
22-
pod 'UIDeviceIdentifier', '~> 2.0'
23-
end
24-
25-
## WordPress Kit
26-
## =============
27-
##
28-
target 'WordPressKit' do
29-
project 'WordPressKit.xcodeproj'
30-
wordpresskit_pods
31-
end
32-
33-
target 'WordPressKitTests' do
34-
project 'WordPressKit.xcodeproj'
35-
wordpresskit_pods
36-
37-
pod 'OHHTTPStubs', '~> 9.0'
38-
pod 'OHHTTPStubs/Swift', '~> 9.0'
39-
pod 'OCMock', '~> 3.4'
40-
pod 'Alamofire', '~> 5.0'
41-
end
42-
4319
abstract_target 'Tools' do
4420
pod 'SwiftLint', swiftlint_version
4521
end

Podfile.lock

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,16 @@
11
PODS:
2-
- Alamofire (5.8.1)
3-
- NSObject-SafeExpectations (0.0.6)
4-
- OCMock (3.9.3)
5-
- OHHTTPStubs (9.1.0):
6-
- OHHTTPStubs/Default (= 9.1.0)
7-
- OHHTTPStubs/Core (9.1.0)
8-
- OHHTTPStubs/Default (9.1.0):
9-
- OHHTTPStubs/Core
10-
- OHHTTPStubs/JSON
11-
- OHHTTPStubs/NSURLSession
12-
- OHHTTPStubs/OHPathHelpers
13-
- OHHTTPStubs/JSON (9.1.0):
14-
- OHHTTPStubs/Core
15-
- OHHTTPStubs/NSURLSession (9.1.0):
16-
- OHHTTPStubs/Core
17-
- OHHTTPStubs/OHPathHelpers (9.1.0)
18-
- OHHTTPStubs/Swift (9.1.0):
19-
- OHHTTPStubs/Default
202
- SwiftLint (0.54.0)
21-
- UIDeviceIdentifier (2.3.0)
22-
- WordPressShared (2.0.1)
23-
- wpxmlrpc (0.10.0)
243

254
DEPENDENCIES:
26-
- Alamofire (~> 5.0)
27-
- NSObject-SafeExpectations (~> 0.0.4)
28-
- OCMock (~> 3.4)
29-
- OHHTTPStubs (~> 9.0)
30-
- OHHTTPStubs/Swift (~> 9.0)
315
- SwiftLint (= 0.54.0)
32-
- UIDeviceIdentifier (~> 2.0)
33-
- WordPressShared (~> 2.0.0-beta.2)
34-
- wpxmlrpc (~> 0.10.0)
356

367
SPEC REPOS:
378
trunk:
38-
- Alamofire
39-
- NSObject-SafeExpectations
40-
- OCMock
41-
- OHHTTPStubs
429
- SwiftLint
43-
- UIDeviceIdentifier
44-
- WordPressShared
45-
- wpxmlrpc
4610

4711
SPEC CHECKSUMS:
48-
Alamofire: 3ca42e259043ee0dc5c0cdd76c4bc568b8e42af7
49-
NSObject-SafeExpectations: c01c8881cbd97efad6f668286b913cd0b7d62ab5
50-
OCMock: 300b1b1b9155cb6378660b981c2557448830bdc6
51-
OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831
5212
SwiftLint: c1de071d9d08c8aba837545f6254315bc900e211
53-
UIDeviceIdentifier: 442b65b4ff1832d4ca9c2a157815cb29ad981b17
54-
WordPressShared: f93f99269258b46dad04f4e4dbf540ce2e5c1e66
55-
wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd
5613

57-
PODFILE CHECKSUM: 64af6d71574c7a92d01a9446aa874e066917ebe5
14+
PODFILE CHECKSUM: c0da9313733b88a1d938ba6a329dd46b895c7dea
5815

5916
COCOAPODS: 1.15.2

0 commit comments

Comments
 (0)