Skip to content

Commit

Permalink
Remove CocoaPods (#23958)
Browse files Browse the repository at this point in the history
* Run `pod deintegrate` and remove CocoaPods automation

* Add `Makefile` automation to download Gutenberg framework

* Remove dead reference to `Pods.framework` in project

* Remove dead reference to pods from workspace

* Remove SwiftLint-via-CocoaPods from `Rakefile`

* Remove unnecessary `$(inherited)` flag from a couple of targets

That's for the value `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER`,
but it's useless to set `$(inherited)` for a Yes or No value because
removing the value from the target will automatically make Xcode read it
from the project, achieving the same result.

* Remove CocoaPods instruction from the README

* Remove SwiftLint instructions from the `README`

* Add a version of Aztec fetched via SwiftPM

* Add Gutenberg XCFrameworks via drag-n-drop from local paths

* Disable `CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER`

Was giving errors in Yoga:

> Double-quoted include "YGEnums.h" in framework header, expected angle-bracketed instead

* Disable `CLANG_WARN_STRICT_PROTOTYPES`

It resulted in a build failure:

> React.framework/Headers/RCTAppearance.h:16:60:
> A function declaration without a prototype is deprecated in all versions of C

* Update search path for Gutenberg React Native bundle in script

* Remove some leftover bits of CocoaPods set up for automation

* Remove leftover `COCOAPODS` precompiler flag

Strange that `pod deintegrate` did not remove it. Maybe it was some
custom piece of setup...

* Remove a couple of CocoaPods-specific code branches

* Temporarily switch to CI toolkit branch compatible with no CocoaPods

* Fetch XCFrameworks in CI

* Update Gutenberg checkout logic in localization lint for CP-less setup

* Update source map upload for CP-less Gutenberg setup

* Ensure `Frameworks` folder exist, otherwise tar will fail

* Remove "Log Outdated Pods" step from code freeze

We don't have pods anymore

* Remove Pods from lists in `.gitignore` and RuboCop

We don't use Pods anymore

* Remove imports of Pods xcconfigs

* No longer look in Pods folder to extract localizations

* Link Gutenberg XCFramework in Jetpack target too!

* Add instruction in README to run `make dependencies`

* Use CI toolkit 3.8.0

* Point Aztec to branch in wordpress-mobile org from SPM support PR

See wordpress-mobile/AztecEditor-iOS#1379

* Point Aztec to latest SwiftPM-support commit

* Point to latest Aztec, 1.20.0

* Reimplement logic to download XCFrameworks from `make` to `rake`

* Remove a debug `set +x`

* Rewrite `gutenberg_xcframeworks` using Ruby APIs

More idiomatic and safer than shelling out. See
#23958 (comment)

* Also delete `tar.gz` when cleaning up after setting up Gutenberg

* Ignore `Pods/` for retro-compatibility
  • Loading branch information
mokagio authored Feb 11, 2025
1 parent f97da7d commit bb6c179
Show file tree
Hide file tree
Showing 44 changed files with 179 additions and 1,224 deletions.
9 changes: 1 addition & 8 deletions .buildkite/commands/build-for-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ echo "--- :beer: Installing Homebrew Dependencies"
brew tap FelixHerrmann/tap
brew install swift-package-list

echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :cocoapods: Setting up Pods"
install_cocoapods
"$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh"

echo "--- :writing_hand: Copy Files"
mkdir -pv ~/.configure/wordpress-ios/secrets
Expand All @@ -24,9 +20,6 @@ cp -v fastlane/env/project.env-example ~/.configure/wordpress-ios/secrets/projec
echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- :hammer_and_wrench: Building"
bundle exec fastlane build_${APP}_for_testing

Expand Down
25 changes: 0 additions & 25 deletions .buildkite/commands/log-outdated-pods.sh

This file was deleted.

9 changes: 1 addition & 8 deletions .buildkite/commands/prototype-build-jetpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ brew upgrade sentry-cli
brew tap FelixHerrmann/tap
brew install swift-package-list

echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :cocoapods: Setting up Pods"
install_cocoapods
"$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh"

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- :hammer_and_wrench: Building"
bundle exec fastlane build_and_upload_jetpack_prototype_build
10 changes: 1 addition & 9 deletions .buildkite/commands/prototype-build-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@ brew upgrade sentry-cli
brew tap FelixHerrmann/tap
brew install swift-package-list


echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :cocoapods: Setting up Pods"
install_cocoapods
"$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh"

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- :hammer_and_wrench: Building"
bundle exec fastlane build_and_upload_wordpress_prototype_build
9 changes: 1 addition & 8 deletions .buildkite/commands/release-build-jetpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ brew install swift-package-list
brew install imagemagick
brew install ghostscript

echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :cocoapods: Setting up Pods"
install_cocoapods

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies
"$(dirname "${BASH_SOURCE[0]}")/shared-set-up.sh"

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply
Expand Down
3 changes: 0 additions & 3 deletions .buildkite/commands/release-build-wordpress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ brew install ghostscript
echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :cocoapods: Setting up Pods"
install_cocoapods

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

Expand Down
49 changes: 0 additions & 49 deletions .buildkite/commands/run-pod-tests.sh

This file was deleted.

4 changes: 1 addition & 3 deletions .buildkite/commands/run-ui-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ echo "--- 📦 Downloading Build Artifacts"
download_artifact build-products-jetpack.tar
tar -xf build-products-jetpack.tar

# Only the gems are needed here, given we run the tests on a pre-built binary
echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- 🔬 Testing"
xcrun simctl list >> /dev/null
rake mocks &
Expand Down
4 changes: 1 addition & 3 deletions .buildkite/commands/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ echo "--- 📦 Downloading Build Artifacts"
download_artifact build-products-wordpress.tar
tar -xf build-products-wordpress.tar

# Only the gems are needed here, given we run the tests on a pre-built binary
echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- 🔬 Testing"
set +e
bundle exec fastlane test_without_building name:WordPressUnitTests
Expand Down
10 changes: 10 additions & 0 deletions .buildkite/commands/shared-set-up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -eu

echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- :xcode: Fetch XCFrameworks"
rake dependencies
9 changes: 0 additions & 9 deletions .buildkite/release-pipelines/complete-code-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,3 @@ steps:
manual:
# If those jobs fail, one should always prefer re-triggering a new build from ReleaseV2 rather than retrying the individual job from Buildkite
allowed: false

- label: Log Outdated Pods
depends_on: complete_code_freeze
plugins: [$CI_TOOLKIT_PLUGIN]
command: .buildkite/commands/log-outdated-pods.sh "$RELEASE_VERSION"
retry:
manual:
# If those jobs fail, one should always prefer re-triggering a new build from ReleaseV2 rather than retrying the individual job from Buildkite
allowed: false
2 changes: 1 addition & 1 deletion .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# The ~> modifier is not currently used, but we check for it just in case
XCODE_VERSION=$(sed -E 's/^~> ?//' .xcode-version)
CI_TOOLKIT_PLUGIN_VERSION="3.9.1"
CI_TOOLKIT_PLUGIN_VERSION="3.8.0"

export IMAGE_ID="xcode-$XCODE_VERSION-macos-14.7.1-v1"
export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION"
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ $RECYCLE.BIN/

# Project
/Entitlements.plist
Pods/
WordPress.xcworkspace/*.mode1v3
WordPress.xcworkspace/*.mode2v3
WordPress.xcworkspace/*.pbxuser
Expand Down Expand Up @@ -112,6 +111,14 @@ WordPress/InfoPlist.h
WordPress/InfoPlist-alpha.h
WordPress/InfoPlist-internal.h


# SwiftLint Remote Config Cache
.swiftlint/RemoteConfigCache

# The project used CocoaPods for dependency management prior to early 2025.
#
# To simplify switching branches on dev machines that have older copies, let's
# ignore the possible leftover Pods folder from that setup.
#
# Up to the discretion of the dev team when in the future to remove this rule
# and assume no local copy would have generated the Pods.
Pods/
7 changes: 0 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
AllCops:
Exclude:
- DerivedData/**/*
- Pods/**/*
- vendor/**/*
- WordPressAuthenticator/**/*
- WordPressKit/**/*
Expand All @@ -26,12 +25,6 @@ Layout/LineLength:
Layout/EmptyLines:
Exclude: *xfiles

Style/MutableConstant:
Exclude:
# CocoaPods mutates some input values.
# It's simpler to relax this rule than to address each individually by passing mutable copies.
- Gutenberg/cocoapods_helpers.rb

Style/AsciiComments:
Exclude: *xfiles

Expand Down
2 changes: 0 additions & 2 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ rubocop.lint(files: [], force_exclusion: true, inline_comment: true, fail_on_inl

manifest_pr_checker.check_all_manifest_lock_updated

podfile_checker.check_podfile_does_not_have_branch_references

ios_release_checker.check_core_data_model_changed
ios_release_checker.check_release_notes_and_app_store_strings

Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

source 'https://rubygems.org'

gem 'cocoapods', '~> 1.16'
gem 'danger-dangermattic', '~> 1.2'
gem 'dotenv'
# 2.223.1 includes a fix for an ASC-interfacing issue
Expand Down
52 changes: 0 additions & 52 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
artifactory (3.0.17)
ast (2.4.2)
atomos (0.1.3)
Expand Down Expand Up @@ -53,43 +50,6 @@ GEM
cork
nap
open4 (~> 1.3)
cocoapods (1.16.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.16.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.27.0, < 2.0)
cocoapods-core (1.16.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
Expand Down Expand Up @@ -131,9 +91,6 @@ GEM
dotenv (2.8.1)
drb (2.2.1)
emoji_regex (3.2.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
excon (0.112.0)
faraday (1.10.4)
faraday-em_http (~> 1.0)
Expand Down Expand Up @@ -231,9 +188,6 @@ GEM
xcodeproj (~> 1.22)
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
ffi (1.17.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
git (1.19.1)
addressable (~> 2.8)
Expand Down Expand Up @@ -295,13 +249,11 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.8)
minitest (5.25.4)
molinillo (0.8.0)
multi_json (1.15.0)
multipart-post (2.4.1)
nanaimo (0.4.0)
nap (1.1.0)
naturally (2.2.1)
netrc (0.11.0)
nkf (0.2.0)
nokogiri (1.17.2)
mini_portile2 (~> 2.8.2)
Expand Down Expand Up @@ -356,7 +308,6 @@ GEM
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-macho (2.5.1)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand All @@ -382,8 +333,6 @@ GEM
tty-screen (0.8.2)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
Expand All @@ -405,7 +354,6 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.16)
danger-dangermattic (~> 1.2)
dotenv
fastlane (~> 2.226)
Expand Down
Loading

0 comments on commit bb6c179

Please sign in to comment.