Skip to content

Commit

Permalink
Use relative paths when importing the local Gutenberg podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed May 31, 2023
1 parent aae9a1e commit e9dca95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Gutenberg/Gutenberg.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Pod::Spec.new do |s|
s.version = '1.0.0' # The value here is irrelevant, but required
s.summary = 'A spec to help integrating the Gutenberg XCFramework'
s.homepage = 'https://apps.wordpress.com'
s.license = { type: 'GPL', file: File.join(__dir__, '..', 'LICENSE') }
s.license = { type: 'GPL', file: '../LICENSE' }
s.authors = 'Automattic'

s.ios.deployment_target = '13.0' # TODO: Read from common source
Expand All @@ -43,7 +43,9 @@ Pod::Spec.new do |s|
# care of downloading and unarchiving and use a local source.
#
# s.source = { http: xcframework_archive_url }
s.source = { http: "file://#{GUTENBERG_DOWNLOADS_DIRECTORY}/Gutenberg-#{gutenberg_version}.tar.gz" }
path = Pathname.new("#{GUTENBERG_DOWNLOADS_DIRECTORY}/Gutenberg-#{gutenberg_version}.tar.gz")
.relative_path_from(__dir__).to_s
s.source = { http: "file://#{path}" }
s.vendored_frameworks = [
'Aztec.xcframework',
'Gutenberg.xcframework',
Expand Down
5 changes: 4 additions & 1 deletion Gutenberg/cocoapods_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

require 'archive/tar/minitar'
require 'net/http'
require 'pathname'
require 'ruby-progressbar'
require 'uri'
require 'zlib'
Expand Down Expand Up @@ -89,7 +90,9 @@ def gutenberg_pod(config: GUTENBERG_CONFIG)

gutenberg_dependencies(options: options)
elsif options[:commit]
pod 'Gutenberg', path: File.join(__dir__, 'gutenberg.podspec')
# Notice the use of relative path, otherwise we'd get the full path of the user that run the `pod install` command tracked in Podfile.lock.
# Also notice the path is relative from Dir.pwd, that is, the location where the script running this code is invoked.
pod 'Gutenberg', path: Pathname.new(File.join(__dir__, 'Gutenberg.podspec')).relative_path_from(Dir.pwd).to_s
end
end
# rubocop:enable Metrics/AbcSize
Expand Down

0 comments on commit e9dca95

Please sign in to comment.