Skip to content

Commit

Permalink
Reimplement logic to download XCFrameworks from make to rake
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Feb 5, 2025
1 parent cbee53a commit 5189e4b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
4 changes: 1 addition & 3 deletions .buildkite/commands/shared-set-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ echo "--- :swift: Setting up Swift Packages"
install_swiftpm_dependencies

echo "--- :xcode: Fetch XCFrameworks"
pushd WordPress
make dependencies
popd
rake dependencies
24 changes: 23 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ XCODE_WORKSPACE = 'WordPress.xcworkspace'
XCODE_SCHEME = 'WordPress'
XCODE_CONFIGURATION = 'Debug'
EXPECTED_XCODE_VERSION = File.read('.xcode-version').rstrip
GUTENBERG_VERSION = 'v1.121.0'

PROJECT_DIR = __dir__
abort('Project directory contains one or more spaces – unable to continue.') if PROJECT_DIR.include?(' ')

task default: %w[test]

desc 'Install required dependencies'
task dependencies: %w[dependencies:check assets:check]
task dependencies: %w[dependencies:check assets:check dependencies:gutenberg_xcframeworks]

namespace :dependencies do
task check: %w[ruby:check bundler:check bundle:check credentials:apply]
Expand Down Expand Up @@ -100,6 +101,27 @@ bundle exec fastlane run configure_apply force:true
sh(command)
end
end

desc 'Download and extract Gutenberg xcframeworks'
task :gutenberg_xcframeworks do
puts 'Setting up Gutenberg xcframeworks...'

frameworks_dir = 'WordPress/Frameworks'
gutenberg_tar_gz_download_path = "#{frameworks_dir}/Gutenberg.tar.gz"

sh "mkdir -p #{frameworks_dir}"
sh "curl https://cdn.a8c-ci.services/gutenberg-mobile/Gutenberg-#{GUTENBERG_VERSION}.tar.gz --output #{gutenberg_tar_gz_download_path} -C -"
sh "tar -xf #{gutenberg_tar_gz_download_path} -C #{frameworks_dir}/ -k"
sh "mv -n #{frameworks_dir}/Frameworks/*.xcframework #{frameworks_dir}/"
sh "rm -rf #{frameworks_dir}/Frameworks #{frameworks_dir}/dummy.txt"

FileUtils.mkdir_p [
"#{frameworks_dir}/hermes.xcframework/ios-arm64/dSYMs",
"#{frameworks_dir}/hermes.xcframework/ios-arm64_x86_64-simulator/dSYMs"
]

puts 'Gutenberg xcframeworks setup complete'
end
end

namespace :assets do
Expand Down
Empty file removed WordPress/Frameworks/.gitkeep
Empty file.
10 changes: 0 additions & 10 deletions WordPress/Makefile

This file was deleted.

0 comments on commit 5189e4b

Please sign in to comment.