lib/cocoapods-jxedt/binary/hooks/pre_install.rb in cocoapods-jxedt-0.0.13 vs lib/cocoapods-jxedt/binary/hooks/pre_install.rb in cocoapods-jxedt-0.0.14
- old
+ new
@@ -19,18 +19,19 @@
unless Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
raise STDERR.puts "[!] cocoapods-jxedt binary plugin should use cocoapods version greater than '1.10.0'`".red
end
require_relative '../helper/prebuild_sandbox'
+ require_relative '../helper/prebuild_installer'
- # 如果是Pod::PrebuildSandbox类则直接返回
- return if @installer_context.sandbox.is_a?(Pod::PrebuildSandbox)
+ # 如果是Pod::JxedtPrebuildSandbox类则直接返回
+ return if @installer_context.sandbox.is_a?(Pod::JxedtPrebuildSandbox)
# 获取原始的installer对象,必须先获取对象
original_installer = ObjectSpace.each_object(Pod::Installer).first
- prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(@installer_context.sandbox)
- source_installer = Pod::Installer.new(prebuild_sandbox, @installer_context.podfile, @installer_context.lockfile)
+ prebuild_sandbox = Pod::JxedtPrebuildSandbox.from_standard_sandbox(@installer_context.sandbox)
+ source_installer = Pod::JxedtPrebuildInstaller.new(prebuild_sandbox, @installer_context.podfile, @installer_context.lockfile)
# 设置原始的installer携带的参数
source_installer.update = original_installer.update
source_installer.repo_update = original_installer.repo_update
# 执行install
source_installer.install!
@@ -49,24 +50,23 @@
checksum = prebuild_sandbox.source_lockfile.spec_checksums_hash_key(name)
hash.update(name => checksum) unless checksum.nil?
end
require 'cocoapods-jxedt/git_helper/cache_fetcher'
- binary_dir = @installer_context.sandbox.root + Jxedt.config.binary_dir
+ binary_dir = @installer_context.sandbox.standard_sandbox_root + Jxedt.config.binary_dir
Jxedt::CacheFetcher.sync(binary_hash, binary_dir)
end
# prebuild_job
- prebuild_sandbox.link_source_project!
if Jxedt.config.prebuild_job?
log_section "🚀 Prebuild frameworks"
build_targets = Jxedt::Prebuild.new(source_installer).build
# cache push
if Jxedt.config.cache_repo_enabled? && Jxedt.config.auto_push? && build_targets && build_targets.size > 0
log_section "🚄 Push git cache"
require 'cocoapods-jxedt/git_helper/cache_pucher'
- output_dir = prebuild_sandbox.root + Jxedt.config.binary_dir
+ output_dir = prebuild_sandbox.standard_sandbox_root + Jxedt.config.binary_dir
Jxedt::CachePucher.push(output_dir, build_targets, false)
end
end
prebuild_sandbox.clean_source_project!
\ No newline at end of file