Skip to content

Commit f528bb0

Browse files
Merge wp_com and jetpack crates into wp_api (#718)
* Merge `wp_com` & `jetpack` crates into `wp_api` * Rename `JetpackConnectionClientError::UserConnectionFailed` field * Fix packaging issues in the Swift wrapper * Fix file not found error in rm command --------- Co-authored-by: Tony Li <[email protected]>
1 parent 1f392c7 commit f528bb0

25 files changed

+59
-172
lines changed

.buildkite/download-xcframework.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ echo "--- :arrow_down: Downloading xcframework"
66
buildkite-agent artifact download target/libwordpressFFI.xcframework.zip . --step "xcframework"
77
buildkite-agent artifact download native/swift/Sources/wordpress-api-wrapper/wp_api.swift . --step "xcframework"
88
buildkite-agent artifact download native/swift/Sources/wordpress-api-wrapper/wp_localization.swift . --step "xcframework"
9-
buildkite-agent artifact download native/swift/Sources/wordpress-api-wrapper/wp_com.swift . --step "xcframework"
10-
buildkite-agent artifact download native/swift/Sources/wordpress-api-wrapper/jetpack.swift . --step "xcframework"
119
unzip target/libwordpressFFI.xcframework.zip -d .
1210
rm target/libwordpressFFI.xcframework.zip

Cargo.lock

Lines changed: 0 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
[workspace]
22
members = [
3-
"jetpack",
43
"wp_api",
54
"wp_api_integration_tests",
65
"wp_api_integration_tests_backend",
76
"wp_cli",
8-
"wp_com",
97
"wp_contextual",
108
"wp_derive",
119
"wp_derive_request_builder",

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ _build-apple-%-tvos _build-apple-%-tvos-sim _build-apple-%-watchos _build-apple-
102102

103103
# Build the library for a specific target
104104
_build-apple-%:
105-
cargo $(CARGO_OPTS) $(cargo_config_library) build --target $* --package jetpack --profile $(CARGO_PROFILE)
106-
./scripts/swift-bindings.sh target/$*/$(CARGO_PROFILE_DIRNAME)/libjetpack.a
105+
cargo $(CARGO_OPTS) $(cargo_config_library) build --target $* --package wp_api --profile $(CARGO_PROFILE)
106+
./scripts/swift-bindings.sh target/$*/$(CARGO_PROFILE_DIRNAME)/libwp_api.a
107107

108108
# Build the library for one single platform, including real device and simulator.
109109
build-apple-platform-macos := $(addprefix _build-apple-,$(apple-platform-targets-macos))
@@ -145,11 +145,11 @@ docker-image-web:
145145
docker build -t wordpress-rs-web -f wp_rs_web/Dockerfile . --progress=plain
146146

147147
swift-linux-library:
148-
cargo build --release --package jetpack
149-
./scripts/swift-bindings.sh target/release/libjetpack.a
148+
cargo build --release --package wp_api
149+
./scripts/swift-bindings.sh target/release/libwp_api.a
150150
mkdir -p target/release/libwordpressFFI-linux
151151
cp target/release/swift-bindings/Headers/* target/release/libwordpressFFI-linux/
152-
cp target/release/libjetpack.a target/release/libwordpressFFI-linux/
152+
cp target/release/libwp_api.a target/release/libwordpressFFI-linux/
153153

154154
swift-example-app: swift-example-app-mac swift-example-app-ios
155155

@@ -166,7 +166,7 @@ test-swift-linux: docker-image-swift
166166
docker run $(docker_opts_shared) -it wordpress-rs-swift make test-swift-linux-in-docker
167167

168168
test-swift-linux-in-docker: swift-linux-library
169-
swift test -Xlinker -Ltarget/release/libwordpressFFI-linux -Xlinker -ljetpack
169+
swift test -Xlinker -Ltarget/release/libwordpressFFI-linux -Xlinker -lwp_api
170170

171171
test-swift-darwin: xcframework
172172
swift test

fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ end
119119

120120
def xcframework_bindings_file_path
121121
dir = File.join(PROJECT_ROOT, 'native', 'swift', 'Sources', 'wordpress-api-wrapper')
122-
%w[wp_api.swift wp_localization.swift wp_com.swift jetpack.swift]
122+
%w[wp_api.swift wp_localization.swift]
123123
.map { |file| File.join(dir, file) }
124124
end
125125

jetpack/Cargo.toml

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

jetpack/src/endpoint/connection_endpoint.rs

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

jetpack/uniffi.toml

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

jetpack/wp_derived_request.toml

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

scripts/swift-bindings.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ for swift_binding in "$output_dir"/*.swift; do
4646
fi
4747
done
4848

49+
rm -f native/swift/Sources/wordpress-api-wrapper/*.swift
4950
mv "$output_dir"/*.swift native/swift/Sources/wordpress-api-wrapper/
5051

5152
header_dir="$output_dir/Headers"

0 commit comments

Comments
 (0)